Skip to content

Commit 56317bb

Browse files
committed
auto gres v4
1 parent ccd170d commit 56317bb

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

templates/gres.conf.j2

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@ AutoDetect={{ openhpc_gres_autodetect }}
44
{% set inventory_group_name = openhpc_cluster_name ~ '_' ~ nodegroup.name %}
55
{% set inventory_group_hosts = groups.get(inventory_group_name, []) %}
66
{% set hostlist_string = inventory_group_hosts | hostlist_expression | join(',') %}
7-
{% if nodegroup_gres_autodetect != 'off' %}
8-
NodeName={{ hostlist_string }} AutoDetect={{ nodegroup_gres_autodetect }}
9-
{% else %}
10-
{% for gres in nodegroup.gres | default([]) %}
11-
{% set gres_name, gres_type, _ = gres.conf.split(':') %}
12-
NodeName={{ hostlist_string }} Name={{ gres_name }} Type={{ gres_type }}{% if openhpc_gres_autodetect == nodegroup_gres_autodetect == 'off' %} File={{ gres.file | mandatory('The gres configuration dictionary: ' ~ gres ~ ' is missing the file key, but gres_autodetect is not specified. The error occured on node group: ' ~ nodegroup.name ~ '. Please add the file key or set gres_autodetect.') }}{% endif %}
13-
{% endfor %}{# gres #}
14-
{% endif %}{# autodetect #}
7+
{% for gres in nodegroup.gres | default([]) %}
8+
{% set gres_name, gres_type, _ = gres.conf.split(':') %}
9+
NodeName={{ hostlist_string }} AutoDetect={{ nodegroup_gres_autodetect }} Name={{ gres_name }} Type={{ gres_type }}{% if openhpc_gres_autodetect == nodegroup_gres_autodetect == 'off' %} File={{ gres.file | mandatory('The gres configuration dictionary: ' ~ gres ~ ' is missing the file key, but gres_autodetect is not specified. The error occured on node group: ' ~ nodegroup.name ~ '. Please add the file key or set gres_autodetect.') }}{% endif %}
10+
{% endfor %}{# gres #}
1511
{% endfor %}{# nodegroup #}

0 commit comments

Comments
 (0)