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

BAYRAKTAR Harun Harun.BAYRAKTAR at 3ds.com
Mon Jul 27 15:09:05 CDT 2009


Matt,

 

Your suggestion was what we tried as a workaround before I wrote the
message and it fixes the problem completely. I just wanted to know if
there was a less restrictive way that allows the diagonal set before the
entries. Sounds like there isn't.

 

Thanks,

Harun

 

 

From: petsc-users-bounces at mcs.anl.gov
[mailto:petsc-users-bounces at mcs.anl.gov] On Behalf Of Matthew Knepley
Sent: Monday, July 27, 2009 3:38 PM
To: PETSc users list
Subject: Re: Avoiding assembly with MatDiagonalSet call for zeroed
matrix to preserve preallocated space

 

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/0d8e7a2d/attachment.htm>


More information about the petsc-users mailing list