From 64ed86c6cd37d14f5f4cb5f9ea307adc96c2d023 Mon Sep 17 00:00:00 2001 From: Kurt Bendl Date: Fri, 9 May 2025 05:29:39 -0400 Subject: [PATCH 1/2] Add group.node_params to partitions/groups. (#182) Allows Features, etc., to be added to partitions. --- templates/slurm.conf.j2 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/slurm.conf.j2 b/templates/slurm.conf.j2 index ad84610..de1b752 100644 --- a/templates/slurm.conf.j2 +++ b/templates/slurm.conf.j2 @@ -153,8 +153,9 @@ Epilog=/etc/slurm/slurm.epilog.clean {% for part in openhpc_slurm_partitions %} {% set nodelist = [] %} {% for group in part.get('groups', [part]) %} - + {% set group_name = group.cluster_name|default(openhpc_cluster_name) ~ '_' ~ group.name %} +#----------------------------------------------------------- # openhpc_slurm_partitions group: {{ group_name }} {% set inventory_group_hosts = groups.get(group_name, []) %} {% if inventory_group_hosts | length > 0 %} @@ -164,8 +165,7 @@ Epilog=/etc/slurm/slurm.epilog.clean {% set ram_mb = (first_host_hv['ansible_memory_mb']['real']['total'] * (group.ram_multiplier | default(openhpc_ram_multiplier))) | int %} {% for hostlist in (inventory_group_hosts | hostlist_expression) %} {% set gres = ' Gres=%s' % (','.join(group.gres | map(attribute='conf') )) if 'gres' in group else '' %} - -NodeName={{ hostlist }} State=UNKNOWN RealMemory={{ group.get('ram_mb', ram_mb) }} Sockets={{first_host_hv['ansible_processor_count']}} CoresPerSocket={{ first_host_hv['ansible_processor_cores'] }} ThreadsPerCore={{ first_host_hv['ansible_processor_threads_per_core'] }}{{ gres }} +NodeName={{ hostlist }} State=UNKNOWN RealMemory={{ group.get('ram_mb', ram_mb) }} Sockets={{first_host_hv['ansible_processor_count']}} CoresPerSocket={{ first_host_hv['ansible_processor_cores'] }} ThreadsPerCore={{ first_host_hv['ansible_processor_threads_per_core'] }}{{ gres }} {{ group.node_params | default({}) | dict2parameters }} {% set _ = nodelist.append(hostlist) %} {% endfor %}{# nodes #} {% endif %}{# inventory_group_hosts #} @@ -180,6 +180,8 @@ 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 #} +# /partitions ----------------------------------------------------------- + # Define a non-existent node, in no partition, so that slurmctld starts even with all partitions empty NodeName=nonesuch From eda5d8c02401a1f0d6bb2e067abf6d395cf72102 Mon Sep 17 00:00:00 2001 From: Steve Brasier <33413598+sjpb@users.noreply.github.com> Date: Thu, 16 May 2024 11:45:10 +0100 Subject: [PATCH 2/2] update SelectType from legacy to current default (#167) --- templates/slurm.conf.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/slurm.conf.j2 b/templates/slurm.conf.j2 index de1b752..7e96ebc 100644 --- a/templates/slurm.conf.j2 +++ b/templates/slurm.conf.j2 @@ -90,7 +90,7 @@ Waittime=0 #MaxMemPerCPU=0 #SchedulerTimeSlice=30 SchedulerType=sched/backfill -SelectType=select/cons_res +SelectType=select/cons_tres SelectTypeParameters=CR_Core # #