Skip to content
Permalink
Browse files

Limit default value of TEST_NP to at most 4 cores

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 d1440da54c0b6933c1d3f81a4460ca5385cac2ac
Showing with 3 additions and 0 deletions.
  1. +3 −0 cmake/unit_test.cmake
@@ -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})

0 comments on commit d1440da

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