Skip to content

Commit 6be1ed6

Browse files
committed
output NodeName hostlists on single line to improve large BM scheduler perf
1 parent 6038a0c commit 6be1ed6

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

templates/slurm.conf.j2

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,7 @@ Epilog=/etc/slurm/slurm.epilog.clean
156156
{% set first_host_hv = hostvars[first_host] %}
157157
{% set ram_mb = (first_host_hv['ansible_memory_mb']['real']['total'] * (nodegroup.ram_multiplier | default(openhpc_ram_multiplier))) | int %}
158158
{% set hostlists = (inventory_group_hosts | hostlist_expression) %}{# hosts in inventory group aren't necessarily a single hostlist expression #}
159-
{% for hostlist in hostlists %}
160-
NodeName={{ hostlist }} {{ '' -}}
159+
NodeName={{ hostlists | join(',') }} {{ '' -}}
161160
Features={{ (['nodegroup_' ~ nodegroup.name] + nodegroup.features | default([]) ) | join(',') }} {{ '' -}}
162161
State=UNKNOWN {{ '' -}}
163162
RealMemory={{ nodegroup.ram_mb | default(ram_mb) }} {{ '' -}}
@@ -167,7 +166,6 @@ NodeName={{ hostlist }} {{ '' -}}
167166
{{ nodegroup.node_params | default({}) | dict2parameters }} {{ '' -}}
168167
{% if 'gres' in nodegroup %}Gres={{ ','.join(nodegroup.gres | map(attribute='conf')) }}{% endif %}
169168

170-
{% endfor %}{# hostlists #}
171169
{% endif %}{# 1 or more hosts in inventory #}
172170
NodeSet=nodegroup_{{ nodegroup.name }} Feature=nodegroup_{{ nodegroup.name }}
173171

0 commit comments

Comments
 (0)