Using CRAB at UW-HEP CMS#

This is not a complete guide to CRAB. It is intended to be used in combination with Fermilab CRAB Instructions. This document provides UW-HEP specific environment setup.#

Quick Recipe#

First, get a DOE grid certificate. The instructions for doing this are here.#

Verify that your grid certificate is installed correctly in .globus:#

grid-proxy-init

If all goes well, the above should ask you for the password of your private key and will then generate a temporary grid proxy credential for you. A grid proxy is simply a temporary identity that is signed by your DOE certificate. Various grid commands use this proxy to identify you to grid services.#

Once you have a grid certificate, request to be added to the CMS Virtual Organization (VO). Instructions are here. Notice that it says you must already be registered with the CMS Secretariat. I am not familiar with the procedure for that, but I will find out and fill in the details here later.#

Once you have been added to the CMS VO (actually one hour afterwards), you should be able to start using CRAB to submit analysis jobs to any CMS grid site. The following example shows how to submit jobs to UWMadisonCMS. #

# login to a machine capable of submitting grid jobs
# example: login01, login02, login03

# CRAB Version export
CRAB_VER=CRAB_1_5_3

# CMSSW Version export
CMSSW_VER=CMSSW_1_5_2

#The following command only needs to be done once.
scramv1 project CMSSW $CMSSW_VER

#Load CMSSW environment settings
cd ${CMSSW_VER}/src
eval `scramv1 runtime -sh`

#Load CRAB environment
source /cms/sw/${CRAB_VER}/crab.sh

#The first time you use CRAB, you will need to initialize BOSS
/cms/sw/${CRAB_VER}/configureBoss

Now you have your environment all set up for using CRAB. You next need to configure the analysis jobs.#

# Choose a working directory for your CRAB activities.
# If you choose one in AFS (not highly recommended, but possible)
# then be sure it has ACLs set up to be writable by condor:
# fs setacl -dir /insert/path/here -acl condor-hosts rlidkw
# Otherwise, consider making a directory for yourself in /scratch
# and working in there. Just be aware that this is not backed up!

cd /path/to/your/analysis/workdir
#(e.g. /scratch/username/analysisname)
cp /cms/sw/${CRAB_VER}/examples/crab_wisc.cfg .
cp /cms/sw/${CRAB_VER}/examples/cmssw.cfg .

# Edit these two files to your liking.
# For anything other than a test, you will want to change
# total_number_of_events events_per_job

# Now create CRAB jobs.
crab -cfg ./crab_wisc.cfg -create 1

# Now submit CRAB jobs to Condor.
crab -submit

# You should be able to see your jobs in the condor queue now:
condor_q

References#