Skip to content

Commit 83ff39f

Browse files
authored
Merge pull request #81 from stackhpc/feature/realmemory
Default node memory for slurm.conf now set from ansible facts
2 parents db63427 + 7d2898b commit 83ff39f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ package in the image.
4242
Otherwise, `groups` can be omitted and the following attributes can be defined in the partition object:
4343
* `name`: The name of the nodes within this group.
4444
* `cluster_name`: Optional. An override for the top-level definition `openhpc_cluster_name`.
45-
* `ram_mb`: Optional. The physical RAM available in each server of this group ([slurm.conf](https://slurm.schedmd.com/slurm.conf.html) parameter `RealMemory`). This is set to the Slurm default of `1` if not defined.
45+
* `ram_mb`: Optional. The physical RAM available in each server of this group ([slurm.conf](https://slurm.schedmd.com/slurm.conf.html) parameter `RealMemory`) in MiB. This is set to the total real memory from ansible facts if not defined (equivalent to `free --mebi` total).
4646

4747
For each group (if used) or partition there must be an ansible inventory group `<cluster_name>_<group_name>`, with all nodes in this inventory group added to the group/partition. Note that:
4848
- Nodes may have arbitrary hostnames but these should be lowercase to avoid a mismatch between inventory and actual hostname.

templates/slurm.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Epilog=/etc/slurm/slurm.epilog.clean
115115
{% set first_host_hv = hostvars[first_host] %}
116116

117117
NodeName=DEFAULT State=UNKNOWN \
118-
RealMemory={% if 'ram_mb' in group %}{{group.ram_mb}}{% else %}1{% endif %} \
118+
RealMemory={% if 'ram_mb' in group %}{{group.ram_mb}}{% else %}{{ first_host_hv['ansible_memory_mb']['real']['total'] }}{% endif %} \
119119
Sockets={{first_host_hv['ansible_processor_count']}} \
120120
CoresPerSocket={{first_host_hv['ansible_processor_cores']}} \
121121
ThreadsPerCore={{first_host_hv['ansible_processor_threads_per_core']}}

0 commit comments

Comments
 (0)