[petsc-users] Memory usage of KSP (or any PETSc object)

Barry Smith bsmith at mcs.anl.gov
Tue Sep 27 22:45:00 CDT 2011


  You must first call PetscMemorySetGetMaximumUsage() at the beginning of your program.

  This will work, but you need to keep in mind that just creating the object generally doesn't take much space, rather it takes more and more space as you add things to it. For example

   getmaxusage()
   MatCreate()

       ... MatSetValues()

   MatAssemblyBegin()
   MatAssemblyEnd() 
   getmaxusage() 

   will tell you how much space the filled matrix takes.

    Barry

On Sep 27, 2011, at 10:39 PM, Mohamad M. Nasr-Azadani wrote:

> Hi, 
> 
> I was trying to find the exact (or more or less exact) memory consumption of any PETSc object. 
> I was wondering how accurate is this method: 
> 
> PetscMemoryGetMaximumUsage(&mem1);
> .
> 
> (creation of any PETSc object).
> .
> 
> 
> 
> PetscMemoryGetMaximumUsage(&mem2);
> 
> Memory = mem2 - mem1; 
> 
> 
> Thanks in advance, 
> Mohamad
> 
> 
> 
> 
> 



More information about the petsc-users mailing list