Skip to content
Permalink
Browse files

Solve OpenMPI binding issue

The OpenMPI -oversubscribe feature was backported to the 2.X series.
Without the -oversubscribe flag, tests running on hyperthreaded CPUs
with more threads than cores using OpenMPI 2.X may exit early with
an exit code of 0, causing these tests to silently fail.
  • Loading branch information
jngrad committed Nov 21, 2019
1 parent 75cb7aa commit 565dfbe00b77ead8ea606a9c11bf6552a0a0c5f1
Showing with 2 additions and 2 deletions.
  1. +2 −2 cmake/unit_test.cmake
@@ -5,9 +5,9 @@ if(NOT DEFINED TEST_NP)
endif()

if(EXISTS ${MPIEXEC})
# OpenMPI 3.0 and higher checks the number of processes against the number of CPUs
# OpenMPI 2.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 ERROR_VARIABLE mpi_version_output)
if (mpi_version_result EQUAL 0 AND mpi_version_output MATCHES "\\(Open(RTE| MPI)\\) ([3-9]\\.|1[0-9])")
if (mpi_version_result EQUAL 0 AND mpi_version_output MATCHES "\\(Open(RTE| MPI)\\) ([2-9]\\.|1[0-9])")
set(MPIEXEC_OVERSUBSCRIBE "-oversubscribe")
else()
set(MPIEXEC_OVERSUBSCRIBE "")

0 comments on commit 565dfbe

Please sign in to comment.
You can’t perform that action at this time.