Skip to content

Commit

Permalink
DevOps: Adapt testsuite to new hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed Oct 15, 2024
1 parent 6ba8718 commit 978f02e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 24 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/push_pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
options: --cpus 2
options: --cpus 4
steps:
- name: Checkout
uses: actions/checkout@main
Expand All @@ -55,8 +55,8 @@ jobs:
- name: Build and check
uses: ./.github/actions/build_and_check
env:
build_procs: 2
check_procs: 2
build_procs: 4
check_procs: 4
myconfig: 'maxset'
with_ccache: 'true'
with_cuda: 'false'
Expand All @@ -78,7 +78,7 @@ jobs:
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
options: --cpus 2
options: --cpus 4
steps:
- name: Checkout
uses: actions/checkout@main
Expand All @@ -94,8 +94,8 @@ jobs:
- name: Build and check
uses: ./.github/actions/build_and_check
env:
build_procs: 2
check_procs: 2
build_procs: 4
check_procs: 4
myconfig: 'maxset'
with_ccache: 'true'
with_cuda: 'false'
Expand Down
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,16 @@ else()
endif()

# OpenMPI checks the number of processes against the number of CPUs
set(ESPRESSO_MPIEXEC_OVERSUBSCRIBE "")
set(ESPRESSO_MPIEXEC_PREFLAGS "")
# Open MPI 4.x has a bug on NUMA archs that prevents running in singleton mode
set(ESPRESSO_MPIEXEC_GUARD_SINGLETON_NUMA OFF)
set(ESPRESSO_CPU_MODEL_NAME_OMPI_SINGLETON_NUMA_PATTERN "AMD (EPYC|Ryzen)")

if("${ESPRESSO_MPIEXEC_VENDOR}" STREQUAL "OpenMPI")
set(ESPRESSO_MPIEXEC_OVERSUBSCRIBE "-oversubscribe")
list(APPEND ESPRESSO_MPIEXEC_PREFLAGS "-oversubscribe")
if(ESPRESSO_INSIDE_DOCKER)
list(APPEND ESPRESSO_MPIEXEC_PREFLAGS "--bind-to" "none")
endif()
if(${ESPRESSO_MPIEXEC_VERSION} VERSION_LESS 5.0)
if(NOT DEFINED ESPRESSO_CPU_MODEL_NAME)
if(CMAKE_SYSTEM_NAME STREQUAL Linux)
Expand Down
2 changes: 1 addition & 1 deletion cmake/espresso_unit_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function(ESPRESSO_UNIT_TEST)
set(TEST_NUM_PROC ${ESPRESSO_TEST_NP})
endif()
espresso_set_mpiexec_tmpdir(${TEST_NAME})
add_test(${TEST_NAME} ${MPIEXEC} ${ESPRESSO_MPIEXEC_OVERSUBSCRIBE}
add_test(${TEST_NAME} ${MPIEXEC} ${ESPRESSO_MPIEXEC_PREFLAGS}
${MPIEXEC_NUMPROC_FLAG} ${TEST_NUM_PROC} ${MPIEXEC_PREFLAGS}
${ESPRESSO_MPIEXEC_TMPDIR} ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME}
${MPIEXEC_POSTFLAGS})
Expand Down
14 changes: 4 additions & 10 deletions maintainer/CI/build_cmake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,14 @@ ci_procs=2
if [ "${GITLAB_CI}" = "true" ]; then
if [[ "${OSTYPE}" == "linux-gnu"* ]]; then
# Linux runner
if grep -q "i7-3820" /proc/cpuinfo; then
# communication bottleneck for more than 2 cores on Intel i7-3820
ci_procs=2
else
ci_procs=4
fi
ci_procs=4
elif [[ "${OSTYPE}" == "darwin"* ]]; then
# macOS runner
ci_procs=2
ci_procs=4
fi
elif [ "${GITHUB_ACTIONS}" = "true" ]; then
# GitHub Actions only provide 1 core; request 2 cores to run tests
# in parallel (OpenMPI allows oversubscription)
ci_procs=2
# GitHub Actions provide 4 cores
ci_procs=4
else
ci_procs=$(nproc)
fi
Expand Down
6 changes: 3 additions & 3 deletions maintainer/benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ if(EXISTS ${MPIEXEC})
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])")
set(ESPRESSO_MPIEXEC_OVERSUBSCRIBE "-oversubscribe")
set(ESPRESSO_MPIEXEC_PREFLAGS "-oversubscribe")
else()
set(ESPRESSO_MPIEXEC_OVERSUBSCRIBE "")
set(ESPRESSO_MPIEXEC_PREFLAGS "")
endif()
endif()

Expand Down Expand Up @@ -86,7 +86,7 @@ function(PYTHON_BENCHMARK)
add_test(
NAME ${BENCHMARK_TEST_NAME}
COMMAND
${MPIEXEC} ${ESPRESSO_MPIEXEC_OVERSUBSCRIBE} ${MPIEXEC_NUMPROC_FLAG}
${MPIEXEC} ${ESPRESSO_MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG}
${BENCHMARK_NUM_PROC} ${MPIEXEC_PREFLAGS}
${CMAKE_BINARY_DIR}/pypresso ${BENCHMARK_FILE} ${BENCHMARK_ARGUMENTS}
${MPIEXEC_POSTFLAGS})
Expand Down
2 changes: 1 addition & 1 deletion testsuite/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ function(python_test)
add_test(
NAME ${TEST_NAME}
COMMAND
${MPIEXEC} ${ESPRESSO_MPIEXEC_OVERSUBSCRIBE} ${MPIEXEC_NUMPROC_FLAG}
${MPIEXEC} ${ESPRESSO_MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG}
${TEST_NUM_PROC} ${MPIEXEC_PREFLAGS} ${ESPRESSO_MPIEXEC_TMPDIR}
${CMAKE_BINARY_DIR}/pypresso ${PYPRESSO_OPTIONS}
${TEST_FILE_CONFIGURED} ${TEST_ARGUMENTS} ${MPIEXEC_POSTFLAGS})
Expand Down
2 changes: 1 addition & 1 deletion testsuite/python/resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"gpus": [
{
"id": "0",
"slots": 4
"slots": 8
}
]
}
Expand Down

0 comments on commit 978f02e

Please sign in to comment.