Incorrect preallocation should never cause a crash (just possibly slower code). You need to run valgrind http://www.mcs.anl.gov/petsc/petsc-as/documentation/faq.html#valgrind
Barry On Apr 6, 2011, at 6:53 PM, NAN ZHAO wrote: > Dear all, > > I tried to use ksp to solve some problem. I got some Segmentation Violation > error. And I got result from the solver as below. I am wondering if the ksp > matrix has some error, cause I got the nonzeros allocated wrong. Can anyone > dig out some valuable information from the ksp output? Thanks. > -------------------------------------------------------------------------------------------------- > total: nonzeros=38449, allocated nonzeros=52103 > reason code = 2, its = 2546 > KSP Object: > type: gmres > GMRES: restart=30, using Classical (unmodified) Gram-Schmidt > Orthogonalization with no iterative refinement > GMRES: happy breakdown tolerance 1e-30 > maximum iterations=5000, initial guess is zero > tolerances: relative=1e-05, absolute=1e-50, divergence=10000 > left preconditioning > PC Object: > type: ilu > ILU: 0 levels of fill > ILU: factor fill ratio allocated 1 > ILU: tolerance for zero pivot 1e-12 > out-of-place factorization > matrix ordering: natural > ILU: factor fill ratio needed 0 > Factored matrix follows > Matrix Object: > type=seqbaij, rows=2903, cols=2903 > total: nonzeros=38449, allocated nonzeros=52103 > block size is 1 > linear system matrix = precond matrix: > Matrix Object: > type=seqbaij, rows=2903, cols=2903 > total: nonzeros=38449, allocated nonzeros=52103 > block size is 1 > > Nan
