Chung-Kan Huang <[email protected]> writes: > Hi, > > I am writing a testing code that read CRS matrix M and rhs vector B from > two files and solve M*B=X. > > I got error message indicating that I have segmentation fault but problem > disappeared after I removed MatDestroy(& M);
Run in Valgrind to find the problem. > Another problem is that I am not sure if I should have > MatAssemblyBegin(M, MAT_FINAL_ASSEMBLY); > > MatAssemblyEnd(M, MAT_FINAL_ASSEMBLY); > > after > > MatCreateSeqAIJWithArrays(PETSC_COMM_WORLD, nrow, ncol, rowptr, colptr, > mat, &M); No, the last two lines of MatCreateSeqAIJWithArrays is MatAssemblyBegin and MatAssemblyEnd.
pgpLH3xFq3mdI.pgp
Description: PGP signature
