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

# User Rev Content
1 fgolf 1.1 #!/bin/bash
2    
3     UNIVERSE="grid"
4     EXE="wrapper.sh"
5 fgolf 1.5 INPUT="wrapper.sh, job_input/input.tgz, appendTimeStamp.sh"
6 fgolf 1.1 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 fgolf 1.6 #
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 fgolf 1.1
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 fgolf 1.3 " > condor_${COPYDIRBASE##*/}.cmd
58 fgolf 1.1
59     #
60     # now set the rest of the arguments
61     # for each job
62     #
63    
64 kelley 1.4 if [ -d $DATADIR ]; then
65     DATADIR=${DATADIR}/*.root
66     fi
67     for FILE in `ls ${DATADIR}`; do
68 fgolf 1.1 echo "
69     executable=${EXE}
70     transfer_executable=True
71 fgolf 1.6 arguments=\"`echo ${FILE##*/} | sed 's/\.root//g'` ${FILE} ${SAMPLE} ${ATYPE} ${RUNLIST} ${OPTIONS} ${COPYDIR}\"
72 fgolf 1.1 queue
73 fgolf 1.3 " >> condor_${COPYDIRBASE##*/}.cmd
74 fgolf 1.1 done
75    
76 kelley 1.4 echo "[writeConfig] wrote condor_${COPYDIRBASE##*/}.cmd"