[petsc-users] Memory allocated for a matrix

Jed Brown jed at 59A2.org
Tue May 31 08:21:43 CDT 2011

On Tue, May 31, 2011 at 09:44, Thomas Witkowski <
thomas.witkowski at tu-dresden.de> wrote:

> Is there a simple way to get the amount of memory that was allocated for a
> specific matrix?

If complied --with-log=1 (the default), then

PetscLogDouble allocated = ((PetscObject)mat)->mem;

will give you the total amount of memory that was logged as being allocated
for the matrix. This is not necessarily everything, and I don't know if
reallocation (if you didn't preallocate correctly) is logged consistently.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110531/0abf1c8c/attachment.htm>

More information about the petsc-users mailing list