Avoiding assembly with MatDiagonalSet call for zeroed matrix to preserve preallocated space

BAYRAKTAR Harun Harun.BAYRAKTAR at 3ds.com
Mon Jul 27 12:46:36 CDT 2009


Hello,

 

I have a rather simple question. For a Matrix that was preallocated with
the correct diagonal and offdiagonal nonzero counts the following
operations cause a deallocation of all data except the diagonal which
casues later MatSetValues to have to reallocate.

 

MatCreateSeqAIJ

MatZeroEntries

MatDiagaonalSet

 

Using -info and the debugger I see that MatDiagonalSet ends up calling
MatDiagonalSet_Default which forces an assembly. Is there a way to do
the same thing and preserve the preallocated storage for future use by
MatSetValues? I tried MatSetOption with MAT_KEEP_ZEROED_ROWS and
MAT_IGNORE_ZERO_ENTRIED but it did not help.

 

Thanks a lot,

Harun

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090727/2b3cac2d/attachment.htm>


More information about the petsc-users mailing list