Skip to content

Commit

Permalink
Limit default value of TEST_NP to at most 4 cores
Browse files Browse the repository at this point in the history
When no default value is provided for TEST_NP, value `nproc / 2 + 1`
is used instead, which can be large on hyperthreaded CPUs. This leads
to issues in parallel tests that don't scale well with a large number
of cores (e.g. when there aren't enough particles) or with a large
odd number of cores (e.g. LB or P3M).
  • Loading branch information
jngrad committed Nov 21, 2019
1 parent 565dfbe commit d1440da
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmake/unit_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ if(NOT DEFINED TEST_NP)
include(ProcessorCount)
ProcessorCount(NP)
math(EXPR TEST_NP "${NP}/2 + 1")
if(${TEST_NP} GREATER 4)
set(TEST_NP 4)
endif()
endif()

if(EXISTS ${MPIEXEC})
Expand Down

0 comments on commit d1440da

Please sign in to comment.