Function utils::mpiAbortIfMultiRank
Defined in File MPIUtils.hpp
Function Documentation
-
inline void utils::mpiAbortIfMultiRank(const int exitCode)
Abort every MPI rank, if this is a multi-rank MPI run.
A no-op when SLUG_MPI is not defined or mpiSize() == 1, leaving the caller to exit normally. Otherwise calls MPI_Abort(), which does not return: it terminates every rank in MPI_COMM_WORLD. This is the backstop for an error the other ranks did not agree on (see errorIsAgreed()): they may be blocked in a collective call this rank will never make, and MPI_Finalize() would then block forever as well.
- Parameters:
exitCode – Error code to pass to MPI_Abort()