TWiki> Main Web>TWikiUsers>ChaoukiB>FnalBatchSystem (revision 1)EditAttachPDF

Procedure to run on the FNAL Batch System.

The main idea is to submit a script using condor tools. that runs a python file with few arguments.

I have created a script called submit_mc.sh that runs taking arguments from a text file called private_mc_files.txt. The aim from this script and text file, is to run on different datasets while just adding lines in the text file, for example:

1 RELVALTTBAR /relval/CMSSW_4_2_5/RelValTTbar/GEN-SIM-RECO/START42_V12-v1/0113

The number 1 in the first column means you want to run on this dataset (if you put 0, the line will be ignored). The second column is only a tag to be used later to differentiate different scripts/root files. The third column points to the dataset.

When you run the scrript submit_mc.sh, another script will be created and it called: sub_RELVALTTBAR, its content is as follows:

universe = vanilla
Executable = run_all.sh 
Requirements = Memory >= 199 &&OpSys == "LINUX"&& (Arch != "DUMMY" )&& Disk > 1000000
Should_Transfer_Files = YES
WhenToTransferOutput = ON_EXIT
Output = sleep_$(Cluster)_$(Process).stdout
Error = sleep_$(Cluster)_$(Process).stderr
Log = sleep_$(Cluster)_$(Process).log
notify_user = chaouki7@FNAL.GOV
Arguments = RELVALTTBAR /store//relval/CMSSW_4_2_5/RelValTTbar/GEN-SIM-RECO/START42_V12-v1/0113
Queue 1

Then submit_mc.sh will run it using the command:

condor_submit sub_RELVALTTBAR

And that is it...

But in the background, there are few things one needs to know in order to customize the setup. The script sub_RELVALTTBAR contains another script called run_all.sh, which includes the name of the python file to be run under CMSSW. The content of run_all.sh is:

#! /usr/bin/env sh
#

source /uscmst1/prod/sw/cms/bashrc prod 
export SCRAM_ARCH=slc5_amd64_gcc434
cd /uscms/home/chaouki7/work/CMSSW_4_2_5/src
eval `scramv1 runtime -sh`

export MYDIR=/uscms_data/d2/chaouki7/CrabSubmit/testFnal/
export OUTPUT=/uscms_data/d2/chaouki7/CrabSubmit/testFnal/
mkdir -p ${OUTPUT}
cd $MYDIR

export FR=$1
export MSOURCE=$2
export MaxEvt=-1
export MLIST="listToProcess${FR}.list"
export MYFILES=filesToRun${FR}.txt

rm -rf ${MYFILES} ${MLIST}
ls -l /pnfs/cms/WAX/11/$MSOURCE | grep root | awk '{print $9}' >>  $MYFILES

MYFILE=0
for MLINE in `cat $MYFILES`; do
    MYFILE=$((${MYFILE}+1))
    export MFILE="${MSOURCE}/${MLINE}"
    echo $MFILE >> $MLIST
done

export MYNTUP=privateMC_${FR}.root
echo "---> running cmsRun whelicity_sub_cfg.py print files_load=$MLIST output=${MYNTUP} maxEvents=${MaxEvt}"

cmsRun whelicity_sub_cfg.py print files_load=$MLIST output=${MYNTUP} maxEvents=${MaxEvt}

You can/have to change the following:

  • Directory where CMSSW is installed /uscms/home/chaouki7/work/CMSSW_4_2_5/src
  • Directory where you have copied the files and also where you want the ouput to be saved ( /uscms_data/d2/chaouki7/CrabSubmit/testFnal/)
  • Your python file whelicity_sub_cfg.py

The python file needs to have the options enabled for example:

import FWCore.ParameterSet.Config as cms
import sys, os
import FWCore.ParameterSet.VarParsing as VarParsing
##################################################################################################
process = cms.Process("ANALYSISNTUPLE")

options = VarParsing.VarParsing ('standard')

# setup any defaults you want
options.output = 'default.root'
options.maxEvents = -1 # -1 means all events

# get and parse the command line arguments
options.parseArguments()

........

process.source = cms.Source("PoolSource",
   fileNames = cms.untracked.vstring(options.files)
)

.....


process.aodDump = cms.EDAnalyzer('WHelicityMeasurement',
        rootFileName = cms.untracked.string(options.output),
.....

-- ChaoukiB - 16-Mar-2012

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 2012-03-16 - unknown
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback