@@ -41,7 +41,7 @@ openhpc_default_config:
4141 PropagateResourceLimitsExcept : MEMLOCK
4242 Epilog : /etc/slurm/slurm.epilog.clean
4343 ReturnToService : 2
44- GresTypes : " {{ ohpc_gres_types | flatten | sort | unique | join(',') if ohpc_gres_types else 'omit' }}"
44+ GresTypes : " {{ ohpc_gres_types if ohpc_gres_types != '' else 'omit' }}"
4545openhpc_cgroup_default_config :
4646 ConstrainCores : " yes"
4747 ConstrainDevices : " yes"
@@ -50,18 +50,16 @@ openhpc_cgroup_default_config:
5050
5151openhpc_config : {}
5252openhpc_cgroup_config : {}
53- ohpc_gres_types :
54- # toplevel nvml autodetect:
55- - " {{ ['gpu'] if openhpc_gres_autodetect == 'nvml' else [] }}"
56- # nodegroup nvml autodetect:
57- - " {{ ['gpu'] if openhpc_nodegroups | map(attribute='gres_autodetect', default='') | unique | select('eq', 'nvml') else [] }}"
58- # nodegroup specific gres conf:
59- - " {{
60- openhpc_nodegroups |
53+ ohpc_gres_types : >-
54+ {{
55+ (
56+ ['gpu'] if openhpc_gres_autodetect == 'nvml' else [] +
57+ ['gpu'] if openhpc_nodegroups | map(attribute='gres_autodetect', default='') | unique | select('eq', 'nvml') else [] +
58+ openhpc_nodegroups |
6159 community.general.json_query('[].gres[].conf') |
6260 map('regex_search', '^(\\w+)')
63- }} "
64-
61+ ) | flatten | reject('eq', '') | sort | unique | join(',')
62+ }}
6563openhpc_gres_template : gres.conf.j2
6664openhpc_cgroup_template : cgroup.conf.j2
6765
0 commit comments