[petsc-users] KSP solver always has Zero pivot in LU

Barry Smith bsmith at mcs.anl.gov
Mon Oct 20 22:38:01 CDT 2014


  What exact options are you running with?  I tried ILU and LU and all was fine.

$ ./ex10 -f0 ~/Desktop/binaryoutput -rhs 0 -mat_view -pc_type lu -ksp_view
Mat Object: 1 MPI processes
  type: seqaij
row 0: (0, 1)  (1, 0)  (3, 0) 
row 1: (0, 0)  (1, 1)  (2, 0)  (4, 0) 
row 2: (1, 0)  (2, 1)  (5, 0) 
row 3: (0, -0.219298)  (3, 1)  (4, -0.561404)  (6, -0.219298) 
row 4: (1, -0.304878)  (3, -0.097561)  (4, 1)  (5, -0.292683)  (7, -0.304878) 
row 5: (2, 0)  (4, 0)  (5, 1)  (8, 0) 
row 6: (3, 0)  (6, 1)  (7, 0) 
row 7: (4, 0)  (6, 0)  (7, 1)  (8, 0) 
row 8: (5, 0)  (7, 0)  (8, 1) 
KSP Object: 1 MPI processes
  type: gmres
    GMRES: restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement
    GMRES: happy breakdown tolerance 1e-30
  maximum iterations=10000, initial guess is zero
  tolerances:  relative=1e-05, absolute=1e-50, divergence=10000
  left preconditioning
  using PRECONDITIONED norm type for convergence test
PC Object: 1 MPI processes
  type: lu
    LU: out-of-place factorization
    tolerance for zero pivot 2.22045e-14
    matrix ordering: nd
    factor fill ratio given 5, needed 1.54545
      Factored matrix follows:
        Mat Object:         1 MPI processes
          type: seqaij
          rows=9, cols=9
          package used to perform factorization: petsc
          total: nonzeros=51, allocated nonzeros=51
          total number of mallocs used during MatSetValues calls =0
            not using I-node routines
  linear system matrix = precond matrix:
  Mat Object:   1 MPI processes
    type: seqaij
    rows=9, cols=9
    total: nonzeros=33, allocated nonzeros=33
    total number of mallocs used during MatSetValues calls =0
      not using I-node routines
Number of iterations =   1
  Residual norm < 1.e-12
~/Src/petsc/src/ksp/ksp/examples/tutorials (barry/fix-setters *)
$ ./ex10 -f0 ~/Desktop/binaryoutput -rhs 0 -mat_view -pc_type ilu -ksp_view
Mat Object: 1 MPI processes
  type: seqaij
row 0: (0, 1)  (1, 0)  (3, 0) 
row 1: (0, 0)  (1, 1)  (2, 0)  (4, 0) 
row 2: (1, 0)  (2, 1)  (5, 0) 
row 3: (0, -0.219298)  (3, 1)  (4, -0.561404)  (6, -0.219298) 
row 4: (1, -0.304878)  (3, -0.097561)  (4, 1)  (5, -0.292683)  (7, -0.304878) 
row 5: (2, 0)  (4, 0)  (5, 1)  (8, 0) 
row 6: (3, 0)  (6, 1)  (7, 0) 
row 7: (4, 0)  (6, 0)  (7, 1)  (8, 0) 
row 8: (5, 0)  (7, 0)  (8, 1) 
KSP Object: 1 MPI processes
  type: gmres
    GMRES: restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement
    GMRES: happy breakdown tolerance 1e-30
  maximum iterations=10000, initial guess is zero
  tolerances:  relative=1e-05, absolute=1e-50, divergence=10000
  left preconditioning
  using PRECONDITIONED norm type for convergence test
PC Object: 1 MPI processes
  type: ilu
    ILU: out-of-place factorization
    0 levels of fill
    tolerance for zero pivot 2.22045e-14
    using diagonal shift on blocks to prevent zero pivot [INBLOCKS]
    matrix ordering: natural
    factor fill ratio given 1, needed 1
      Factored matrix follows:
        Mat Object:         1 MPI processes
          type: seqaij
          rows=9, cols=9
          package used to perform factorization: petsc
          total: nonzeros=33, allocated nonzeros=33
          total number of mallocs used during MatSetValues calls =0
            not using I-node routines
  linear system matrix = precond matrix:
  Mat Object:   1 MPI processes
    type: seqaij
    rows=9, cols=9
    total: nonzeros=33, allocated nonzeros=33
    total number of mallocs used during MatSetValues calls =0
      not using I-node routines
Number of iterations =   2
  Residual norm < 1.e-12


> On Oct 20, 2014, at 10:02 PM, Sharp Stone <thronesf at gmail.com> wrote:
> 
> Dear All,
> 
> Last week I raised a question about KSP solver with zero pivot problem. Now I downsized the matrix in my problem and still got the zero pivot problem. I looked at the matrix and computed its eigenvalues in matlab, and it seems the matrix is good (not singular, I mean), but petsc still reported zero pivot in LU factorization. What could possibly cause this? Thank you very much in advance!
> 
> PS: I attached the matrix output in my simplest test.
> 
> -- 
> Best regards,
> 
> Feng
> <binaryoutput>



More information about the petsc-users mailing list