Skip to content
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

Fix cod slurm role #489

Merged
merged 6 commits into from
Nov 1, 2024
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
2 changes: 1 addition & 1 deletion cod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- { name: 'enable_lmod', tags: 'enable_lmod' }
- { name: 'enable_lmod', tags: 'enable_lmod_image', vars: [{ enable_lmod_prefix: "{{ cm_def_img_path }}" }] }
- { name: 'cod_rabbitmq_agents_cloud', tags: 'cod_rabbitmq_agents_cloud' }
- { name: 'cod_slurm', tags: 'cod_slurm'}
- { name: 'cod_login_node', tags: 'cod_login_node' }
- { name: 'cod_compute_node', tags: 'cod_compute_node' }
- { name: 'cod_slurm', tags: 'cod_slurm'}
- { name: 'job_submit_plugin', tags: 'job_submit_plugin', when: enable_job_submit_plugin}
22 changes: 14 additions & 8 deletions roles/cod_slurm/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
---
- name: Template slurm.conf
ansible.builtin.template:
src: slurm.conf.j2
dest: "{{ slurm_conf_path }}"

- name: Restart slurmctld
ansible.builtin.service:
name: slurmctld
state: restarted

- name: Enable setting to prevent cmd from overwriting slurm config
ansible.builtin.lineinfile:
path: "/cm/local/apps/cmd/etc/cmd.conf"
Expand All @@ -21,15 +31,11 @@
backup: yes
when: "'FreezeChangesToSlurmConfig = true' in lookup('file', '/cm/local/apps/cmd/etc/cmd.conf')"

- name: Template slurm.conf
ansible.builtin.template:
src: slurm.conf.j2
dest: "{{ slurm_conf_path }}"

- name: Reconfigure Slurm
ansible.builtin.command: scontrol reconfigure

- name: Restart cmd
ansible.builtin.service:
name: cmd
state: restarted

- name: Reconfigure Slurm
ansible.builtin.command: scontrol reconfigure

5 changes: 2 additions & 3 deletions roles/cod_slurm/templates/slurm.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ AccountingStorageHost=master
# Nodes
{% for i in range(1, num_compute_nodes +1) %}
{% if i is odd() %}
NodeName=c000{{i}} Procs=2 Feature= gpfs4
NodeName=c000{{i}} Procs=2 Feature=gpfs4
{% else %}
NodeName=c000{{i}} Procs=2 Feature= gpfs5
NodeName=c000{{i}} Procs=2 Feature=gpfs5
{% endif %}
{% endfor %}

Expand All @@ -100,5 +100,4 @@ GresTypes=gpu
PrologSlurmctld=/cm/local/apps/cmd/scripts/prolog-prejob
Prolog=/cm/local/apps/cmd/scripts/prolog
Epilog=/cm/local/apps/cmd/scripts/epilog
FastSchedule=0
# Power saving section (disabled)
Loading