[CIG-SHORT] Understanding the memory usage

Brad Aagaard baagaard at usgs.gov
Wed Aug 1 08:06:41 PDT 2012


Hongfeng,

You do not need to recompile to get total memory usage printed to stdout 
at various stages in a run using

[pylithapp.journal.debug]
timedependent = 1
implicit = 1
petsc = 1
solverlinear = 1
meshiocubit = 1
implicitelasticity = 1
faultcohesivekin = 1
fiatlagrange = 1
pylithapp = 1
materials = 1

NOTE: If you are using explicit time stepping, replace "implict" with 
"explicit".

The command being run to get the information is the unix shell command 
ps with options to get memory info. This is equivalent to "top".

To get much more detailed information, you will need to rebuild with the 
memory logging options

PETSc:
--with-sieve-memory-logging=1

PyLith:
--enable-memory-logging

Additionally, you would also need command line arguments to enable the 
performance memory logger which is still experimental and incomplete. 
These are intended for development use.

Regards,
Brad



On 7/31/12 8:35 PM, Charles Williams wrote:
> Hi Hongfeng,
>
> I'm not sure about the PETSc stuff; however, PyLith does have memory
> logging that we use for debugging.  If you have compiled both PETSc and
> PyLith with this option turned on, you will be able to use it.  For
> PETSc, you need to have configured with:
>
> --with-sieve-memory-logging=1
>
> For PyLith, you need to have configured with:
>
> --enable-memory-logging
>
> Then, to get memory usage, you can turn on the journal debug facility
> for different things, e.g.:
>
> [pylithapp.journal.debug]
> timedependent = 1
> implicit = 1
> petsc = 1
> solverlinear = 1
> meshiocubit = 1
> implicitelasticity = 1
> faultcohesivekin = 1
> fiatlagrange = 1
> pylithapp = 1
> materials = 1
>
>
> I'm not sure if this is what you need or not.
>
> Cheers,
> Charles
>
>
> On 1/08/2012, at 8:00 AM, Hongfeng Yang wrote:
>
>> Hi all,
>>
>> After a simulation, I read the memory usage summary from the running
>> output as the following:
>>
>> Memory usage is given in bytes:
>>
>> Object Type          Creations   Destructions     Memory Descendants' Mem.
>> Reports information only for process 0.
>>
>> --- Event Stage 0: Main Stage
>>
>>               Vector     0             30     14829024     0
>>       Vector Scatter     0              6         6216     0
>>               Viewer     1              0            0     0
>>
>> --- Event Stage 1: Meshing
>>
>>
>> --- Event Stage 2: Setup
>>
>>               Vector    76             51      9908736     0
>>       Vector Scatter    12              8         8288     0
>>               Viewer     8              3         2040     0
>>            Index Set    24             24        17856     0
>>
>> --- Event Stage 3: Reform Jacobian
>>
>>
>> --- Event Stage 4: Reform Residual
>>
>>
>> --- Event Stage 5: Unknown
>>
>>
>> --- Event Stage 6: Prestep
>>
>>
>> --- Event Stage 7: Step
>>
>>               Vector     2              0            0     0
>>
>> --- Event Stage 8: Poststep
>>
>>               Vector    20             12      8623544     0
>>       Vector Scatter     4              2         2072     0
>>            Index Set     8              8         5952     0
>>
>> --- Event Stage 9: Finalize
>>
>>               Vector     0              5         7520     0
>>               Viewer     0              5         3400     0
>>
>> The accumulated memory usage is about 34 M according to the above info.
>> However, looking up the memory usage from "top" on my machine, every
>> single run takes about 3% of the total memory, which is 24 G. That gives
>> an estimation of 720 M per core, a big difference from the Pylith output.
>>
>> Which one really tells me the real memory usage of Pylith? Or am I
>> reading something wrong?
>>
>> Thanks,
>>
>> Hongfeng
>>
>>
>>
>> --
>> Postdoc Investigator
>> Woods Hole Oceanographic Institution
>> Dept. Geology and Geophysics
>> 360 Woods Hole Rd, MS 24
>> Woods Hole, MA 02543
>>
>> _______________________________________________
>> CIG-SHORT mailing list
>> CIG-SHORT at geodynamics.org <mailto:CIG-SHORT at geodynamics.org>
>> http://geodynamics.org/cgi-bin/mailman/listinfo/cig-short
>
> Charles A. Williams
> Scientist
> GNS Science
> 1 Fairway Drive, Avalon
> PO Box 30368
> Lower Hutt  5040
> New Zealand
> ph (office): 0064-4570-4566
> fax (office): 0064-4570-4600
> C.Williams at gns.cri.nz <mailto:C.Williams at gns.cri.nz>
>
>
>
> _______________________________________________
> CIG-SHORT mailing list
> CIG-SHORT at geodynamics.org
> http://geodynamics.org/cgi-bin/mailman/listinfo/cig-short
>




More information about the CIG-SHORT mailing list