#!/bin/sh
runcfg=/home/users/letts/IOTest/runSimHitAnalyzer.cfg
project=CMSSW
version=1_3_1
export CMS_SOFTWARE=/code/osgcode/cmssoft
crab_version=CRAB_1_5_2
CRAB_TARBALL=/code/osgcode/cmslocal/crab/$crab_version.tgz
export SCRAM_ARCH=slc3_ia32_gcc323
export VDT_LOCATION=/data/vdt
for file in $CRAB_TARBALL $runcfg $VDT_LOCATION/setup.sh ; do
    if [ ! -f $file ] ; then
        echo File $file does not exist, fatal error.
        exit 1
    fi
done

export EDG_WL_LOCATION=$VDT_LOCATION/edg
source $VDT_LOCATION/setup.sh
voms-proxy-info -exists -hours 24 >> /dev/null 2>&1
if [ $? != 0 ] ; then
    echo Please generate a new proxy, fatal error.
    exit 1
fi

################################################################################

# UCSD

# Purdue 8.6TB
#SE=purdue.edu
#CE=osg.rcac.purdue.edu
#dataset="/ZToMuMu/CMSSW_1_2_0-LowLumiPU-1166809258/GEN-SIM-DIGI-RECO"
#number_of_jobs=400

# Wisconsin 3TB
#SE="wisc.edu"
#CE=$SE
#dataset="/QCD_pt_50_80/CMSSW_1_2_0-1166725966/GEN-SIM-DIGI-RECO"
#number_of_jobs=300

# MIT 5.6TB
#SE="mit.edu"
#CE=$SE
#dataset="/ttbar_inclusive_TopRex/CMSSW_1_3_1-Spring07-1122/GEN-SIM-DIGI-RECO"
#number_of_jobs=500

# Nebraska doesn't have enough data to run on:
SE=unl.edu
CE=unl.edu
dataset="/Wenu/CMSSW_1_2_0-1172965061/GEN-SIM-DIGI-RECO"
#dataset="/Zee/CMSSW_1_3_1-Spring07-1353/GEN-SIM-DIGI-RECO"
number_of_jobs=200


################################################################################

# make a subdirectory from which to submit the jobs
DIR=${CE}_${RANDOM}
mkdir $DIR
cd $DIR
TOP=$PWD

# clean up old boss installations
cd $TOP
rm -rf $HOME/.bossrc $HOME/boss
rm -rf $TOP/$crab_version
rm -rf $TOP/${project}_${version}

# configure CRAB and boss
tar zxvf $CRAB_TARBALL
cd $crab_version
./configure
source ./crab.sh
./configureBoss
source ./crab.sh

# set up a CMSSW area
cd $TOP
source $CMS_SOFTWARE/cmsset_default.sh ${project}_${version}
scramv1 project $project ${project}_${version}
cd ${project}_${version}/src
eval `scramv1 runtime -sh`

# make a crab configuration file
cat > crab.cfg << EOF
[CRAB]
jobtype = cmssw
scheduler = condor_g
[CMSSW]
datasetpath =$dataset
use_dbs_1 =2
pset=$runcfg
total_number_of_events=-1
number_of_jobs = $number_of_jobs
output_file = Histos.root
[USER]
return_data = 1
use_central_bossDB = 0
use_boss_rt = 1 
boss_clads=
[EDG]
lcg_version = 2
proxy_server = myproxy.cern.ch 
additional_jdl_parameters = AllowZippedISB = false;
virtual_organization = cms
retry_count = 2
lcg_catalog_type = lfc
lfc_host = lfc-cms-test.cern.ch
lfc_home = /grid/cms
CE_white_list=$CE
SE_white_list=$SE
[CONDORG]
EOF

# create crab jobs
LOG=log_`date +%s`_$RANDOM
crab -create -cfg ./crab.cfg | tee $LOG 2>&1
job=`grep "working directory" $LOG | awk -F/ '{print $(NF-1)}'`
echo your job is $job
njobs=`grep "Total of" $LOG | grep "jobs created" | awk '{print $4}'`
crab -submit $njobs -continue $job

exit 0

-- JamesLetts - 15 Jun 2007

Topic revision: r1 - 2007/06/15 - 16:55:49 - JamesLetts
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback