Skip to content

Commit 2efe2c1

Browse files
committed
use NodeSets internally to simplify templating
1 parent 4fd6ccf commit 2efe2c1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

templates/slurm.conf.j2

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ NodeName={{ node }}
2727
{% set hostlists = (inventory_group_hosts | hostlist_expression) %}{# hosts in inventory group aren't necessarily a single hostlist expression #}
2828
{% for hostlist in hostlists %}
2929
NodeName={{ hostlist }} {{ '' -}}
30+
Feature={{ nodegroup.name }} {{ '' -}}
3031
State=UNKNOWN {{ '' -}}
3132
RealMemory={{ nodegroup.ram_mb | default(ram_mb) }} {{ '' -}}
3233
Sockets={{first_host_hv['ansible_processor_count'] }} {{ '' -}}
@@ -37,7 +38,7 @@ NodeName={{ hostlist }} {{ '' -}}
3738
{% endfor %}{# hostlists #}
3839
{% endif %}{# 1 or more hosts in inventory #}
3940

40-
NodeSet={{ nodegroup.name }} Nodes={{ ','.join(hostlists | default(['""'])) }}{# no support for creating nodesets by Feature #}
41+
NodeSet={{ nodegroup.name }} Feature={{ nodegroup.name }}
4142

4243
{% endfor %}
4344

@@ -49,7 +50,8 @@ NodeName=nonesuch
4950
PartitionName={{partition.name}} {{ '' -}}
5051
Default={{ partition.get('default', 'YES') }} {{ '' -}}
5152
MaxTime={{ partition.get('maxtime', openhpc_job_maxtime) }} {{ '' -}}
52-
State=UP Nodes={{ partition.get('groups', [partition.name]) | join(',') }} {{ '' -}}
53+
State=UP {{ '' -}}
54+
Nodes={{ partition.get('groups', [partition.name]) | join(',') }} {{ '' -}}
5355
{{ partition.params | default({}) | dict2parameters }}
5456
{% endfor %}{# openhpc_partitions #}
5557

0 commit comments

Comments
 (0)