[petsc-dev] user track of undeleted objects

Barry Smith bsmith at mcs.anl.gov
Tue Dec 11 22:56:35 CST 2012



Barrys-MacBook-Pro:tutorials barrysmith$ !./ex
./ex19  -objects_dump
lid velocity = 0.0625, prandtl # = 1, grashof # = 1
Number of SNES iterations = 2
The following objects were never freed
-----------------------------------------
[0] DM da DM_0x84000000_0
      [0]  DMCreate() in /Users/barrysmith/Src/petsc-dev/src/dm/interface/dm.c
      [0]  DMDACreate() in /Users/barrysmith/Src/petsc-dev/src/dm/impls/da/dacreate.c
      [0]  DMDACreate2d() in /Users/barrysmith/Src/petsc-dev/src/dm/impls/da/da2.c
      [0]  main() in src/snes/examples/tutorials/ex19.c

The one caveat is that users who want this feature cannot use PetscFunctionBegin but should instead use PetscFunctionBeginUser

   Barry

Note that this is not completely trivial because in fact 36 other objects (created by PETSc and referenced by the DM) are also not destroyed but if we print them all the user won't know what they have missed.





More information about the petsc-dev mailing list