ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/FGolf/BatchSubmitCMS2/writeConfig.sh
Revision: 1.1
Committed: Thu Apr 19 00:46:06 2012 UTC (13 years ago) by fgolf
Content type: application/x-sh
Branch: MAIN
Log Message:
first version of new batch submit based almost entirely on scripts form d.evans

File Contents

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