ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/FGolf/BatchSubmitCMS2/writeConfig.sh
Revision: 1.6
Committed: Tue May 28 07:00:33 2013 UTC (11 years, 11 months ago) by fgolf
Content type: application/x-sh
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +11 -9 lines
Log Message:
new version

File Contents

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