HOW TO CONFIGURE AND RUN CRAB ON uaf-1.t2.ucsd.edu
The following script configures BOSS, setups of a
CMSSW area, creates a crab.cfg file, creates and submits a couple of jobs.
This example is set up for OSG sites.
More detailed documentation on CRAB can be found
here.
In my .bash_profile I source /data/vdt/setup.sh
#!/bin/sh
TOP=$PWD
export SCRAM_ARCH=slc3_ia32_gcc323
export VDT_LOCATION=/data/vdt
export EDG_WL_LOCATION=$VDT_LOCATION/edg
source $VDT_LOCATION/setup.sh
#Check for valid voms proxy, must be valid for at least 24hrs
voms-proxy-info -exists -valid 24:00
if [ $? == 1 ] ; then
echo please generate a new proxy
fi
# define versions
project=CMSSW
#version=1_4_0_pre3
version=1_3_1
crab_version=CRAB_1_5_1_pre1
# clean up
cd $TOP
rm -rf $HOME/.bossrc $HOME/boss
rm -rf $TOP/$crab_version
rm -rf $TOP/${project}_${version}
# configure CRAB and boss
CRAB_TARBALL=/code/osgcode/cmslocal/crab/$crab_version.tgz
tar zxvf $CRAB_TARBALL
cd $crab_version
./configure
source ./crab.sh
./configureBoss
source ./crab.sh
# set up a CMSSW area
cd $TOP
#source /code/osgcode/cmslocal/cms/cmsset_default.sh ${project}_${version}
source /code/osgcode/cmssoft/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 =/mc-onsel-120_Incl_ttbar/FEVT/CMSSW_1_2_0-FEVT-1166726158
pset=/code/osgcode/cmslocal/crab/CRAB/python/runSimHitAnalyzer.cfg
total_number_of_events=200
number_of_jobs = 2
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=ucsd.edu
SE_white_list=ucsd.edu
[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
crab -submit 1 -continue $job
exit
To run a crab command later (i.e. to check the job status, get output etc.) set up the environment and then run the command $1:
#!/bin/sh
TOP=$PWD
export SCRAM_ARCH=slc3_ia32_gcc323
export VDT_LOCATION=/data/vdt
export EDG_WL_LOCATION=$VDT_LOCATION/edg
source $VDT_LOCATION/setup.sh
project=CMSSW
version=1_3_1
crab_version=CRAB_1_5_1_pre1
cd $crab_version
source ./crab.sh
cd $TOP
source /code/osgcode/cmssoft/cmsset_default.sh ${project}_${version}
cd ${project}_${version}/src
eval `scramv1 runtime -sh`
crab -$1
exit
--
JamesLetts - 08 May 2007