Skip to content

Commit 196716f

Browse files
committed
...
1 parent a551b52 commit 196716f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

templates/gres.conf.j2

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@ AutoDetect=off
22
{% for nodegroup in openhpc_nodegroups %}
33
{% set gres_list = nodegroup.gres | default([]) %}
44
{% set gres_autodetect = nodegroup.gres_autodetect | default('off') %}
5+
{% set inventory_group_name = openhpc_cluster_name ~ '_' ~ nodegroup.name %}
6+
{% set inventory_group_hosts = groups.get(inventory_group_name, []) %}
57
{% if gres_autodetect | default('off') != 'off' %}
8+
{% for hostlist in (inventory_group_hosts | hostlist_expression) %}
69
NodeName={{ hostlist }} AutoDetect={{ gres_autodetect }}
10+
{% endfor %}{# hostlists #}
711
{% else %}
812
{% for gres in gres_list %}
913
{% set gres_name, gres_type, _ = gres.conf.split(':') %}
1014
{% set inventory_group_name = openhpc_cluster_name ~ '_' ~ nodegroup.name %}
1115
{% set inventory_group_hosts = groups.get(inventory_group_name, []) %}
1216
{% for hostlist in (inventory_group_hosts | hostlist_expression) %}
13-
NodeName={{ hostlist }} Name={{ gres_name }} Type={{ gres_type }} File={{ gres.file }}
17+
NodeName={{ hostlist }} Name={{ gres_name }} Type={{ gres_type }} File={{ gres.file | mandatory('The gres configuration dictionary: ' ~ gres ~ ' is missing the file key, but gres_autodetect is set to off. The error occured on node group: ' ~ nodegroup.name ~ '. Please add the file key or set gres_autodetect.') }}
1418
{% endfor %}{# hostlists #}
1519
{% endfor %}{# gres #}
1620
{% endif %}{# autodetect #}

0 commit comments

Comments
 (0)