From 04c9bba98cca9faed956c07e4f490143dbf19471 Mon Sep 17 00:00:00 2001 From: Renato Alves <alves.rjc@gmail.com> Date: Wed, 6 Sep 2017 10:47:33 +0200 Subject: [PATCH] ENH Add QoS/Preemption options for SLURM --- bin/submitjob | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/submitjob b/bin/submitjob index 2d77497..ef7f45e 100755 --- a/bin/submitjob +++ b/bin/submitjob @@ -16,6 +16,7 @@ MEM="4" # 4 GB by default MEMALL="$MEM" ACTIVE="100" QUEUE="" +PREEMPT="normal" TARGET="" FEATURES="" EMAIL="" @@ -66,6 +67,7 @@ usage() { echo >&2 " for less than 1G/job use fractionals such as 0.1 (100M/job)" echo >&2 " -a --active = limit number of simultaneously active jobs. Defaults to ${ACTIVE}" echo >&2 " -q --queue = which queue to use. Uses cluster's default if unspecified" + echo >&2 " * -p --preempt = specify preemption level (aka QoS) (SLURM). Defaults to ${PREEMPT}" echo >&2 " * -t --target = restricts to running on the given host(s) [comma separated] (SGE)" echo >&2 " * -F --features = request specific resources to constrain your jobs (SLURM)" echo >&2 " -l --logfile = filename to use as stdout/stderr of each job. Defaults to ${LOGFILE}" @@ -236,6 +238,7 @@ cat << EOF | ${LOCALCMD} #SBATCH --mem-per-cpu=${MEM}M #SBATCH --output=${LOGFILE} #SBATCH --job-name=${NAME} +#SBATCH --qos=${PREEMPT} ${BANG_BEGIN} ${BANG_QUEUE} ${BANG_EMAIL} @@ -312,7 +315,7 @@ EOF } -ARG_PARSE="getopt -o s:n:c:N:m:a:q:t:F:l:e:E:w:b:d:fh -l system:,name:,cores:,nodes:,mem:,active:,queue:,target:,features:,logfile:,email:,emailwhen:,waitfor:,begin:,debug:,fatal,help -n $0 --" +ARG_PARSE="getopt -o s:n:c:N:m:a:q:p:t:F:l:e:E:w:b:d:fh -l system:,name:,cores:,nodes:,mem:,active:,queue:,preempt:,target:,features:,logfile:,email:,emailwhen:,waitfor:,begin:,debug:,fatal,help -n $0 --" # We process arguments twice to handle any argument parsing error: ARG_ERROR=$($ARG_PARSE "$@" 2>&1 1>/dev/null) @@ -369,6 +372,11 @@ while true; do QUEUE="$1" shift ;; + -p|--preempt) + shift + PREEMPT="$1" + shift + ;; -t|--target) shift TARGET="$1" -- GitLab