Skip to content

Commit 64ed86c

Browse files
authored
Add group.node_params to partitions/groups. (#182)
Allows Features, etc., to be added to partitions.
1 parent 51b5031 commit 64ed86c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

templates/slurm.conf.j2

+5-3
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,9 @@ Epilog=/etc/slurm/slurm.epilog.clean
153153
{% for part in openhpc_slurm_partitions %}
154154
{% set nodelist = [] %}
155155
{% for group in part.get('groups', [part]) %}
156-
156+
157157
{% set group_name = group.cluster_name|default(openhpc_cluster_name) ~ '_' ~ group.name %}
158+
#-----------------------------------------------------------
158159
# openhpc_slurm_partitions group: {{ group_name }}
159160
{% set inventory_group_hosts = groups.get(group_name, []) %}
160161
{% if inventory_group_hosts | length > 0 %}
@@ -164,8 +165,7 @@ Epilog=/etc/slurm/slurm.epilog.clean
164165
{% set ram_mb = (first_host_hv['ansible_memory_mb']['real']['total'] * (group.ram_multiplier | default(openhpc_ram_multiplier))) | int %}
165166
{% for hostlist in (inventory_group_hosts | hostlist_expression) %}
166167
{% set gres = ' Gres=%s' % (','.join(group.gres | map(attribute='conf') )) if 'gres' in group else '' %}
167-
168-
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 }}
168+
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 }}
169169
{% set _ = nodelist.append(hostlist) %}
170170
{% endfor %}{# nodes #}
171171
{% endif %}{# inventory_group_hosts #}
@@ -180,6 +180,8 @@ NodeName={{ hostlist }} State=UNKNOWN RealMemory={{ group.get('ram_mb', ram_mb)
180180
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 }}
181181
{% endfor %}{# partitions #}
182182

183+
# /partitions -----------------------------------------------------------
184+
183185
# Define a non-existent node, in no partition, so that slurmctld starts even with all partitions empty
184186
NodeName=nonesuch
185187

0 commit comments

Comments
 (0)