From eb6292ad68d8a1713b9230b1f2fc655545d9e083 Mon Sep 17 00:00:00 2001 From: Steve Brasier Date: Thu, 11 May 2023 12:14:39 +0000 Subject: [PATCH 1/4] allow multiple empty partitions --- templates/slurm.conf.j2 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/templates/slurm.conf.j2 b/templates/slurm.conf.j2 index 0c074a1..6b4d231 100644 --- a/templates/slurm.conf.j2 +++ b/templates/slurm.conf.j2 @@ -129,9 +129,8 @@ NodeName={{ hostlist }} State=UNKNOWN RealMemory={{ group.get('ram_mb', ram_mb) {% set _ = nodelist.append(extra_node_defn['NodeName']) %} {% endfor %} {% endfor %}{# group #} -{% if not nodelist %} {# empty partition - define an invalid hostname which slurm accepts #} - {% set nodelist = ['n/a'] %} -NodeName={{ nodelist[0] }} +{% if not nodelist %} {# empty partition #} + {% set nodelist = ['""'] %} {% endif %} PartitionName={{part.name}} Default={{ part.get('default', 'YES') }} MaxTime={{ part.get('maxtime', openhpc_job_maxtime) }} State=UP Nodes={{ nodelist | join(',') }} {{ part.partition_params | default({}) | dict2parameters }} {% endfor %}{# partitions #} From 39f31f72d1861def4b702a29796b092a32cfb54b Mon Sep 17 00:00:00 2001 From: Steve Brasier Date: Thu, 11 May 2023 13:54:16 +0000 Subject: [PATCH 2/4] fix Partition indenting in slurm.conf for empty partitions --- templates/slurm.conf.j2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/slurm.conf.j2 b/templates/slurm.conf.j2 index 6b4d231..040171e 100644 --- a/templates/slurm.conf.j2 +++ b/templates/slurm.conf.j2 @@ -129,8 +129,8 @@ NodeName={{ hostlist }} State=UNKNOWN RealMemory={{ group.get('ram_mb', ram_mb) {% set _ = nodelist.append(extra_node_defn['NodeName']) %} {% endfor %} {% endfor %}{# group #} -{% if not nodelist %} {# empty partition #} - {% set nodelist = ['""'] %} +{% if not nodelist %}{# empty partition #} +{% set nodelist = ['""'] %} {% endif %} PartitionName={{part.name}} Default={{ part.get('default', 'YES') }} MaxTime={{ part.get('maxtime', openhpc_job_maxtime) }} State=UP Nodes={{ nodelist | join(',') }} {{ part.partition_params | default({}) | dict2parameters }} {% endfor %}{# partitions #} From c041254f0649daaf314d0cdd1b030a32adb626e4 Mon Sep 17 00:00:00 2001 From: Steve Brasier Date: Thu, 11 May 2023 13:54:49 +0000 Subject: [PATCH 3/4] fix local molecule install instructions --- molecule/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/molecule/README.md b/molecule/README.md index 07e5cf1..9403b39 100644 --- a/molecule/README.md +++ b/molecule/README.md @@ -32,7 +32,7 @@ Local installation on a RockyLinux 8.x machine looks like: sudo yum install -y git git clone git@github.com:stackhpc/ansible-role-openhpc.git cd ansible-role-openhpc/ - python3.9 -m venv venv + python3.8 -m venv venv . venv/bin/activate pip install -U pip pip install -r molecule/requirements.txt From f6d1b166460e5e681bb99eedded6ce4f25fbf1e3 Mon Sep 17 00:00:00 2001 From: Steve Brasier Date: Thu, 11 May 2023 14:03:30 +0000 Subject: [PATCH 4/4] fix situation where all partitions are empty --- templates/slurm.conf.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/slurm.conf.j2 b/templates/slurm.conf.j2 index 040171e..aef028f 100644 --- a/templates/slurm.conf.j2 +++ b/templates/slurm.conf.j2 @@ -135,6 +135,9 @@ NodeName={{ hostlist }} State=UNKNOWN RealMemory={{ group.get('ram_mb', ram_mb) PartitionName={{part.name}} Default={{ part.get('default', 'YES') }} MaxTime={{ part.get('maxtime', openhpc_job_maxtime) }} State=UP Nodes={{ nodelist | join(',') }} {{ part.partition_params | default({}) | dict2parameters }} {% endfor %}{# partitions #} +# Define a non-existent node, in no partition, so that slurmctld starts even with all partitions empty +NodeName=nonesuch + # Want nodes that drop out of SLURM's configuration to be automatically # returned to service when they come back. ReturnToService=2