X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMPIContainer%2FtestMPI2.cxx;h=163e1fa13486180ddcd36cd618a44f7531242180;hb=1f3b94b59127cc48e7e840ab84e85087f538309a;hp=93c33eb9cfa78fb47cdaf97bb4ef86318c4ced58;hpb=e429ce02076e083051c6520e0d7113022bd67b18;p=modules%2Fkernel.git diff --git a/src/MPIContainer/testMPI2.cxx b/src/MPIContainer/testMPI2.cxx index 93c33eb9c..163e1fa13 100644 --- a/src/MPIContainer/testMPI2.cxx +++ b/src/MPIContainer/testMPI2.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2011-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2011-2020 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -58,8 +58,12 @@ int main(int argc, char**argv) MPI_Comm_rank( MPI_COMM_WORLD, &rank ); 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 + #ifdef HAVE_MPI2 MPI_Info_create(&info); MPI_Info_set(info, "ompi_unique", "true"); @@ -105,7 +109,11 @@ int main(int argc, char**argv) exit(1); } } +#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_Bcast(&srv,1,MPI_INT,0,MPI_COMM_WORLD); if ( srv ) MPI_Comm_accept( port_name, MPI_INFO_NULL, 0, MPI_COMM_WORLD, &icom );