Slurm: extend spack external find support (#47740)
* Slurm: extend spack external find support On Debian srun/salloc --version returns 'slurm-wlm VERSION'. Check for both strings and return the first match. * non-capturing group for slurm determine_version Co-authored-by: Wouter Deconinck <wdconinc@gmail.com> * slurm: add detection test --------- Co-authored-by: Wouter Deconinck <wdconinc@gmail.com>
This commit is contained in:
parent
c0cbbcfa0a
commit
6ba7aa325b
23
var/spack/repos/builtin/packages/slurm/detection_test.yaml
Normal file
23
var/spack/repos/builtin/packages/slurm/detection_test.yaml
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
paths:
|
||||||
|
- layout:
|
||||||
|
# SLES:
|
||||||
|
- executables:
|
||||||
|
- "bin/srun"
|
||||||
|
script: |
|
||||||
|
echo "slurm 22.05.8"
|
||||||
|
- executables:
|
||||||
|
- "bin/salloc"
|
||||||
|
script: |
|
||||||
|
echo "slurm 22.05.8"
|
||||||
|
# Debian:
|
||||||
|
- executables:
|
||||||
|
- "bin/srun"
|
||||||
|
script: |
|
||||||
|
echo "slurm-wlm 22.05.8"
|
||||||
|
- executables:
|
||||||
|
- "bin/salloc"
|
||||||
|
script: |
|
||||||
|
echo "slurm-wlm 22.05.8"
|
||||||
|
platforms: ["linux"]
|
||||||
|
results:
|
||||||
|
- spec: "slurm@22.05.8"
|
@ -178,7 +178,7 @@ class Slurm(AutotoolsPackage):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def determine_version(cls, exe):
|
def determine_version(cls, exe):
|
||||||
output = Executable(exe)("--version", output=str).rstrip()
|
output = Executable(exe)("--version", output=str).rstrip()
|
||||||
match = re.search(r"slurm\s*([0-9.]+)", output)
|
match = re.search(r"slurm(?:-wlm)?\s*([0-9.]+)", output)
|
||||||
return match.group(1) if match else None
|
return match.group(1) if match else None
|
||||||
|
|
||||||
def flag_handler(self, name, flags):
|
def flag_handler(self, name, flags):
|
||||||
|
Loading…
Reference in New Issue
Block a user