PetscGarbageCleanup#
Destroys objects placed in the garbage by PetscObjectDelayedDestroy()
.
Synopsis#
Collective
Input Parameter#
comm - MPI communicator over which to perform collective cleanup
Notes#
Implements a collective garbage collection.
A per- MPI communicator garbage dictionary is created to store
references to objects destroyed using PetscObjectDelayedDestroy()
.
Objects that appear in this dictionary on all MPI processes can be destroyed
by calling PetscGarbageCleanup()
.
This is done as follows#
Keys of the garbage dictionary, which correspond to the creation indices of the objects stashed, are sorted.
A collective intersection of dictionary keys is performed by all ranks in the communicator.
The intersection is broadcast back to all ranks in the communicator.
The objects on the dictionary are collectively destroyed in creation index order using a call to PetscObjectDestroy().
This function is intended for use with managed languages such as Python or Julia, which may not destroy objects in a deterministic order.
See Also#
PetscObjectDelayedDestroy()
Level#
developer
Location#
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages