From 46b4f1768ef81cbc754fb920ebffaf9903191860 Mon Sep 17 00:00:00 2001 From: jamesbeedy Date: Mon, 25 Nov 2024 13:45:48 -0800 Subject: [PATCH] feat(slurmctld, slurmd): make slurm respect memory constraints on compute nodes * enhancement(slurmctld): enforce job level memory These changes introduce default values for SelectTypeParameters and MemSpecLimit. `SelectTypeParameters=CR_CPU_Memory` to enable memory allocation enforcement. `MemSpecLimit=1024` to ensure systems always have 1G available memory that jobs cannot consume. --------- Co-authored-by: Jason Nucciarone <40342202+NucciTheBoss@users.noreply.github.com> --- charms/slurmctld/src/constants.py | 1 + charms/slurmd/src/charm.py | 1 + 2 files changed, 2 insertions(+) diff --git a/charms/slurmctld/src/constants.py b/charms/slurmctld/src/constants.py index 91acce1..b0b32b5 100644 --- a/charms/slurmctld/src/constants.py +++ b/charms/slurmctld/src/constants.py @@ -18,6 +18,7 @@ "PluginDir": ["/usr/lib/x86_64-linux-gnu/slurm-wlm"], "PlugStackConfig": "/etc/slurm/plugstack.conf.d/plugstack.conf", "SelectType": "select/cons_tres", + "SelectTypeParameters": "CR_CPU_Memory", "SlurmctldPort": "6817", "SlurmdPort": "6818", "StateSaveLocation": "/var/lib/slurm/checkpoint", diff --git a/charms/slurmd/src/charm.py b/charms/slurmd/src/charm.py index 7c4c106..c44837a 100755 --- a/charms/slurmd/src/charm.py +++ b/charms/slurmd/src/charm.py @@ -326,6 +326,7 @@ def get_node(self) -> Dict[Any, Any]: node = { "node_parameters": { **machine.get_slurmd_info(), + "MemSpecLimit": "1024", **self._user_supplied_node_parameters, }, "new_node": self._new_node,