Created
March 8, 2017 14:00
-
-
Save Henry-E/4377ce753031e1a7376a819bcd61d8b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# make it easier to request interactive jobs | |
int () | |
{ | |
# there's issues with getopts working in functions if OPTIND isn't reset | |
# every time the function is called | |
local OPTIND; | |
# should we use gpu queue, defaults to cpu | |
g=false | |
# how many ppn to use | |
p=4 | |
# how much memory, default is it doesn't matter | |
m="" | |
# how much time | |
t="walltime=40:00:00" | |
while getopts ":gm:p:t:" opt; do | |
case $opt in | |
g) | |
g=true | |
;; | |
m) | |
m=":mem"$OPTARG"GB" | |
;; | |
p) | |
p=$OPTARG | |
;; | |
t) | |
t="walltime="$OPTARG":00:00" | |
esac | |
done | |
if [ "$g" = true ]; then | |
qsub -I -q gpuq -l nodes=1:ppn=$p$m -l $t -N "interactive_gpu" | |
else | |
qsub -I -l nodes=1:ppn=$p$m -l $t -N "interactive_cpu" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment