Skip to content

Commit 51001ed

Browse files
committed
Update readme
1 parent 4238c70 commit 51001ed

File tree

3 files changed

+1
-17
lines changed

3 files changed

+1
-17
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ each list element:
4848

4949
`openhpc_module_system_install`: Optional, default true. Whether or not to install an environment module system. If true, lmod will be installed. If false, You can either supply your own module system or go without one.
5050

51-
`openhpc_gres_autodetect`: Optional. The [auto detection mechanism](https://slurm.schedmd.com/gres.conf.html#OPT_AutoDetect) to use for the generic resources. Can be set on individual hosts or groups of hosts using host/group vars. Note: you must still define `gres` dictionary in `openhpc_slurm_partitions`, but you only need the define the `conf` key.
52-
5351
### slurm.conf
5452

5553
`openhpc_nodegroups`: Optional, default `[]`. List of mappings, each defining a
@@ -61,6 +59,7 @@ unique set of homogenous nodes:
6159
`free --mebi` total * `openhpc_ram_multiplier`.
6260
* `ram_multiplier`: Optional. An override for the top-level definition
6361
`openhpc_ram_multiplier`. Has no effect if `ram_mb` is set.
62+
* `gres_autodetect`: Optional. The [auto detection mechanism](https://slurm.schedmd.com/gres.conf.html#OPT_AutoDetect) to use for the generic resources. Note: you must still define the `gres` dictionary (see below) but you only need the define the `conf` key.
6463
* `gres`: Optional. List of dicts defining [generic resources](https://slurm.schedmd.com/gres.html). Each dict should define:
6564
- `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.
6665
- `file`: Omit 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.

defaults/main.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ openhpc_retry_delay: 10
1414
openhpc_job_maxtime: '60-0' # quote this to avoid ansible converting some formats to seconds, which is interpreted as minutes by Slurm
1515
openhpc_config: "{{ openhpc_extra_config | default({}) }}"
1616
openhpc_gres_template: gres.conf.j2
17-
# Autodetection mechanism to use: https://slurm.schedmd.com/gres.html#AutoDetect e.g nvml.
18-
# NOTE: 'off' is a special sentinal value to indicate that autodetection should not be used.
19-
openhpc_gres_autodetect: 'off'
2017
openhpc_slurm_configless: "{{ 'enable_configless' in openhpc_config.get('SlurmctldParameters', []) }}"
2118

2219
openhpc_state_save_location: /var/spool/slurm

filter_plugins/slurm_conf.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# NB: To test this from the repo root run:
1616
# ansible-playbook -i tests/inventory -i tests/inventory-mock-groups tests/filter.yml
1717

18-
from collections import defaultdict
1918
from ansible import errors
2019
import jinja2
2120
import re
@@ -66,16 +65,6 @@ def hostlist_expression(hosts):
6665
unmatchable.append(v)
6766
return ['{}[{}]'.format(k, _group_numbers(v)) for k, v in results.items()] + unmatchable
6867

69-
@jinja2.pass_context
70-
def group_by_gres_autodetect(context, hosts):
71-
""" Groups a list of hosts by the gres_autodetect variable
72-
"""
73-
result = defaultdict(list)
74-
for host in hosts:
75-
gres_autodetect = _get_hostvar(context, 'openhpc_gres_autodetect', inventory_hostname=host) or 'off'
76-
result[gres_autodetect].append(host)
77-
return result
78-
7968
def _group_numbers(numbers):
8069
units = []
8170
ints = [int(n) for n in numbers]
@@ -144,5 +133,4 @@ def filters(self):
144133
'error': error,
145134
'dict2parameters': dict2parameters,
146135
'config2dict': config2dict,
147-
'group_by_gres_autodetect': group_by_gres_autodetect,
148136
}

0 commit comments

Comments
 (0)