Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,14 @@ partition configuration for each.
[slurm.conf](https://slurm.schedmd.com/slurm.conf.html). Keys are slurm.conf
parameter names and values are lists or strings as appropriate. This can be
used to supplement or override the template defaults. Templated parameters can
also be removed by setting the value to the literal string`'omit'` - note
also be removed by setting the value to the literal string `'omit'` - note
that this is *not the same* as the Ansible `omit` [special variable](https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html#term-omit).

`openhpc_cgroup_config`: Optional. Mapping of additional parameters and values for
[cgroup.conf](https://slurm.schedmd.com/cgroup.conf.html). Keys are cgroup.conf
parameter names and values are lists or strings as appropriate. This can be
used to supplement or override the template defaults. Templated parameters can
also be removed by setting the value to the literal string `'omit'` - note
that this is *not the same* as the Ansible `omit` [special variable](https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html#term-omit).

`openhpc_ram_multiplier`: Optional, default `0.95`. Multiplier used in the calculation: `total_memory * openhpc_ram_multiplier` when setting `RealMemory` for the partition in slurm.conf. Can be overriden on a per partition basis using `openhpc_slurm_partitions.ram_multiplier`. Has no effect if `openhpc_slurm_partitions.ram_mb` is set.
Expand Down
6 changes: 6 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ openhpc_default_config:
PropagateResourceLimitsExcept: MEMLOCK
Epilog: /etc/slurm/slurm.epilog.clean
ReturnToService: 2
openhpc_cgroup_default_config:
ConstrainCores: "yes"
ConstrainDevices: "yes"
ConstrainRAMSpace: "yes"
ConstrainSwapSpace: "yes"

openhpc_config: {}
openhpc_cgroup_config: {}
openhpc_gres_template: gres.conf.j2
openhpc_slurm_configless: "{{ 'enable_configless' in openhpc_config.get('SlurmctldParameters', []) }}"

Expand Down
6 changes: 5 additions & 1 deletion tasks/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@
owner: root
group: root
when: openhpc_enable.control | default(false) or not openhpc_slurm_configless | bool
notify:
- Restart slurmctld service
register: ohpc_cgroup_conf
# NB uses restart rather than reload as this is needed in some cases

- name: Remove local tempfile for slurm.conf templating
ansible.builtin.file:
Expand Down Expand Up @@ -139,7 +143,7 @@
changed_when: true
when:
- openhpc_slurm_control_host in ansible_play_hosts
- hostvars[openhpc_slurm_control_host].ohpc_slurm_conf.changed or hostvars[openhpc_slurm_control_host].ohpc_gres_conf.changed # noqa no-handler
- hostvars[openhpc_slurm_control_host].ohpc_slurm_conf.changed or hostvars[openhpc_slurm_control_host].ohpc_cgroup_conf.changed or hostvars[openhpc_slurm_control_host].ohpc_gres_conf.changed # noqa no-handler
notify:
- Restart slurmd service

Expand Down
9 changes: 5 additions & 4 deletions templates/cgroup.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# See man slurm.conf and man cgroup.conf for further
# information on cgroup configuration parameters
#--
ConstrainCores=yes
ConstrainDevices=yes
ConstrainRAMSpace=yes
ConstrainSwapSpace=yes
{% for k, v in openhpc_cgroup_default_config | combine(openhpc_cgroup_config) | items %}
{% if v != "omit" %}{# allow removing items using setting key: null #}
{{ k }}={{ v | join(',') if (v is sequence and v is not string) else v }}
{% endif %}
{% endfor %}