Commit c2d721a0 authored by GILLES Sebastien's avatar GILLES Sebastien

#1232 Check error codes in Mpi to cancel out some gcc (rightful) warnings.

parent d8f656c3
......@@ -83,12 +83,23 @@ namespace MoReFEM
const auto& communicator = GetCommunicator();
int error_code = MPI_Comm_rank(communicator, &rank_);
if (error_code != MPI_SUCCESS)
throw ExceptionNS::Mpi::Exception("Didn't manage to get rank information through MPI_Comm_rank() call",
__FILE__, __LINE__);
error_code = MPI_Comm_size(communicator, &Nprocessor_);
if (error_code != MPI_SUCCESS)
throw ExceptionNS::Mpi::Exception(rank_, error_code, __FILE__, __LINE__);
PRAGMA_DIAGNOSTIC(push)
PRAGMA_DIAGNOSTIC(ignored "-Wold-style-cast")
error_code = MPI_Comm_set_errhandler(communicator, MPI_ERRORS_RETURN);
PRAGMA_DIAGNOSTIC(pop)
if (error_code != MPI_SUCCESS)
throw ExceptionNS::Mpi::Exception(rank_, error_code, __FILE__, __LINE__);
IncrementNalive();
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment