![]() |
QMCPACK
|
This a subclass for runtime errors that will occur on all ranks. More...
Public Member Functions | |
UniformCommunicateError (const std::string &what_arg) | |
UniformCommunicateError (const char *what_arg) | |
This a subclass for runtime errors that will occur on all ranks.
This is intended to be thrown and caught within a single Communicate context.
Intended use is with a catch block like this:
catch (const UniformMPIerror& ue) { my_local_comm->barrier_and_abort(ue.what()); }
Which insures that the error message actually makes it out on the head rank before the MPI processes are aborted.
If even one member of the comm i.e. my_local_comm does not experience the issue you will HANG the job until the walltime expires. When in doubt it is better to lose the error message until the crash is examined in a debugger.
Because of this you should catch the exception as soon as you have access to a Communicate instance. However unlike the unit test hostile comm->barrier_and_abort
you can and should check that an exception is emitted so don't catch it in the same method/function.
Definition at line 39 of file UniformCommunicateError.h.
|
inline |
Definition at line 42 of file UniformCommunicateError.h.
|
inline |
Definition at line 43 of file UniformCommunicateError.h.