forked from jmccreight/wrfHydroScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgeyser.sh
executable file
·46 lines (39 loc) · 1.02 KB
/
geyser.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
help='
geyser.sh
At least one option must be specified.
Options:
-j job name. default = myJob
-n # cores. default = 8
-w wall time default = 24:00
-d Run with defaults.
-h This help message.
'
if [ -z $@ ]; then
echo "$help"
exit 0
fi
jobName=myJob
nCores=8
wallTime=24:00
while getopts "::n:j:w:hd" opt; do
case $opt in
j) jobName="${OPTARG}" ;;
n) nCores="${OPTARG}" ;;
w) wallTime="${OPTARG}" ;;
h) echo "$help"; exit 0 ;;
esac
done
shift "$((OPTIND-1))" # Shift off the option
echo "jobName: $jobName"
echo "nCores: $nCores"
echo "wallTime: $wallTime"
hrs=`echo $wallTime | cut -d':' -f1`
min=`echo $wallTime | cut -d':' -f2`
[ ${#wallTime} -eq 5 ] || exit 1
[ ${#hrs} -eq 2 ] || exit 1
[ ${#min} -eq 2 ] || exit 1
## formalize these failures with a message?
#echo bsub -Is -q geyser -W "$wallTime" -n "$nCores" -P P48500028 -J "$jobName" $SHELL
bsub -Is -q geyser -W "$wallTime" -n "$nCores" -P P48500028 -J "$jobName" $SHELL
exit $?