1 #ifndef HOPS_MPIINITIALIZERFINALIZER_HPP
2 #define HOPS_MPIINITIALIZERFINALIZER_HPP
13 MPI_Initialized(&isMpiInitialized);
14 if (!isMpiInitialized) {
22 MPI_Finalized(&isMpiFinalized);
23 if (!isMpiFinalized) {
24 int isFinalizeSuccessful = !MPI_Finalize();
25 if (!isFinalizeSuccessful) {
26 throw std::runtime_error(
"MPI failed to finalize.");
32 return INTERNAL_MPI_TAG;
36 constexpr
static int INTERNAL_MPI_TAG = 137;
40 #endif //HOPS_MPIINITIALIZERFINALIZER_HPP