ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/FGolf/BatchSubmitCMS2/writeConfig.sh
Revision: 1.3
Committed: Fri Apr 20 20:03:35 2012 UTC (13 years ago) by fgolf
Content type: application/x-sh
Branch: MAIN
Changes since 1.2: +2 -2 lines
Log Message:
make naming of condor_dataset.cmd file more flexible

File Contents

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