Skip to content

Commit ccd170d

Browse files
committed
auto gres v3
1 parent ccaf02a commit ccd170d

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

templates/gres.conf.j2

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
AutoDetect={{ openhpc_gres_autodetect }}
22
{% for nodegroup in openhpc_nodegroups %}
3-
{% set gres_list = nodegroup.gres | default([]) %}
43
{% set nodegroup_gres_autodetect = nodegroup.gres_autodetect | default('off') %}
54
{% set inventory_group_name = openhpc_cluster_name ~ '_' ~ nodegroup.name %}
65
{% set inventory_group_hosts = groups.get(inventory_group_name, []) %}
76
{% set hostlist_string = inventory_group_hosts | hostlist_expression | join(',') %}
87
{% if nodegroup_gres_autodetect != 'off' %}
98
NodeName={{ hostlist_string }} AutoDetect={{ nodegroup_gres_autodetect }}
109
{% else %}
11-
{% for gres in gres_list %}
10+
{% for gres in nodegroup.gres | default([]) %}
1211
{% set gres_name, gres_type, _ = gres.conf.split(':') %}
1312
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 %}
1413
{% endfor %}{# gres #}

templates/slurm.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ NodeName={{ hostlists | join(',') }} {{ '' -}}
4040
{{ nodegroup.node_params | default({}) | dict2parameters }} {{ '' -}}
4141
{% if 'gres' in nodegroup -%}
4242
Gres={{ ','.join(nodegroup.gres | map(attribute='conf')) -}}
43-
{% elif openhpc_gres_autodetect == 'nvml' and first_host_hv['ohpc_node_gpu_gres'] != '' -%}
43+
{% elif nodegroup.gres_autodetect | default(openhpc_gres_autodetect) == 'nvml' and first_host_hv['ohpc_node_gpu_gres'] != '' -%}
4444
Gres={{ first_host_hv['ohpc_node_gpu_gres'] -}}
4545
{% endif %}
4646

0 commit comments

Comments
 (0)