dune-common
2.2.1
|
detects a thrown exception and communicates to all other processes More...
#include <dune/common/mpiguard.hh>
Public Member Functions | |
MPIGuard (bool active=true) | |
create an MPIGuard operating on the Communicator of the global Dune::MPIHelper | |
MPIGuard (MPIHelper &m, bool active=true) | |
create an MPIGuard operating on the Communicator of a special Dune::MPIHelper m | |
template<class C > | |
MPIGuard (const C &comm, bool active=true) | |
create an MPIGuard operating on an arbitrary communicator. | |
~MPIGuard () | |
destroy the guard and check for undetected exceptions | |
void | reactivate () |
reactivate the guard. | |
void | finalize (bool success=true) |
stop the guard. |
detects a thrown exception and communicates to all other processes
You create a MPIGuard object. If an exception is risen on a process the MPIGuard detects the exception, because the finalize method was not called. when reaching the finalize call all other processes are informed that an error occured and the MPIGuard throws an exception of type MPIGuardError.
|
inline |
create an MPIGuard operating on the Communicator of the global Dune::MPIHelper
active | should the MPIGuard be active upon creation? |
|
inline |
create an MPIGuard operating on the Communicator of a special Dune::MPIHelper m
|
inline |
create an MPIGuard operating on an arbitrary communicator.
Supported types for the communication object are:
comm | reference to a communication object |
active | should the MPIGuard be active upon creation? |
|
inline |
destroy the guard and check for undetected exceptions
References finalize().
|
inline |
stop the guard.
If no success parameter is passed, the guard assumes that everything worked as planned. All errors are communicated and an exception of type MPIGuardError is thrown if an error (or exception) occured on any of the processors in the communicator.
success | inform the guard about possible errors |
References DUNE_THROW.
Referenced by reactivate(), and ~MPIGuard().
|
inline |
reactivate the guard.
If the guard is still active finalize(true) is called first.
References finalize().