[petsc-users] Measuring memory consumption

Zhang, Hong hzhang at mcs.anl.gov
Thu Aug 13 10:10:55 CDT 2020


Pascal,
You may try an easy way first, i.e., using runtime option. For example, petsc/src/ksp/ksp/tutorials/ex2.c:
1) ./ex2 -pc_type lu -pc_factor_mat_solver_type mumps -help |grep mumps
-pc_factor_mat_solver_type <now mumps : formerly (null)>: Specific direct solver to use (MatGetFactor)
  -mat_mumps_icntl_1 <now 6 : formerly 6>: ICNTL(1): output stream for error messages (None)
  -mat_mumps_icntl_2 <now 0 : formerly 0>: ICNTL(2): output stream for diagnostic printing, statistics, and warning (None)
  -mat_mumps_icntl_3 <now 0 : formerly 0>: ICNTL(3): output stream for global information, collected on the host (None)
  -mat_mumps_icntl_4 <now 0 : formerly 0>: ICNTL(4): level of printing (0 to 4) (None)
...
it tells you that '-mat_mumps_icntl_4 <#>' prints mumps internal info

2) ./ex2 -pc_type lu -pc_factor_mat_solver_type mumps -mat_mumps_icntl_4 2
MEMORY ESTIMATIONS ...
 Estimations with standard Full-Rank (FR) factorization:
    Total space in MBytes, IC factorization      (INFOG(17)):           0
    Total space in MBytes,  OOC factorization    (INFOG(27)):           0

 Elapsed time in analysis driver=       0.0006

Entering DMUMPS 5.2.1 from C interface with JOB, N, NNZ =   2          56            250
      executing #MPI =      1, without OMP



****** FACTORIZATION STEP ********

 GLOBAL STATISTICS PRIOR NUMERICAL FACTORIZATION ...
 Number of working processes                =               1
 ICNTL(22) Out-of-core option               =               0
 ICNTL(35) BLR activation (eff. choice)     =               0
 ICNTL(14) Memory relaxation                =              20
 INFOG(3) Real space for factors (estimated)=             556
 INFOG(4) Integer space for factors (estim.)=            1135
 Maximum frontal size (estimated)           =              11
 Number of nodes in the tree                =              39
 Memory allowed (MB -- 0: N/A )             =               0
 Memory provided by user, sum of LWK_USER   =               0
...

Hong
________________________________
From: petsc-users <petsc-users-bounces at mcs.anl.gov> on behalf of Barry Smith <bsmith at petsc.dev>
Sent: Wednesday, August 12, 2020 11:17 PM
To: Kraft, Pascal (IANM) <pascal.kraft at kit.edu>
Cc: petsc-users at mcs.anl.gov <petsc-users at mcs.anl.gov>
Subject: Re: [petsc-users] Measuring memory consumption


 Pascal,

 Do

  KSPGetPC(ksp,&pc);
  PCFactorGetMatrix(pc,fact)
  PetscViewerPushFormat(PETSC_VIEWER_STDOUT_(PetscObjectComm((PetscObject)fact)),PETSC_VIEWER_ASCII_INFO);
  MatView(fact,PETSC_VIEWER_STDOUT_(PetscObjectComm((PetscObject)fact);
  PetscViewerPopFormat(PETSC_VIEWER_STDOUT_(PetscObjectComm((PetscObject)fact));

   after

   SNES/KSPSolve

  this should print the various MUMPS variables related to memory usage.

  This is processed in /src/mat/impls/aij/mpi/mumps/mumps.c

   If you want to process the values directly in the application code you can look at this file and see how it is extracting the memory values from the mumps variables and use the variables directly in your code.

  Barry



On Aug 12, 2020, at 6:52 PM, Kraft, Pascal (IANM) <pascal.kraft at kit.edu<mailto:pascal.kraft at kit.edu>> wrote:

Dear PETSc Users,

I use the MUMPS wrapper in PETSc (loaded from dealii). I know that MUMPS computes a factorization based on the mulrifrontal method and since I have a very memory-strapped problem, I would like to run some test on the memory requirements for the factorizations across some sets of parameters in my underlying FEM-problem.
My question is if there is a native way to check memory (as a measure of fill-in) for the MUMPS factorization in PETSc. I would prefer not to go through the operating system since that feels somewhat inconclusive to me. Does PETSc provide such functionality in any way?
I would prefer to know the memory consumption for storing the factorization if that is possible, I would also take the total memory consumption of the direct solver if there is no other way, and, if nothing else is possible, I guess I would have to go with the memory requirement of the whole application if all else fails.
Is anyone aware of something I can do?

Kind regards,
Pascal

--------------------------------------------------------------------------
Karlsruhe Institute of Technology (KIT)
Institute for Applied and Numerical Mathematics

Kraft, Pascal
Research scientist

Englerstraße 2
Gebäude 20.30
76130, Germany

Phone: +49 721 608-42801
Mobile: +49 163 6927612
E-mail: pascal.kraft∂kit.edu<http://kit.edu/>
Web: www.math.kit.edu/ianm2/~kraft/de<http://www.math.kit.edu/ianm2/~kraft/de>
KIT – The Research University in the Helmholtz Association

Since 2010, the KIT has been certified as a family-friendly university.

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


More information about the petsc-users mailing list