Postproc¶
-
class
Postprocess
: mirheo::MirObject¶ Manage post processing tasks (see
Plugin
) related to aSimulation
.There must be exactly one
Postprocess
rank perSimulation
rank or noPostprocess
rank at all. AllPlugin
objects must be registered and set before calling init() and run(). This can be instantiated on ranks that have no access to GPUs.The run() method consists in waiting for messages incoming from the simulation ranks and execute the registered plugins functions with that data.
Public Functions
-
Postprocess
(MPI_Comm &comm, MPI_Comm &interComm, const CheckpointInfo &checkpointInfo)¶ Construct a
Postprocess
object.- Parameters
comm
: a communicator that holds all postprocessing ranks.interComm
: An inter communicator to communicate with theSimulation
ranks.checkpointInfo
: Checkpoint configuratoin.
Register a plugin to this object.
- Note
- The SimulationPlugin counterpart of the registered PostprocessPlugin must be registered on the simulation side.
- Parameters
plugin
: The plugin to registertag
: a tag that is unique for each registered plugin
-
void
deregisterPlugin
(PostprocessPlugin *plugin)¶ Deregister a postprocess plugin.
- Note
- The SimulationPlugin counterpart of the deregistered PostprocessPlugin must also be deregistered. An exception is thrown if the plugin is not found.
- Parameters
plugin
: The plugin to deregister
-
void
run
()¶ Start the postprocess. Will run until a termination notification is sent by the simulation.
-
void
restart
(const std::string &folder)¶ Restore the state from checkpoint information.
- Parameters
folder
: The path containing the checkpoint files
-
void
checkpoint
(int checkpointId)¶ Dump the state of all postprocess plugins to the checkpoint folder.
- Parameters
checkpointId
: The index of the dump, used to name the files.
-