From d978f6c0ca3f386a39fa57680a8bdb9369cd4a3e Mon Sep 17 00:00:00 2001 From: Algiane Froehly Date: Tue, 5 Dec 2023 17:18:12 +0100 Subject: [PATCH] Attempt to fix issue with openmpi-5 and --help command to detect oversubscribe command line option support. --- CMakeLists.txt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 504f7d2f..f0f64b95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -178,13 +178,11 @@ MESSAGE( STATUS "Compilation with mpi" ) SET( LIBRARIES ${MPI_C_LIBRARIES} ${LIBRARIES} ) SET( LIBRARIES ${MPI_CXX_LIBRARIES} ${LIBRARIES} ) -EXECUTE_PROCESS ( COMMAND ${MPIEXEC} --help mapping +EXECUTE_PROCESS ( COMMAND ${MPIEXEC} --oversubscribe sleep 1 RESULT_VARIABLE CMD_ERROR OUTPUT_VARIABLE CMD_OUTPUT ) -STRING(REGEX REPLACE "\"" " " CMD_OUT "${CMD_OUTPUT}") - -IF ( "${CMD_OUT}" MATCHES "oversubscribe" ) +IF ( "${CMD_ERROR}" MATCHES "0" ) SET ( MPI_ARGS "-oversubscribe" ) ENDIF()