Skip to content

Commit

Permalink
updating CMake file, including an option to use srun in order to run …
Browse files Browse the repository at this point in the history
…tests on machines that use the slurm scheduler and wherein mpirun is not available (#707)
  • Loading branch information
thartland authored Feb 6, 2025
1 parent 6708066 commit 4a790ec
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ option(HIOP_USE_EIGEN "Build with Eigen support" ON)
option(HIOP_USE_MPI "Build with MPI support" ON)
option(HIOP_USE_GPU "Build with support for GPUs - CUDA or HIP libraries" OFF)
option(HIOP_TEST_WITH_BSUB "Use `jsrun` instead of `mpirun` commands when running tests" OFF)
option(HIOP_TEST_WITH_SLURM "Use `srun` instead of `mpirun` commands when running tests" OFF)
option(HIOP_USE_RAJA "Build with portability abstraction library RAJA" OFF)
option(HIOP_USE_AXOM "Build with AXOM to use Sidre for scalable checkpointing" OFF)
option(HIOP_DEEPCHECKS "Extra checks and asserts in the code with a high penalty on performance" OFF)
Expand Down Expand Up @@ -480,9 +481,15 @@ if(HIOP_TEST_WITH_BSUB)
set(RUNCMD ${RUNCMD} "-g" "1")
endif()
else()
set(MPICMD "mpirun")
# If running on a slurm scheduler, use srun command to make sure we are
# requesting the correct resources.
if(HIOP_TEST_WITH_SLURM)
set(MPICMD "srun")
else()
set(MPICMD "mpirun")
endif()
if(HIOP_USE_MPI)
set(RUNCMD "mpirun" "-n" "1")
set(RUNCMD ${MPICMD} "-n" "1")
set(RUNCMD ${RUNCMD} ${HIOP_EXTRA_MPI_FLAGS})
set(MPICMD ${MPICMD} ${HIOP_EXTRA_MPI_FLAGS})
else()
Expand Down

0 comments on commit 4a790ec

Please sign in to comment.