Skip to content

Commit 787014e

Browse files
Add an option to start the topology from scratch.
1 parent 2bee3e1 commit 787014e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ The key word `permanent` allows will spin up clusters but not delete them untill
185185
After a modification of the `/opt/oci-hpc/conf/queues.conf`, you need to run
186186
`/opt/oci-hpc/bin/slurm_config.sh`
187187

188+
If you have some state that is messing with Slurm, you can make sure it is put back in the initial state with
189+
`/opt/oci-hpc/bin/slurm_config.sh --initial`
190+
188191
To turn on autoscaling:
189192
Uncomment the line in `crontab -e`:
190193
```

bin/slurm_config.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#
33
# Regenerate Slurm Config
44
#
5+
# Add --initial as argument if you need to restart slurm from scratch (Removes the current topology file)
56

67

78
scripts=`realpath $0`
@@ -12,7 +13,12 @@ playbooks_path=$folder/../playbooks/
1213

1314
if [[ `cat $conf_folder/queues.conf | grep instance_keyword | uniq -c -d | wc -l ` == 0 ]];
1415
then
16+
if [ ${@: -1} == "--INITIAL" or ${@: -1} == "--initial" or ${@: -1} == "-INITIAL" or ${@: -1} == "-initial"]
17+
then
18+
sudo rm /etc/slurm/topology.conf
19+
sudo /usr/sbin/slurmctld -c
20+
fi
1521
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook $playbooks_path/slurm_config.yml
16-
else
22+
else
1723
echo "There are some duplicates instance_keyword lines, please make them unique"
1824
fi

0 commit comments

Comments
 (0)