From 45ac4a96b0e02b660f3c03a908c4508d021522fa Mon Sep 17 00:00:00 2001 From: Michael Kuron <mkuron@icp.uni-stuttgart.de> Date: Sun, 12 Nov 2017 15:24:41 +0100 Subject: [PATCH] Make tests work with OpenMPI 3.0 OpenMPI 3.0 by default does not allow running with more processes than CPUs --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba5cdfcfd..979fac874 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -810,6 +810,12 @@ if ( WALBERLA_BUILD_WITH_MPI AND NOT WALBERLA_CXX_COMPILER_IS_MPI_WRAPPER ) endif ( ) endif ( ) endif ( ) + +# OpenMPI 3.0 and higher checks the number of processes against the number of CPUs +execute_process(COMMAND ${MPIEXEC} --version RESULT_VARIABLE mpi_version_result OUTPUT_VARIABLE mpi_version_output) +if (mpi_version_result EQUAL 0 AND mpi_version_output MATCHES "\\(Open(RTE| MPI)\\) ([3-9]\\.|1[0-9])") + set ( MPIEXEC_PREFLAGS "${MPIEXEC_PREFLAGS} -oversubscribe" ) +endif() ############################################################################################################################ -- GitLab