Files
q-tools/slurp
ville rantanen 06c14bec93 more help
2013-07-08 13:58:42 +03:00

35 lines
750 B
Bash
Executable File

#!/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
-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
declare -a argv=("$@")
for (( i=1; i<=${#} ;i++ ))
do [[ ${!i} == "--possess" ]] && {
echo Will possess the whole node.
SHARE=""
unset argv[$(( $i - 1 ))]
}
[[ ${!i} == "-h" ]] && {
echo -e "$USAGE"
exit 1
}
[[ ${!i} == "--" ]] && {
break
}
done
echo Running command: "${argv[@]}"
srun -v $SHARE "${argv[@]}"