-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
generating slurm.conf values #34
Comments
Yes, it's possible to use the values from ansible_facts to dynamically populate the values of your slurm.conf file. The template you've written is largely correct, but there are a few potential issues to be aware of:
Here's your example with the modifications: slurm_nodes:
name: "{{ headnode }}"
CoresPerSocket: "{{ ansible_facts['ansible_processor_cores'] | default(1) | string }}"
CPUs: "{{ ansible_facts['ansible_processor_vcpu'] | default(1) | string }}"
Gres: "gpu:p620:1"
NodeAddr: "{{ headnode }}"
RealMemory: "{{ ansible_facts['ansible_memory_mb.real.total'] | default(1024) | string }}"
Sockets: "1"
ThreadsPerCore: "{{ ansible_facts['ansible_processor_threads_per_core'] | default(1) | string }}"
Feature: "gpu,intel,ht"
State: "UNKNOWN" Replace the |
Thanks for the detailed reply, your example didn't work for me, but I'm pretty sure I have set gather_facts to true somewhere. I think I have enough info to figure it out. I will post up what worked for me in case there are others who have the same question |
Here is a working configuration that queries the values for every node using ansible facts. For large clusters, this is still a manual process since we'd still need to create this stanza for every node in the cluster. It would be nice to be able to loop through the host members of a group to generate the slurm.conf values.
edit: Never mind, I saw the example in the README. I believe the following should work
|
I'm a bit of an ansible noob here. . .but,
When generating the slurm.conf file
Instead of hard coded values:
slurm_nodes:
CoresPerSocket: "6"
CPUs: "12"
Gres: "gpu:p620:1"
NodeAddr: "{{ headnode }}"
RealMemory: "31846"
Sockets: "1"
ThreadsPerCore: "2"
Feature: "gpu,intel,ht"
State: "UNKNOWN"
Is it possible to get the values from ansible_facts . . .something along the lines of
slurm_nodes:
CoresPerSocket: "{{ ansible_facts['ansible_processor_cores'] }}"
CPUs: "{{ ansible_facts['ansible_processor_vcpu'] }}"
Gres: "gpu:p620:1"
NodeAddr: "{{ headnode }}"
RealMemory: {{ ansible_facts['ansible_memory_mb.real.total'] }}
Sockets: "1"
ThreadsPerCore: "{{ ansible_facts['ansible_processor_threads_per_core'] }}"
Feature: "gpu,intel,ht"
State: "UNKNOWN"
The text was updated successfully, but these errors were encountered: