[petsc-dev] How can we improve log_view about objects created and destroyed?

Stefano Zampini stefano.zampini at gmail.com
Fri Sep 1 02:42:23 CDT 2017


As it is now, if you create any object and use PetscObjectRegisterDestroy,
the output from log_view may be misleading, as it will show something like
this


Memory usage is given in bytes:

Object Type          Creations   Destructions     Memory  Descendants' Mem.
Reports information only for process 0.

--- Event Stage 0: Main Stage

           Index Set   237            237       310852     0.
   IS L to G Mapping    53             35        75260     0.
   Application Order     2              2         2352     0.
              Vector   617            582      1312048     0.
      Vector Scatter    41             23        15088     0.
.....


In this example, the objects registered for destroy where also composed
with l2g maps and scatters.
So the user may think of having memory leaks somewhere. But running with
-malloc_dump (or  under valgrind --leak-check=full) the output is clean.
This is because PetscObjectRegisterDestroyAll is called after PetscLogView
in PetscFinalize().

What if the reason to call PetscObjectRegisterDestroyAll after
PetscLogView? Just for having PETSC_VIEWER_STDOUT_WORLD available?


-- 
Stefano
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20170901/b28ea88f/attachment.html>


More information about the petsc-dev mailing list