From 6823ec50b4e2035021ec98aa6c890e9d5e921335 Mon Sep 17 00:00:00 2001 From: ville rantanen Date: Mon, 1 Jul 2013 14:01:57 +0300 Subject: [PATCH] slurp --- slurp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 slurp diff --git a/slurp b/slurp new file mode 100755 index 0000000..00245d6 --- /dev/null +++ b/slurp @@ -0,0 +1,30 @@ +#!/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 + +" +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 + } +done + +echo Running command: "${argv[@]}" +srun $SHARE "${argv[@]}"