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

Matthew Knepley knepley at gmail.com
Mon Jul 27 14:38:08 CDT 2009


On Mon, Jul 27, 2009 at 12:46 PM, BAYRAKTAR Harun
<Harun.BAYRAKTAR at 3ds.com>wrote:

>  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.
>

Is it possible to set the diagonal after the rest of the entires?

  Matt


> Thanks a lot,
>
> Harun
>
-- 
What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments
lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20090727/03cfd04c/attachment.htm>


More information about the petsc-users mailing list