Skip to content

Commit

Permalink
Force OpenMPI to oversubscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
alazzaro committed Dec 11, 2023
1 parent d9de8d9 commit 86d9ba3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/testing-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
-DUSE_${{ matrix.use_openmp }} \
-DUSE_${{ matrix.use_smm }} \
-DMPI_EXECUTABLE_SUFFIX=.${{ matrix.mpi_suffix }} \
-DMPIEXEC_PREFLAGS="$([ "${{ matrix.mpi_suffix }}" = "openmpi" ] && echo "-mca btl ^openib --allow-run-as-root")" \
-DMPIEXEC_PREFLAGS="$([ "${{ matrix.mpi_suffix }}" = "openmpi" ] && echo "-mca btl ^openib --allow-run-as-root --oversubscribe")" \
-DLCOV_ARGS="--test-name;${{ matrix.use_mpi }}-${{ matrix.use_openmp }}-${{ matrix.use_smm }}-cpu" \
..
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ default_language_version:

exclude: '^tools/(build_utils/fypp)'
fail_fast: false
minimum_pre_commit_version: 3.2.0
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.1.7'
Expand Down
15 changes: 7 additions & 8 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# =================================== OpenMP
if (USE_OPENMP)
set (NUM_THREADS ${TEST_OMP_THREADS})
set(NUM_THREADS ${TEST_OMP_THREADS})
else ()
set (NUM_THREADS 1)
set(NUM_THREADS 1)
endif ()

# =================================== MPI
Expand All @@ -11,7 +11,7 @@ if (USE_MPI)
include(ProcessorCount)
ProcessorCount(nproc)
math(EXPR num_ranks "(${nproc}+${NUM_THREADS}-1)/${NUM_THREADS}"
)# get 1/$NUM_THREADS the number of procs (rounded up)
)# get 1/$NUM_THREADS the number of procs (rounded up)
else ()
set(num_ranks ${TEST_MPI_RANKS})
endif ()
Expand Down Expand Up @@ -52,9 +52,8 @@ foreach (dbcsr_perf_test ${DBCSR_PERF_TESTS})
COMMAND $<TARGET_FILE:dbcsr_perf>
"${CMAKE_CURRENT_SOURCE_DIR}/${dbcsr_perf_test}")
endif ()
set_tests_properties(
dbcsr_perf:${dbcsr_perf_test}
PROPERTIES ENVIRONMENT OMP_NUM_THREADS=${NUM_THREADS})
set_tests_properties(dbcsr_perf:${dbcsr_perf_test}
PROPERTIES ENVIRONMENT OMP_NUM_THREADS=${NUM_THREADS})
endforeach ()

# =================================== DBCSR CORRECTNESS TESTS Define all the
Expand Down Expand Up @@ -132,8 +131,8 @@ foreach (dbcsr_test ${DBCSR_TESTS_FTN})
endif ()
if (OpenMP_FOUND)
target_link_libraries(${dbcsr_test} OpenMP::OpenMP_Fortran)
set_tests_properties(
${dbcsr_test} PROPERTIES ENVIRONMENT OMP_NUM_THREADS=${NUM_THREADS})
set_tests_properties(${dbcsr_test}
PROPERTIES ENVIRONMENT OMP_NUM_THREADS=${NUM_THREADS})
endif ()
endforeach ()

Expand Down

0 comments on commit 86d9ba3

Please sign in to comment.