Skip to content

Commit b8e1400

Browse files
committed
Move to separate field as it not possible to autodetect for a subset of gpus
1 parent 610a8ed commit b8e1400

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ each list element:
5858
* `extra_nodes`: Optional. A list of additional node definitions, e.g. for nodes in this group/partition not controlled by this role. Each item should be a dict, with keys/values as per the ["NODE CONFIGURATION"](https://slurm.schedmd.com/slurm.conf.html#lbAE) docs for slurm.conf. Note the key `NodeName` must be first.
5959
* `ram_mb`: Optional. The physical RAM available in each node of this group ([slurm.conf](https://slurm.schedmd.com/slurm.conf.html) parameter `RealMemory`) in MiB. This is set using ansible facts if not defined, equivalent to `free --mebi` total * `openhpc_ram_multiplier`.
6060
* `ram_multiplier`: Optional. An override for the top-level definition `openhpc_ram_multiplier`. Has no effect if `ram_mb` is set.
61+
* `gres_autodetect`: Optional. The [auto detection mechanism](https://slurm.schedmd.com/gres.conf.html#OPT_AutoDetect) to use for the resource.
6162
* `gres`: Optional. List of dicts defining [generic resources](https://slurm.schedmd.com/gres.html). Each dict should define:
6263
- `conf`: A string with the [resource specification](https://slurm.schedmd.com/slurm.conf.html#OPT_Gres_1) but requiring the format `<name>:<type>:<number>`, e.g. `gpu:A100:2`. Note the `type` is an arbitrary string.
63-
- `file`: Optional if `autodetect` is set, A string with the [File](https://slurm.schedmd.com/gres.conf.html#OPT_File) (path to device(s)) for this resource, e.g. `/dev/nvidia[0-1]` for the above example.
64-
- `autodetect`: Optional if `file` is set, The [auto detection mechanism](https://slurm.schedmd.com/gres.conf.html#OPT_AutoDetect) to use for the resource.
64+
- `file`: Optional if `gres_autodetect` is set, A string with the [File](https://slurm.schedmd.com/gres.conf.html#OPT_File) (path to device(s)) for this resource, e.g. `/dev/nvidia[0-1]` for the above example.
6565

6666
Note [GresTypes](https://slurm.schedmd.com/slurm.conf.html#OPT_GresTypes) must be set in `openhpc_config` if this is used.
6767

templates/gres.conf.j2

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ AutoDetect=off
22
{% for part in openhpc_slurm_partitions %}
33
{% set nodelist = [] %}
44
{% for group in part.get('groups', [part]) %}
5-
{% if 'gres' in group %}
5+
{% if 'gres_autodetect' in group %}
6+
NodeName={{ hostlist }} AutoDetect={{ group.gres_autodetect }}
7+
{% elif 'gres' in group %}
68
{% for gres in group.gres %}
79
{% set gres_name, gres_type, _ = gres.conf.split(':') %}
810
{% set group_name = group.cluster_name|default(openhpc_cluster_name) ~ '_' ~ group.name %}
911
{% set file = gres.file | default('') %}
10-
{% set autodetect = gres.autodetect | default('') %}
1112
{% set inventory_group_hosts = groups.get(group_name, []) %}
1213
{% for hostlist in (inventory_group_hosts | hostlist_expression) %}
13-
NodeName={{ hostlist }} Name={{ gres_name }} Type={{ gres_type }}{% if gres.file is truthy %} File={{ gres.file }}{% endif %}{% if gres.autodetect is truthy %} AutoDetect={{ gres.autodetect }}{%endif%}
14+
NodeName={{ hostlist }} Name={{ gres_name }} Type={{ gres_type }} File={{ gres.file }}
1415

1516
{% endfor %}
1617
{% endfor %}

0 commit comments

Comments
 (0)