-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathprocessSubmit.sh
executable file
·115 lines (98 loc) · 2.42 KB
/
processSubmit.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#!/bin/bash
help()
{
echo "Usage:"
echo "./processSubmit.sh -r listOfRawFiles.txt -e directoryOfExecutablesAndConfig -o outputDirectory [-p]"
}
rawFiles=""
execDir=""
outputDir=""
poisson=0
OPTIND=1 #needed by getopts
while getopts "r:e:o:ph" opt; do
case "$opt" in
r)
rawFiles=$OPTARG
;;
e)
execDir=$OPTARG
;;
o)
outputDir=$OPTARG
;;
p)
poisson=1
;;
h)
help
return 0 2> /dev/null || exit 0
;;
esac
done
if ! [[ "$*" == *"-r"* && "$*" == *"-e"* && "$*" == *"-o"* ]]; then
echo "one or more options are missing"
help
return 1 2> /dev/null || exit 1
fi
if [ ! -f "$rawFiles" ]; then
echo "File with list of raw files does not exist!"
help
return 1 2> /dev/null || exit 1
fi
if [ ! -d "$execDir" ]; then
echo "Directory with executable does not exist!"
help
return 1 2> /dev/null || exit 1
fi
if [ ! -f "$execDir/parserCrv" ]; then
echo "parserCrv does not exist in directory of executables!"
help
return 1 2> /dev/null || exit 1
fi
if [ ! -f "$execDir/calibCrv" ]; then
echo "calibCrv does not exist in directory of executables!"
help
return 1 2> /dev/null || exit 1
fi
if [ ! -f "$execDir/recoCrv" ]; then
echo "calibCrv does not exist in directory of executables!"
help
return 1 2> /dev/null || exit 1
fi
if [ ! -f "$execDir/config.txt" ]; then
echo "config.txt does not exist in directory of executables!"
help
return 1 2> /dev/null || exit 1
fi
if [ ! -d "$outputDir" ]; then
echo "Output directory does not exist!"
help
return 1 2> /dev/null || exit 1
fi
mkdir $outputDir/crvparsed
mkdir $outputDir/crvcalib
mkdir $outputDir/crvreco
mkdir $outputDir/log
processes=`< $rawFiles wc -l`
jobname="mu2eWideband"
currentDir=`pwd`
#normal jobs only require 1GB of memory
#LED jobs require 4GB of memory
jobsub_submit \
-N $processes \
-e JOBNAME=$jobname \
-e RAWFILES=$rawFiles \
-e EXECDIR=$execDir \
-e OUTPUTDIR=$outputDir \
-e POISSON=$poisson \
--memory=4GB \
--disk=100GB \
--expected-lifetime=4h \
--resource-provides usage_model=OPPORTUNISTIC,DEDICATED,OFFSITE \
--group=mu2e \
--append_condor_requirements='(TARGET.HAS_SINGULARITY=?=true)' \
--lines '+SingularityImage=\"/cvmfs/singularity.opensciencegrid.org/fermilab/fnal-wn-sl7:latest\"' \
--lines '+FERMIHTC_AutoRelease=True' \
--lines '+FERMIHTC_GraceMemory=1024' \
--lines '+FERMIHTC_GraceLifetime=7200' \
file:"//$currentDir/processDo.sh"