TRIQS/mpi 1.3.0
C++ interface to MPI
Loading...
Searching...
No Matches
Event handling

Detailed Description

Communicate and handle events across multiple processes.

A typical use case for the mpi::monitor class could be to monitor and communicate exceptions:

// initialize monitor
mpi::monitor monitor(world);
...
// loop as long as everything is fine
while (!monitor.event_on_any_rank()) {
try {
// do some work
...
} catch (my_exception const &e) {
// report an exception
monitor.report_local_event();
}
}
// finalize communications and check if the computation finished due to an exception
monitor.finalize_communications();
if (!monitor.event_on_any_rank()) {
// do some clean up and maybe stop the program
...
}
// everything went smoothly
...
Constructed on top of an MPI communicator, this class helps to monitor and communicate events across ...
Definition monitor.hpp:53

Classes

class  mpi::monitor
 Constructed on top of an MPI communicator, this class helps to monitor and communicate events across multiple processes. More...