Skip to content

Commit

Permalink
Added NVML and cgroup support to the slurm package (spack#40638)
Browse files Browse the repository at this point in the history
* Added NVML support to the slurm package
* dbus package is required for cgroup support
* Fixing formatting
* Style fix
* Added PAM support
* Added ROCm SMI support
  • Loading branch information
G-Ragghianti authored Oct 31, 2023
1 parent 702a225 commit 81997ae
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions var/spack/repos/builtin/packages/dbus/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Dbus(AutotoolsPackage):
version("1.8.2", sha256="5689f7411165adc953f37974e276a3028db94447c76e8dd92efe910c6d3bae08")

variant("xml_docs", default=False, description="Build XML documentation")
variant("system-socket", default="default", description="Location for the DBus system socket")

depends_on("pkgconfig", type="build")
depends_on("docbook-xml", type="build")
Expand All @@ -41,6 +42,9 @@ class Dbus(AutotoolsPackage):
def configure_args(self):
args = ["--disable-systemd", "--disable-launchd"]
args += self.enable_or_disable("xml-docs", variant="xml_docs")
socket = self.spec.variants["system-socket"].value
if socket != "default":
args += ["--with-system-socket={0}".format(socket)]
return args

@run_after("install")
Expand Down
18 changes: 18 additions & 0 deletions var/spack/repos/builtin/packages/slurm/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ class Slurm(AutotoolsPackage):
description="Set system configuration path (possibly /etc/slurm)",
)
variant("restd", default=False, description="Enable the slurmrestd server")
variant("nvml", default=False, description="Enable NVML autodetection")
variant("cgroup", default=False, description="Enable cgroup plugin")
variant("pam", default=False, description="Enable PAM support")
variant("rsmi", default=False, description="Enable ROCm SMI support")

# TODO: add variant for BG/Q and Cray support

Expand Down Expand Up @@ -156,6 +160,11 @@ class Slurm(AutotoolsPackage):
depends_on("libyaml", when="+restd")
depends_on("libjwt", when="+restd")

depends_on("cuda", when="+nvml")
depends_on("dbus", when="+cgroup")
depends_on("linux-pam", when="+pam")
depends_on("rocm-smi-lib", when="+rsmi")

executables = ["^srun$", "^salloc$"]

@classmethod
Expand Down Expand Up @@ -213,6 +222,15 @@ def configure_args(self):
else:
args.append("--without-pmix")

if spec.satisfies("+nvml"):
args.append(f"--with-nvml={spec['cuda'].prefix}")

if spec.satisfies("+pam"):
args.append(f"--with-pam_dir={spec['linux-pam'].prefix}")

if spec.satisfies("+rsmi"):
args.append(f"--with-rsmi={spec['rocm-smi-lib'].prefix}")

sysconfdir = spec.variants["sysconfdir"].value
if sysconfdir != "PREFIX/etc":
args.append("--sysconfdir={0}".format(sysconfdir))
Expand Down

0 comments on commit 81997ae

Please sign in to comment.