nixos/slurm: generate mpi.conf and add config options

mpi.conf is required for PMIx configuration.
Setting the PMIxCliTmpDirBase in mpi.conf per default
avoids PMIx errors complaining about a missing temporary directory.
This commit is contained in:
Markus Kowalewski 2024-09-28 18:35:58 +02:00
parent 9c2023e238
commit b1cce3b54e
No known key found for this signature in database
GPG Key ID: D865C8A91D7025EB

View File

@ -32,6 +32,12 @@ let
${cfg.extraCgroupConfig}
'';
mpiConf = pkgs.writeTextDir "mpi.conf"
''
PMIxCliTmpDirBase=${cfg.mpi.PmixCliTmpDirBase}
${cfg.mpi.extraMpiConfig}
'';
slurmdbdConf = pkgs.writeText "slurmdbd.conf"
''
DbdHost=${cfg.dbdserver.dbdHost}
@ -45,7 +51,7 @@ let
# in the same directory as slurm.conf
etcSlurm = pkgs.symlinkJoin {
name = "etc-slurm";
paths = [ configFile cgroupConfig plugStackConfig ] ++ cfg.extraConfigPaths;
paths = [ configFile cgroupConfig plugStackConfig mpiConf ] ++ cfg.extraConfigPaths;
};
in
@ -242,6 +248,24 @@ in
'';
};
mpi = {
PmixCliTmpDirBase = lib.mkOption {
default = "/tmp/pmix";
type = lib.types.str;
description = ''
Base path for PMIx temporary files.
'';
};
extraMpiConfig = lib.mkOption {
default = "";
type = lib.types.lines;
description = ''
Extra configuration for that will be added to `mpi.conf`.
'';
};
};
extraPlugstackConfig = lib.mkOption {
default = "";
type = lib.types.lines;
@ -372,8 +396,9 @@ in
};
};
systemd.tmpfiles.rules = lib.mkIf cfg.client.enable [
systemd.tmpfiles.rules = lib.optionals cfg.client.enable [
"d /var/spool/slurmd 755 root root -"
"d ${cfg.mpi.PmixCliTmpDirBase} 755 root root -"
];
services.openssh.settings.X11Forwarding = lib.mkIf cfg.client.enable (lib.mkDefault true);