1 |
fgolf |
1.1 |
#!/bin/bash
|
2 |
|
|
|
3 |
|
|
UNIVERSE="grid"
|
4 |
|
|
EXE="wrapper.sh"
|
5 |
|
|
INPUT="wrapper.sh, job_input/input.tgz"
|
6 |
|
|
SITE="UCSD"
|
7 |
fgolf |
1.2 |
PROXY="/tmp/x509up_u31032"
|
8 |
fgolf |
1.1 |
|
9 |
|
|
DIR=$PWD
|
10 |
fgolf |
1.2 |
SUBMITLOGDIR="${DIR}/submit_logs"
|
11 |
|
|
JOBLOGDIR="${DIR}/job_logs"
|
12 |
|
|
LOGDIR="${DIR}/"
|
13 |
fgolf |
1.1 |
LOG="${LOGDIR}/submit_logs/condor_`date "+%m_%d_%Y"`.log"
|
14 |
|
|
OUT="${LOGDIR}/job_logs/1e.\$(Cluster).\$(Process).out"
|
15 |
|
|
ERR="${LOGDIR}/job_logs/1e.\$(Cluster).\$(Process).err"
|
16 |
|
|
|
17 |
|
|
|
18 |
|
|
#
|
19 |
|
|
# prepare input sandbox
|
20 |
|
|
#
|
21 |
kelley |
1.4 |
g++ sweepRoot.C -o sweepRoot `root-config --cflags --libs`
|
22 |
fgolf |
1.2 |
cd ${DIR}/job_input
|
23 |
|
|
rm input.*
|
24 |
kelley |
1.4 |
mv ../sweepRoot .
|
25 |
fgolf |
1.2 |
tar -czf input.tgz --exclude='*CVS*' *
|
26 |
fgolf |
1.1 |
cd ${DIR}
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
DATATYPE=$1
|
30 |
|
|
REALDATA=$2
|
31 |
|
|
RUNLIST=$3
|
32 |
|
|
DATADIR=$4
|
33 |
|
|
COPYDIRBASE=$5
|
34 |
|
|
COPYDIR=/hadoop/cms/store/user/$USER/${COPYDIRBASE}
|
35 |
|
|
|
36 |
|
|
#
|
37 |
|
|
# write configuration
|
38 |
|
|
#
|
39 |
|
|
|
40 |
|
|
echo "
|
41 |
|
|
Grid_Resource=gt2 osg-gw-4.t2.ucsd.edu:2119/jobmanager-condor
|
42 |
|
|
universe=${UNIVERSE}
|
43 |
|
|
when_to_transfer_output = ON_EXIT
|
44 |
|
|
#the actual executable to run is not transfered by its name.
|
45 |
|
|
#In fact, some sites may do weird things like renaming it and such.
|
46 |
|
|
transfer_input_files=${INPUT}
|
47 |
|
|
+DESIRED_Sites=${SITE}
|
48 |
|
|
+Owner = undefined
|
49 |
|
|
log=${LOG}
|
50 |
|
|
output=${OUT}
|
51 |
|
|
error =${ERR}
|
52 |
|
|
notification=Never
|
53 |
|
|
x509userproxy=${PROXY}
|
54 |
fgolf |
1.3 |
" > condor_${COPYDIRBASE##*/}.cmd
|
55 |
fgolf |
1.1 |
|
56 |
|
|
#
|
57 |
|
|
# now set the rest of the arguments
|
58 |
|
|
# for each job
|
59 |
|
|
#
|
60 |
|
|
|
61 |
kelley |
1.4 |
if [ -d $DATADIR ]; then
|
62 |
|
|
DATADIR=${DATADIR}/*.root
|
63 |
|
|
fi
|
64 |
|
|
for FILE in `ls ${DATADIR}`; do
|
65 |
fgolf |
1.1 |
echo "
|
66 |
|
|
executable=${EXE}
|
67 |
|
|
transfer_executable=True
|
68 |
|
|
arguments=`echo ${FILE##*/} | sed 's/\.root//g'` ${DATATYPE} ${FILE} ${REALDATA} ${RUNLIST} ${COPYDIR}
|
69 |
|
|
queue
|
70 |
fgolf |
1.3 |
" >> condor_${COPYDIRBASE##*/}.cmd
|
71 |
fgolf |
1.1 |
done
|
72 |
|
|
|
73 |
kelley |
1.4 |
echo "[writeConfig] wrote condor_${COPYDIRBASE##*/}.cmd"
|
74 |
fgolf |
1.1 |
|