Skip to content

Commit 3424e06

Browse files
authored
Merge pull request #3109 from vkarak/bugfix/parse-slurm-version
[bugfix] Better version check for Slurm in the `srun` backend
2 parents e7fcd19 + 165481d commit 3424e06

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

reframe/core/launchers/mpi.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,25 @@ def __init__(self):
2020
self.use_cpus_per_task = True
2121
try:
2222
out = osext.run_command('srun --version')
23-
match = re.search('slurm (\d+)\.(\d+)\.(\d+)', out.stdout)
23+
match = re.search(r'slurm(-wlm)? (\d+)\.(\d+)\.(\d+)', out.stdout)
2424
if match:
2525
# We cannot pass to semver strings like 22.05.1 directly
2626
# because it is not a valid version string for semver. We
2727
# need to remove all the leading zeros.
2828
slurm_version = (
2929
semver.VersionInfo(
30-
match.group(1), match.group(2), match.group(3)
30+
match.group(2), match.group(3), match.group(4)
3131
)
3232
)
3333
if slurm_version < semver.VersionInfo(22, 5, 0):
3434
self.use_cpus_per_task = False
3535
else:
36-
getlogger().warning(
36+
getlogger().debug(
3737
'could not get version of Slurm, --cpus-per-task will be '
3838
'set according to the num_cpus_per_task attribute'
3939
)
4040
except Exception:
41-
getlogger().warning(
41+
getlogger().debug(
4242
'could not get version of Slurm, --cpus-per-task will be set '
4343
'according to the num_cpus_per_task attribute'
4444
)

0 commit comments

Comments
 (0)