Skip to content
Snippets Groups Projects
Verified Commit 04c9bba9 authored by Renato Alves's avatar Renato Alves :seedling:
Browse files

ENH Add QoS/Preemption options for SLURM

parent db8f485a
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment