Postproc

class Postprocess : mirheo::MirObject

Manage post processing tasks (see Plugin) related to a Simulation.

There must be exactly one Postprocess rank per Simulation rank or no Postprocess rank at all. All Plugin 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 the Simulation ranks.
  • checkpointInfo: Checkpoint configuratoin.

void registerPlugin(std::shared_ptr<PostprocessPlugin> plugin, int tag)

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 register
  • tag: 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 init()

Setup all registered plugins. Must be called before run()

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.