Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CMAKE_TEST_LAUNCHER capability and gpu labels #191

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

wdeconinck
Copy link
Collaborator

Before this PR, the serial tests that require a GPU resource would fail when using

salloc -q dg -n 4 --gpus-per-task=1 ctest

The issue is those tests need to be launched with srun -n 1 within ctest to gain access to the GPU resource.

Adding the CMAKE_TEST_LAUNCHER (available since cmake 3.29) allows to run serial tests to be run with a launcher, in this case srun -n 1.
This feature used to be already available in versions of cmake < 3.29 under the more obscure name CMAKE_CROSSCOMPILING_EMULATOR. This PR makes the use of CMAKE_TEST_LAUNCHER forward compatible.

I also added labels "gpu" to GPU tests.

Following workflow works now on our HPC:

Before configuration:

export CMAKE_TEST_LAUNCHER="srun;-n;1"

To launch only gpu tests:

salloc -q dg -n 4 --gpus-per-task=1 ctest -L gpu

@wdeconinck wdeconinck force-pushed the feature/cmake_test_launcher branch from 27215c7 to 0fbc988 Compare December 19, 2024 16:00
Copy link
Collaborator

@samhatfield samhatfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, very neat and tidy. I tested with the following CMakes on ECMWF/AC:

  • cmake/3.28.3
  • cmake/3.25.2

Copy link
Collaborator

@marsdeno marsdeno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@marsdeno marsdeno merged commit 2f9c4f3 into develop Jan 15, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants