Function utils::unwindingFromLocalError
Defined in File MPIUtils.hpp
Function Documentation
-
inline auto utils::unwindingFromLocalError() -> bool
Return whether this rank is unwinding from an exception the other ranks do not know about.
Intended for destructors that would otherwise make collective MPI calls (e.g. OutputManagerH5’s). When this returns true, the other ranks are not unwinding along with this one: they are carrying on with the run, or are already waiting in some other collective. A collective call here would not match theirs, so it would never complete, and the error would never reach main() to be reported. Such a destructor should instead do only rank-local cleanup, and leave main() to report the error and call mpiAbortIfMultiRank().
- Returns:
True if this is a multi-rank MPI run, an exception is currently propagating (std::uncaught_exceptions() > 0), and that exception is not an agreed one (see errorIsAgreed()); always false outside MPI, or with a single rank