[petsc-users] Problem with MatCreateSeqAIJWithArrays

Jed Brown jedbrown at mcs.anl.gov
Thu Sep 19 01:30:13 CDT 2013


Chung-Kan Huang <ckhuangf at gmail.com> 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20130919/52e34327/attachment.pgp>


More information about the petsc-users mailing list