Skip to content

Commit

Permalink
Move CMake test options to main CMakeLists.txt to make available for …
Browse files Browse the repository at this point in the history
…miniapps as well
  • Loading branch information
msimberg committed Mar 21, 2024
1 parent f8e1ef4 commit ed29663
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
22 changes: 22 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,28 @@ add_subdirectory(external)
# ---------------------------------------------------------------------------
add_subdirectory(src)

# ---------------------------------------------------------------------------
# Test options (apply to unit tests and miniapps as tests)
# ---------------------------------------------------------------------------
set(DLAF_PRESET_OPTIONS "plain-mpi" "slurm" "custom")
set(DLAF_MPI_PRESET "plain-mpi" CACHE STRING "Select a preset to use")
set_property(CACHE DLAF_MPI_PRESET PROPERTY STRINGS ${DLAF_PRESET_OPTIONS})
option(
DLAF_CI_RUNNER_USES_MPIRUN
"Remove mpiexec command for tests executed by ctest. This option is to be used if the CI runner executes the tests with <mpiexec + options> ctest -L RANK_<spawned MPI ranks>"
OFF
)

# On some machines, tests using multiple ranks + oversubscribing run
# significantly faster when threads are not pinned.
option(DLAF_TEST_THREAD_BINDING_ENABLED "If OFF disables pika thread binding." ON)

# If DLAF_CI_RUNNER_USES_MPIRUN=on we don't want to use any preset, so we just go for the custom one
# without setting any variable.
if(DLAF_CI_RUNNER_USES_MPIRUN)
set(DLAF_MPI_PRESET "custom" CACHE STRING "" FORCE)
endif()

# ---------------------------------------------------------------------------
# mini Apps
# ---------------------------------------------------------------------------
Expand Down
19 changes: 0 additions & 19 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,6 @@
# SPDX-License-Identifier: BSD-3-Clause
#

set(DLAF_PRESET_OPTIONS "plain-mpi" "slurm" "custom")
set(DLAF_MPI_PRESET "plain-mpi" CACHE STRING "Select a preset to use")
set_property(CACHE DLAF_MPI_PRESET PROPERTY STRINGS ${DLAF_PRESET_OPTIONS})
option(
DLAF_CI_RUNNER_USES_MPIRUN
"Remove mpiexec command for tests executed by ctest. This option is to be used if the CI runner executes the tests with <mpiexec + options> ctest -L RANK_<spawned MPI ranks>"
OFF
)

# On some machines, tests using multiple ranks + oversubscribing run
# significantly faster when threads are not pinned.
option(DLAF_TEST_THREAD_BINDING_ENABLED "If OFF disables pika thread binding." ON)

# If DLAF_CI_RUNNER_USES_MPIRUN=on we don't want to use any preset, so we just go for the custom one
# without setting any variable.
if(DLAF_CI_RUNNER_USES_MPIRUN)
set(DLAF_MPI_PRESET "custom" CACHE STRING "" FORCE)
endif()

# if a preset has been selected and it has been changed from previous configurations
if(NOT DLAF_MPI_PRESET STREQUAL _DLAF_MPI_PRESET)

Expand Down

0 comments on commit ed29663

Please sign in to comment.