···
# configuration file can be generated by http://slurm.schedmd.com/configurator.html
configFile = pkgs.writeText "slurm.conf"
11
+
${optionalString (cfg.controlMachine != null) ''controlMachine=${cfg.controlMachine}''}
12
+
${optionalString (cfg.controlAddr != null) ''controlAddr=${cfg.controlAddr}''}
13
+
${optionalString (cfg.nodeName != null) ''nodeName=${cfg.nodeName}''}
14
+
${optionalString (cfg.partitionName != null) ''partitionName=${cfg.partitionName}''}
···
28
-
Whether to enable slurm control daemon.
28
+
enable = mkEnableOption "slurm control daemon";
39
-
Whether to enable slurm client daemon.
33
+
enable = mkEnableOption "slurm rlient daemon";
37
+
controlMachine = mkOption {
38
+
type = types.nullOr types.str;
42
+
The short hostname of the machine where SLURM control functions are
43
+
executed (i.e. the name returned by the command "hostname -s", use "tux001"
44
+
rather than "tux001.my.com").
48
+
controlAddr = mkOption {
49
+
type = types.nullOr types.str;
50
+
default = cfg.controlMachine;
53
+
Name that ControlMachine should be referred to in establishing a
54
+
communications path.
58
+
nodeName = mkOption {
59
+
type = types.nullOr types.str;
61
+
example = "linux[1-32] CPUs=1 State=UNKNOWN";
63
+
Name that SLURM uses to refer to a node (or base partition for BlueGene
64
+
systems). Typically this would be the string that "/bin/hostname -s"
65
+
returns. Note that now you have to write node's parameters after the name.
69
+
partitionName = mkOption {
70
+
type = types.nullOr types.str;
72
+
example = "debug Nodes=linux[1-32] Default=YES MaxTime=INFINITE State=UP";
74
+
Name by which the partition may be referenced. Note that now you have
75
+
to write patrition's parameters after the name.
···
the end of the slurm configuration file.
···
systemd.services.slurmd = mkIf (cfg.client.enable) {
path = with pkgs; [ slurm-llnl coreutils ];
wantedBy = [ "multi-user.target" ];
after = [ "systemd-tmpfiles-clean.service" ];
···
ExecStart = "${pkgs.slurm-llnl}/bin/slurmd -f ${configFile}";
PIDFile = "/run/slurmd.pid";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
76
-
ExecStop = "${pkgs.coreutils}/bin/kill $MAINPID";
···
ExecStart = "${pkgs.slurm-llnl}/bin/slurmctld";
PIDFile = "/run/slurmctld.pid";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
92
-
ExecStop = "${pkgs.coreutils}/bin/kill $MAINPID";
environment = { SLURM_CONF = "${configFile}"; };