Hi Barry, thanks for the quick response.
I am using os x and so I would expect that petsc would be able to use
getrusage in the following lines of mem.c:
115: #elif defined(PETSC_HAVE_GETRUSAGE)
116: getrusage(RUSAGE_SELF,&temp);
Is this not the case?
Here is the link to apple's getrusage manual page
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/10.7/man2/getrusage.2.html
Quoting Barry Smith <[email protected]>:
Colin,
PetscMemoryGetCurrentUsage() and MaximumUsage() us calls to the
underlying operating system to get how much memory the process is
using, as such they will also include external package memory.
Unfortunately it depends on the operating system providing this
information and often it does not, this is why you get 0. If you are
a hacker you could look at the source for
PetscMemoryGetCurrentUsage() and see how to get the information for
your OS and add it to this routine.
Barry
On May 22, 2013, at 6:31 PM, Colin McAuliffe <[email protected]> wrote:
Hi all,
When calling PetscMemoryGetCurrentUsage or
PetscMemoryGetMaximumUsage in a fortran code the memory usage
returned is always zero. Adding command line options such as
-malloc_log and -memory_info doesn't change this result. Is there
something else I'm missing? Also, will use of these two functions
give memory used by external packaged called by petsc?
All the best,
Colin
--
Colin McAuliffe
PhD Candidate
Columbia University
Department of Civil Engineering and Engineering Mechanics
--
Colin McAuliffe
PhD Candidate
Columbia University
Department of Civil Engineering and Engineering Mechanics