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 in the intersection are collectively destroyed in creation index order using a call to
PetscObjectDestroy().Objects queued during destruction are added to the dictionary, and the process repeats until the collective intersection is empty.
Objects queued on only some ranks remain in the dictionary for a subsequent
call to PetscGarbageCleanup().
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#
Level#
developer
Location#
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages