[petsc-users] Question about -memory_view

Barry Smith bsmith at petsc.dev
Wed Apr 12 16:32:11 CDT 2023



> On Apr 12, 2023, at 4:08 PM, Jorti, Zakariae via petsc-users <petsc-users at mcs.anl.gov> wrote:
> 
> Hello,
> 
> I am running some matrix computations on 64 nodes, using 640 MPI tasks. 
> And I wanted to check the memory usage with the -memory_view flag.
> I get the following output: 
> 
> Summary of Memory Usage in PETSc
> Maximum (over computational time) process memory:        total 3.1056e+11 max 5.9918e+08 min 4.2213e+08
> Current process memory:                                  total 1.9194e+11 max 3.9960e+08 min 2.2761e+08
> 
> 
> What is the difference between maximum process memory and current process memory? 

   Over computational time means the maximum it ever was (the high water mark) and current means what it is right now. For memory usage obtained from the OS (what we call  "process memory" in the output as opposed to PetscMalloc()ed memory)  often the current does not ever go below the maximum it ever was because the "extra now unneeded memory" is not returned to the OS. 


> What does total mean here? (in each node or total of all the nodes)

 Total is sum over all MPI ranks, max is maximum over all ranks, min is minimum over all ranks

> Also, if the job fails because of memory shortage, will this -memory_view still output some information?

   Generally not if the job fails before the memory information is printed. Usually one runs with smaller memory usage increasing the problem size several times to see how the memory usage scales with the problem size (linearly, quadratically, etc) and this guides understanding the memory usage and if it can be improved. Just running with a large memory usage alone is not that useful in providing information.


> 
> Thank you.
> 
> Zakariae

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20230412/339f7648/attachment.html>


More information about the petsc-users mailing list