50 if (err == MPI_SUCCESS) {
54 char rawErrString[MPI_MAX_ERROR_STRING];
56 (void) MPI_Error_string (err, rawErrString, &len);
57 return std::string (rawErrString);
64 const int err = MPI_Finalized (&finalized);
67 if (err == MPI_SUCCESS && ! finalized) {
71 (void) MPI_Comm_free (comm);
77 return MPI_Comm_set_errhandler (comm, handler);
79 return MPI_Errhandler_set (comm, handler);
80 #endif // MPI_VERSION >= 2 int setCommErrhandler(MPI_Comm comm, MPI_Errhandler handler)
void safeCommFree(MPI_Comm *comm)
Give comm to MPI_Comm_free, if MPI is not yet finalized.
Teuchos implementation details.
std::string mpiErrorCodeToString(const int err)
Human-readable string version of the given MPI error code.