Skip to content

Commit

Permalink
Merge pull request #156 from stackhpc/fix/empty-partitions
Browse files Browse the repository at this point in the history
Allow multiple empty partitions
  • Loading branch information
sjpb authored May 12, 2023
2 parents bff03a3 + f6d1b16 commit 46dceaa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
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

0 comments on commit 46dceaa

Please sign in to comment.