diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 5809f6e4c276f7ae1bc56cdc3518635f7c98dab6..1ffd5dc41738adbd91d5e5f0d8692ea9ef94909a 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -98,13 +98,16 @@ add_custom_target(tests-cleanup ${CMAKE_COMMAND} -E remove -f testrunner.xml) set_target_properties(tests-cleanup PROPERTIES FOLDER Testing) if(OGS_USE_PETSC) + if("${HOSTNAME}" STREQUAL "frontend1") + set(MPIRUN_ARGS --mca btl_openib_allow_ib 1) + endif() set(TEST_FILTER_MPI --gtest_filter=-MPITest*) add_custom_target(tests - mpirun -np 1 $<TARGET_FILE:testrunner> ${TESTRUNNER_ADDITIONAL_ARGUMENTS} ${TEST_FILTER_MPI} + mpirun ${MPIRUN_ARGS} -np 1 $<TARGET_FILE:testrunner> ${TESTRUNNER_ADDITIONAL_ARGUMENTS} ${TEST_FILTER_MPI} DEPENDS testrunner tests-cleanup ) add_custom_target(tests_mpi - mpirun -np 3 $<TARGET_FILE:testrunner> --gtest_filter=MPITest* + mpirun ${MPIRUN_ARGS} -np 3 $<TARGET_FILE:testrunner> --gtest_filter=MPITest* DEPENDS testrunner ) set_target_properties(tests_mpi PROPERTIES FOLDER Testing) diff --git a/scripts/cmake/test/AddTest.cmake b/scripts/cmake/test/AddTest.cmake index 5b0583398dbc1dd8f7bba022975a0bf0ebfedc86..1412ac7b3e927d7ef7c547763e45ea858274d8af 100644 --- a/scripts/cmake/test/AddTest.cmake +++ b/scripts/cmake/test/AddTest.cmake @@ -104,6 +104,9 @@ function (AddTest) endif() elseif(AddTest_WRAPPER STREQUAL "mpirun") if(MPIRUN_TOOL_PATH) + if("${HOSTNAME}" STREQUAL "frontend1") + set(AddTest_WRAPPER_ARGS ${AddTest_WRAPPER_ARGS} --mca btl_openib_allow_ib 1) + endif() set(WRAPPER_COMMAND ${MPIRUN_TOOL_PATH}) else() message(STATUS "ERROR: mpirun was not found but is required for ${AddTest_NAME}!")