Skip to content

Commit a63dd84

Browse files
authored
nixos/slurm: generate mpi.conf and add config options (NixOS#352467)
2 parents 8b67cf8 + b1cce3b commit a63dd84

File tree

1 file changed

+27
-2
lines changed
  • nixos/modules/services/computing/slurm

1 file changed

+27
-2
lines changed

nixos/modules/services/computing/slurm/slurm.nix

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ let
3232
${cfg.extraCgroupConfig}
3333
'';
3434

35+
mpiConf = pkgs.writeTextDir "mpi.conf"
36+
''
37+
PMIxCliTmpDirBase=${cfg.mpi.PmixCliTmpDirBase}
38+
${cfg.mpi.extraMpiConfig}
39+
'';
40+
3541
slurmdbdConf = pkgs.writeText "slurmdbd.conf"
3642
''
3743
DbdHost=${cfg.dbdserver.dbdHost}
@@ -45,7 +51,7 @@ let
4551
# in the same directory as slurm.conf
4652
etcSlurm = pkgs.symlinkJoin {
4753
name = "etc-slurm";
48-
paths = [ configFile cgroupConfig plugStackConfig ] ++ cfg.extraConfigPaths;
54+
paths = [ configFile cgroupConfig plugStackConfig mpiConf ] ++ cfg.extraConfigPaths;
4955
};
5056
in
5157

@@ -242,6 +248,24 @@ in
242248
'';
243249
};
244250

251+
mpi = {
252+
PmixCliTmpDirBase = lib.mkOption {
253+
default = "/tmp/pmix";
254+
type = lib.types.str;
255+
description = ''
256+
Base path for PMIx temporary files.
257+
'';
258+
};
259+
260+
extraMpiConfig = lib.mkOption {
261+
default = "";
262+
type = lib.types.lines;
263+
description = ''
264+
Extra configuration for that will be added to `mpi.conf`.
265+
'';
266+
};
267+
};
268+
245269
extraPlugstackConfig = lib.mkOption {
246270
default = "";
247271
type = lib.types.lines;
@@ -372,8 +396,9 @@ in
372396
};
373397
};
374398

375-
systemd.tmpfiles.rules = lib.mkIf cfg.client.enable [
399+
systemd.tmpfiles.rules = lib.optionals cfg.client.enable [
376400
"d /var/spool/slurmd 755 root root -"
401+
"d ${cfg.mpi.PmixCliTmpDirBase} 755 root root -"
377402
];
378403

379404
services.openssh.settings.X11Forwarding = lib.mkIf cfg.client.enable (lib.mkDefault true);

0 commit comments

Comments
 (0)