From d029d884358d0001a6470da55f642936c522cee9 Mon Sep 17 00:00:00 2001 From: Alan Date: Sat, 2 Apr 2022 00:08:30 +0000 Subject: [PATCH] initial commit --- cancel_jobs.sh | 15 +++++++++++++++ resume_jobs.sh | 15 +++++++++++++++ suspend_jobs.sh | 15 +++++++++++++++ undrain_node.sh | 7 +++++++ 4 files changed, 52 insertions(+) create mode 100755 cancel_jobs.sh create mode 100755 resume_jobs.sh create mode 100755 suspend_jobs.sh create mode 100755 undrain_node.sh diff --git a/cancel_jobs.sh b/cancel_jobs.sh new file mode 100755 index 0000000..33b0b59 --- /dev/null +++ b/cancel_jobs.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# written by Alan + +if [[ $# -ne 2 ]] + then + echo 'This script requires two arguments being the first and last job numbers to cancel listed by squeue.' + exit 1 +fi + +for (( job_number=$1; job_number<=$2; job_number++ )) + do + echo "canceling $job_number" + scancel $job_number +done \ No newline at end of file diff --git a/resume_jobs.sh b/resume_jobs.sh new file mode 100755 index 0000000..211eb3e --- /dev/null +++ b/resume_jobs.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# written by Alan + +if [[ $# -ne 2 ]] + then + echo 'This script requires two arguments being the first and last job numbers to resume listed by squeue.' + exit 1 +fi + +for (( job_number=$1; job_number<=$2; job_number++ )) + do + echo "resuming $job_number" + eval sudo scontrol resume $job_number +done \ No newline at end of file diff --git a/suspend_jobs.sh b/suspend_jobs.sh new file mode 100755 index 0000000..8ee35e0 --- /dev/null +++ b/suspend_jobs.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# written by Alan + +if [[ $# -ne 2 ]] + then + echo 'This script requires two arguments being the first and last job numbers to suspend listed by squeue.' + exit 1 +fi + +for (( job_number=$1; job_number<=$2; job_number++ )) + do + echo "suspending $job_number" + eval sudo scontrol suspend $job_number +done \ No newline at end of file diff --git a/undrain_node.sh b/undrain_node.sh new file mode 100755 index 0000000..a58b9e6 --- /dev/null +++ b/undrain_node.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +# written by Alan + +eval sudo scontrol update NodeName=slurm-test State=DOWN Reason="undraining" + +eval sudo scontrol update NodeName=slurm-test State=RESUME \ No newline at end of file