Salome HOME
#18963 Minimize compiler warnings
[modules/kernel.git] / src / MPIContainer / MPIObject_i.cxx
index ede2f4dd6124822056f7f12bee9a699746dd56d8..46a07bbc89f272ffe5ae6016a94dd4f8d556958a 100644 (file)
@@ -23,6 +23,7 @@
 #include "MPIObject_i.hxx"
 #include "utilities.h"
 #include "Utils_SALOME_Exception.hxx"
+#include "Basics_MpiUtils.hxx"
 
 #define TIMEOUT 5
 
@@ -49,7 +50,7 @@ Engines::IORTab* MPIObject_i::tior()
   for(unsigned int ip=0;ip<tior->length();ip++)
     tior[ip] = (*_tior)[ip];
   return tior._retn(); 
-};
+}
 
 void MPIObject_i::tior(const Engines::IORTab& ior)
 {
@@ -153,11 +154,7 @@ void MPIObject_i::remoteMPI2Connect(std::string service)
   _srv[service] = false;
 
   MPI_Barrier(MPI_COMM_WORLD);
-#if OMPI_MAJOR_VERSION >= 4
-  MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
-#else
-  MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
-#endif
+  MPI_ERROR_HANDLER(MPI_ERRORS_RETURN);
   MPI_Info_create(&info);
   MPI_Info_set(info, "ompi_unique", "true");
   if( _numproc == 0 )
@@ -206,11 +203,7 @@ void MPIObject_i::remoteMPI2Connect(std::string service)
           throw SALOME_Exception(msg.str().c_str());
         }
     }
-#if OMPI_MAJOR_VERSION >= 4
-  MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL);
-#else
-  MPI_Errhandler_set(MPI_COMM_WORLD, MPI_ERRORS_ARE_FATAL);
-#endif
+  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 */