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

Allow multiple empty partitions #156

Merged
merged 4 commits into from
May 12, 2023
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 molecule/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Local installation on a RockyLinux 8.x machine looks like:
sudo yum install -y git
git clone [email protected]:stackhpc/ansible-role-openhpc.git
cd ansible-role-openhpc/
python3.9 -m venv venv
python3.8 -m venv venv
. venv/bin/activate
pip install -U pip
pip install -r molecule/requirements.txt
Expand Down
8 changes: 5 additions & 3 deletions templates/slurm.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,15 @@ NodeName={{ hostlist }} State=UNKNOWN RealMemory={{ group.get('ram_mb', ram_mb)
{% set _ = nodelist.append(extra_node_defn['NodeName']) %}
{% endfor %}
{% endfor %}{# group #}
{% if not nodelist %} {# empty partition - define an invalid hostname which slurm accepts #}
{% set nodelist = ['n/a'] %}
NodeName={{ nodelist[0] }}
{% if not nodelist %}{# empty partition #}
{% set nodelist = ['""'] %}
{% endif %}
PartitionName={{part.name}} Default={{ part.get('default', 'YES') }} MaxTime={{ part.get('maxtime', openhpc_job_maxtime) }} State=UP Nodes={{ nodelist | join(',') }} {{ part.partition_params | default({}) | dict2parameters }}
{% endfor %}{# partitions #}

# Define a non-existent node, in no partition, so that slurmctld starts even with all partitions empty
NodeName=nonesuch

# Want nodes that drop out of SLURM's configuration to be automatically
# returned to service when they come back.
ReturnToService=2