-
Notifications
You must be signed in to change notification settings - Fork 0
/
kurt_submit.sh
executable file
·84 lines (60 loc) · 1.87 KB
/
kurt_submit.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
#!/bin/sh
counter=0
incrementer=1
destination=/mnt/hadoop/cms/store/user/rkunnawa/kurt_test/output/
filelist=kurt_small_filelist.txt
#filelist=wxie_MinBiasUPC_all.txt
#filelist=pPbMCBForestList.txt
#mkdir -p $destination
nFiles=`wc -l < $filelist`
#export X509_USER_PROXY=/net/hisrv0001/home/rkunnawa/myproxy/
echo "nFiles in list: $nFiles"
while [ $counter -lt $1 ]
do
echo $counter >> Submitted
Error=`echo "err/$counter" | sed "s/root/err/g"`
Output=`echo "out/$counter" | sed "s/root/out/g"`
Log=`echo "log/$counter" | sed "s/root/log/g"`
startfile=$(( $counter * $2 ))
endfile=$(( ($counter + 1) * $2 ))
if [ $endfile -gt $nFiles ]; then
let endfile=$nFiles
let counter=$1
fi
# Condor submit file
cat > subfile <<EOF
Universe = vanilla
# files will be copied back to this dir
Initialdir = .
#tell condor where my grid certificate it
x509userproxy=/tmp/x509up_u2142
# run my script
Executable = kurt_run.sh
+AccountingGroup = "group_cmshi.rkunnawa"
#+IsMadgraph = 1
Arguments = $startfile $endfile $destination \$(Process)
# input files. in this case, there are none.
Input = /dev/null
# log files
Error = $Error
Output = $Output
Log = $Log
# get the environment (path, etc.)
Getenv = True
# prefer to run on fast computers
Rank = kflops
# only run on 64 bit computers
Requirements = Arch == "X86_64"
# should write all output & logs to a local directory
# and then transfer it back to Initialdir on completion
should_transfer_files = YES
when_to_transfer_output = ON_EXIT
# specify any extra input files (for example, an orcarc file)
transfer_input_files = $filelist
Queue
EOF
# submit the job
echo "submitting run.sh $startfile $endfile to $destination ..."
condor_submit subfile
counter=$(($counter + 1))
done