diff --git a/tasks/runtime.yml b/tasks/runtime.yml index 6e52535..2f2d6b3 100644 --- a/tasks/runtime.yml +++ b/tasks/runtime.yml @@ -43,6 +43,16 @@ notify: - Restart Munge service +- name: Get slurmd's view of node configuration + command: + cmd: slurmd -C + when: openhpc_slurm_service == 'slurmd' + register: slurmd_conf + changed_when: false + # stdout is e.g.: + # NodeName=nrel-hpc-0 CPUs=16 Boards=1 SocketsPerBoard=2 CoresPerSocket=8 ThreadsPerCore=1 RealMemory=128616 + # UpTime=0-00:48:14 + - name: Template slurmdbd.conf template: src: slurmdbd.conf.j2 diff --git a/templates/slurm.conf.j2 b/templates/slurm.conf.j2 index 02dda44..efbcd9a 100644 --- a/templates/slurm.conf.j2 +++ b/templates/slurm.conf.j2 @@ -114,11 +114,8 @@ Epilog=/etc/slurm/slurm.epilog.clean {% set first_host = group_hosts | first | mandatory('Group "' + group_name + '" contains no hosts in this play - was --limit used?') %} {% set first_host_hv = hostvars[first_host] %} -NodeName=DEFAULT State=UNKNOWN \ - RealMemory={% if 'ram_mb' in group %}{{group.ram_mb}}{% else %}{{ first_host_hv['ansible_memory_mb']['real']['total'] }}{% endif %} \ - Sockets={{first_host_hv['ansible_processor_count']}} \ - CoresPerSocket={{first_host_hv['ansible_processor_cores']}} \ - ThreadsPerCore={{first_host_hv['ansible_processor_threads_per_core']}} +# TODO: support modifying parameters using existing variables +NodeName=DEFAULT {{ first_host_hv['slurmd_conf'].stdout_lines[0] | regex_replace("NodeName=\S+ ", "") }} {% for node in groups[group_name] %} NodeName={{ node }} {% endfor %}{# nodes #}