From: rnv Date: Mon, 3 Aug 2020 18:59:06 +0000 (+0300) Subject: Build MEDCOUPLING with native openmpi on CentOS-8 X-Git-Tag: V9_5_asterxx_0~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=88c5b0e453a8e55a1f69ac80853148fb8548c260;p=tools%2Fmedcoupling.git Build MEDCOUPLING with native openmpi on CentOS-8 --- diff --git a/src/ParaMEDMEMTest/MPI2Connector.cxx b/src/ParaMEDMEMTest/MPI2Connector.cxx index 9b7844ad2..87b16bfb2 100644 --- a/src/ParaMEDMEMTest/MPI2Connector.cxx +++ b/src/ParaMEDMEMTest/MPI2Connector.cxx @@ -26,6 +26,12 @@ #include #endif +#if OMPI_MAJOR_VERSION >= 4 +#define MPI_ERROR_HANDLER(var) MPI_Comm_set_errhandler(MPI_COMM_WORLD, var); +#else +#define MPI_ERROR_HANDLER(var) MPI_Errhandler_set(MPI_COMM_WORLD, var); +#endif + MPI2Connector::MPI2Connector() { MPI_Comm_size( MPI_COMM_WORLD, &_nb_proc ); @@ -54,8 +60,7 @@ MPI_Comm MPI2Connector::remoteMPI2Connect(const std::string& service) _srv = false; MPI_Barrier(MPI_COMM_WORLD); - - MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN); + MPI_ERROR_HANDLER(MPI_ERRORS_RETURN); if( _num_proc == 0 ) { /* rank 0 try to be a server. If service is already published, try to be a cient */ @@ -104,7 +109,7 @@ MPI_Comm MPI2Connector::remoteMPI2Connect(const std::string& service) throw std::exception(); } } - MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL); + MPI_ERROR_HANDLER(MPI_ERRORS_ARE_FATAL); /* If rank 0 is server, all processes call MPI_Comm_accept */ /* If rank 0 is not server, all processes call MPI_Comm_connect */