diff --git a/anduril/slurm b/anduril/slurm new file mode 100755 index 0000000..5bb7dc5 --- /dev/null +++ b/anduril/slurm @@ -0,0 +1,48 @@ +#!/bin/bash + +USAGE="Usage: "$( basename $0 )" [options] [--] [command including srun options] +Sends the command to a queue with srun +Version (c) Ville.Rantanen@helsinki.fi +Options: + --possess Possess the whole node for the run + -c N Request number of CPUs [Def 4] + --mem M Request M Gb of memory [Def 20] + -h This help + +Use the -- switch to separate switches assigned to slurp vs anything after.. +" +if [ -z "$1" ] +then echo -e "$USAGE" + exit 1 +fi +SHARE=-s +CPU=4 +MEM=20 +declare -a argv=("$@") +for (( i=1; i<=${#} ;i++ )) +do [[ ${!i} == "--possess" ]] && { + echo Will possess the whole node. + SHARE="" + unset argv[$(( $i - 1 ))] + } + [[ ${!i} == "-c" ]] && { + CPU=${argv[$i]} + unset argv[$(( $i - 1 ))] + unset argv[$(( $i ))] + } + [[ ${!i} == "--mem" ]] && { + MEM=${argv[$i]} + unset argv[$(( $i - 1 ))] + unset argv[$(( $i ))] + } + [[ ${!i} == "-h" ]] && { + echo -e "$USAGE" + exit 1 + } + [[ ${!i} == "--" ]] && { + break + } +done + +echo Running command: srun $SHARE -c $CPU --mem $MEM "${argv[@]}" +srun -v $SHARE -c $CPU --mem $MEM "${argv[@]}" diff --git a/anduril/slurp b/anduril/slurp deleted file mode 100755 index 5bb7dc5..0000000 --- a/anduril/slurp +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -USAGE="Usage: "$( basename $0 )" [options] [--] [command including srun options] -Sends the command to a queue with srun -Version (c) Ville.Rantanen@helsinki.fi -Options: - --possess Possess the whole node for the run - -c N Request number of CPUs [Def 4] - --mem M Request M Gb of memory [Def 20] - -h This help - -Use the -- switch to separate switches assigned to slurp vs anything after.. -" -if [ -z "$1" ] -then echo -e "$USAGE" - exit 1 -fi -SHARE=-s -CPU=4 -MEM=20 -declare -a argv=("$@") -for (( i=1; i<=${#} ;i++ )) -do [[ ${!i} == "--possess" ]] && { - echo Will possess the whole node. - SHARE="" - unset argv[$(( $i - 1 ))] - } - [[ ${!i} == "-c" ]] && { - CPU=${argv[$i]} - unset argv[$(( $i - 1 ))] - unset argv[$(( $i ))] - } - [[ ${!i} == "--mem" ]] && { - MEM=${argv[$i]} - unset argv[$(( $i - 1 ))] - unset argv[$(( $i ))] - } - [[ ${!i} == "-h" ]] && { - echo -e "$USAGE" - exit 1 - } - [[ ${!i} == "--" ]] && { - break - } -done - -echo Running command: srun $SHARE -c $CPU --mem $MEM "${argv[@]}" -srun -v $SHARE -c $CPU --mem $MEM "${argv[@]}" diff --git a/anduril/slurp b/anduril/slurp new file mode 120000 index 0000000..0efb82a --- /dev/null +++ b/anduril/slurp @@ -0,0 +1 @@ +slurm \ No newline at end of file