-
Notifications
You must be signed in to change notification settings - Fork 1
/
propr.sh
69 lines (63 loc) · 1.65 KB
/
propr.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Some proper settings and stubs to run rostr without errors by default
# Local qsub stub for testing
#qsub() {
# echo $RANDOM
#}
# Stubs for submission steps, override in submission scripts where needed
preSubmit() {
return
}
submit() {
return
}
postSubmit() {
return
}
# Stub for retrieving a sample name from a path
getSampleName() {
echo $1 | awk -F"/" '{ print $NF }' | cut -d. -f1 | cut -d\_ -f1
}
# A function I need over different submission scripts but I have no idea where to put atm
# Implementation of partial wide should (partly) happen here as well
getHoldIds() {
local HOLDFOR=""
if [ ${#REQS} -ne "0" ]
then
for REQ in ${REQS[@]}
do
REQNODE=`arrayGet PROVIDES $REQ`
# If REQNODE is wide, add this widenode to hold list
if [ `arrayGet WIDENODES ${REQNODE}` ]
then
#HOLDFOR+=(`arrayGet JOBIDS_WIDE ${REQNODE}`)
HOLDID=`arrayGet JOBIDS_wide ${REQNODE}`
HOLDFOR="$HOLDFOR;$HOLDID"
# If REQNODE is not wide
else
# Test if we are wide ourselves and add all preceding sample jobs if so
if [ `arrayGet WIDENODES ${NODENAME}` ]
then
for DEPSAMPLE in ${SAMPLES[@]}
do
#HOLDFOR+=(`arrayGet JOBIDS_${DEPSAMPLE} ${REQNODE}`)
HOLDID=`arrayGet JOBIDS_${DEPSAMPLE} ${REQNODE}`
HOLDFOR="$HOLDFOR;$HOLDID"
done
# And if we are not, just add one sample dependency
else
HOLDFOR+=(`arrayGet JOBIDS_${SAMPLE} ${REQNODE}`)
HOLDID=`arrayGet JOBIDS_${SAMPLE} ${REQNODE}`
HOLDFOR="$HOLDFOR;$HOLDID"
fi
fi
done
fi
echo $HOLDFOR
}
# Stub values to work with
SCHEDULER='dry'
QUEUE='defq'
SGE_PE='singlenode'
DIR_NODES=$DIR_BASE/pipelines/
ARG_SUBBASE=""
ARG_JOB_CPU_MAX=99999