Skip to content

Commit feaf87f

Browse files
committed
updated crab jobs
1 parent f015a66 commit feaf87f

File tree

20 files changed

+651
-20
lines changed

20 files changed

+651
-20
lines changed

crab/FrameworkJobReport.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<FrameworkJobReport>
2+
<ReadBranches>
3+
</ReadBranches>
4+
<PerformanceReport>
5+
<PerformanceSummary Metric="StorageStatistics">
6+
<Metric Name="Parameter-untracked-bool-enabled" Value="true"/>
7+
<Metric Name="Parameter-untracked-bool-stats" Value="true"/>
8+
<Metric Name="Parameter-untracked-string-cacheHint" Value="application-only"/>
9+
<Metric Name="Parameter-untracked-string-readHint" Value="auto-detect"/>
10+
<Metric Name="ROOT-tfile-read-totalMegabytes" Value="0"/>
11+
<Metric Name="ROOT-tfile-write-totalMegabytes" Value="0"/>
12+
</PerformanceSummary>
13+
</PerformanceReport>
14+
15+
<GeneratorInfo>
16+
</GeneratorInfo>
17+
</FrameworkJobReport>

crab/crab-test/pset.py

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Auto generated configuration file
2+
# using:
3+
# Revision: 1.19
4+
# Source: /local/reps/CMSSW/CMSSW/Configuration/Applications/python/ConfigBuilder.py,v
5+
# with command line options: MinBias_8TeV_cfi --conditions auto:startup -s GEN,SIM --datatier GEN-SIM -n 10
6+
# --relval 9000,300 --eventcontent RAWSIM --io MinBias.io --python MinBias.py --no_exec --fileout minbias.root
7+
8+
import FWCore.ParameterSet.Config as cms
9+
10+
process = cms.Process("SIM")
11+
12+
# Import of standard configurations
13+
process.load("Configuration.StandardSequences.Services_cff")
14+
process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
15+
process.load("FWCore.MessageService.MessageLogger_cfi")
16+
process.load("Configuration.EventContent.EventContent_cff")
17+
process.load("SimGeneral.MixingModule.mixNoPU_cfi")
18+
process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
19+
process.load("Configuration.Geometry.GeometrySimDB_cff")
20+
process.load("Configuration.StandardSequences.MagneticField_38T_cff")
21+
process.load("Configuration.StandardSequences.Generator_cff")
22+
process.load("IOMC.EventVertexGenerators.VtxSmearedRealistic8TeVCollision_cfi")
23+
process.load("GeneratorInterface.Core.genFilterSummary_cff")
24+
process.load("Configuration.StandardSequences.SimIdeal_cff")
25+
process.load("Configuration.StandardSequences.EndOfProcess_cff")
26+
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
27+
28+
process.maxEvents = cms.untracked.PSet(input=cms.untracked.int32(10))
29+
30+
# Input source
31+
process.source = cms.Source("EmptySource")
32+
33+
process.options = cms.untracked.PSet()
34+
process.options.numberOfThreads = cms.untracked.uint32(1)
35+
36+
# Production Info
37+
process.configurationMetadata = cms.untracked.PSet(
38+
version=cms.untracked.string("$Revision: 1.19 $"),
39+
annotation=cms.untracked.string("MinBias_8TeV_cfi nevts:10"),
40+
name=cms.untracked.string("Applications"),
41+
)
42+
43+
# Output definition
44+
process.RAWSIMoutput = cms.OutputModule(
45+
"PoolOutputModule",
46+
splitLevel=cms.untracked.int32(0),
47+
eventAutoFlushCompressedSize=cms.untracked.int32(5242880),
48+
outputCommands=process.RAWSIMEventContent.outputCommands,
49+
fileName=cms.untracked.string("minbias.root"),
50+
dataset=cms.untracked.PSet(
51+
filterName=cms.untracked.string(""), dataTier=cms.untracked.string("GEN-SIM")
52+
),
53+
SelectEvents=cms.untracked.PSet(SelectEvents=cms.vstring("generation_step")),
54+
)
55+
56+
# Additional output definition
57+
58+
# Other statements
59+
process.genstepfilter.triggerConditions = cms.vstring("generation_step")
60+
from Configuration.AlCa.GlobalTag import GlobalTag
61+
62+
process.GlobalTag = GlobalTag(process.GlobalTag, "auto:startup", "")
63+
64+
process.generator = cms.EDFilter(
65+
"Pythia6GeneratorFilter",
66+
pythiaPylistVerbosity=cms.untracked.int32(0),
67+
filterEfficiency=cms.untracked.double(1.0),
68+
pythiaHepMCVerbosity=cms.untracked.bool(False),
69+
comEnergy=cms.double(8000.0),
70+
maxEventsToPrint=cms.untracked.int32(0),
71+
PythiaParameters=cms.PSet(
72+
pythiaUESettings=cms.vstring(
73+
"MSTU(21)=1 ! Check on possible errors during program execution",
74+
"MSTJ(22)=2 ! Decay those unstable particles",
75+
"PARJ(71)=10 . ! for which ctau 10 mm",
76+
"MSTP(33)=0 ! no K factors in hard cross sections",
77+
"MSTP(2)=1 ! which order running alphaS",
78+
"MSTP(51)=10042 ! structure function chosen (external PDF CTEQ6L1)",
79+
"MSTP(52)=2 ! work with LHAPDF",
80+
"PARP(82)=1.921 ! pt cutoff for multiparton interactions",
81+
"PARP(89)=1800. ! sqrts for which PARP82 is set",
82+
"PARP(90)=0.227 ! Multiple interactions: rescaling power",
83+
"MSTP(95)=6 ! CR (color reconnection parameters)",
84+
"PARP(77)=1.016 ! CR",
85+
"PARP(78)=0.538 ! CR",
86+
"PARP(80)=0.1 ! Prob. colored parton from BBR",
87+
"PARP(83)=0.356 ! Multiple interactions: matter distribution parameter",
88+
"PARP(84)=0.651 ! Multiple interactions: matter distribution parameter",
89+
"PARP(62)=1.025 ! ISR cutoff",
90+
"MSTP(91)=1 ! Gaussian primordial kT",
91+
"PARP(93)=10.0 ! primordial kT-max",
92+
"MSTP(81)=21 ! multiple parton interactions 1 is Pythia default",
93+
"MSTP(82)=4 ! Defines the multi-parton model",
94+
),
95+
processParameters=cms.vstring(
96+
"MSEL=0 ! User defined processes",
97+
"MSUB(11)=1 ! Min bias process",
98+
"MSUB(12)=1 ! Min bias process",
99+
"MSUB(13)=1 ! Min bias process",
100+
"MSUB(28)=1 ! Min bias process",
101+
"MSUB(53)=1 ! Min bias process",
102+
"MSUB(68)=1 ! Min bias process",
103+
"MSUB(92)=1 ! Min bias process, single diffractive",
104+
"MSUB(93)=1 ! Min bias process, single diffractive",
105+
"MSUB(94)=1 ! Min bias process, double diffractive",
106+
"MSUB(95)=1 ! Min bias process",
107+
),
108+
parameterSets=cms.vstring("pythiaUESettings", "processParameters"),
109+
),
110+
)
111+
112+
# Path and EndPath definitions
113+
process.generation_step = cms.Path(process.pgen)
114+
process.simulation_step = cms.Path(process.psim)
115+
process.genfiltersummary_step = cms.EndPath(process.genFilterSummary)
116+
process.endjob_step = cms.EndPath(process.endOfProcess)
117+
process.RAWSIMoutput_step = cms.EndPath(process.RAWSIMoutput)
118+
119+
# Schedule definition
120+
process.schedule = cms.Schedule(
121+
process.generation_step,
122+
process.genfiltersummary_step,
123+
process.simulation_step,
124+
process.endjob_step,
125+
process.RAWSIMoutput_step,
126+
)
127+
128+
# Filter all path with the production filter sequence
129+
for path in process.paths:
130+
getattr(process, path)._seq = process.generator * getattr(process, path)._seq

crab/crab-test/run.sh

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#!/bin/bash -e
2+
JENKINS_ID=$(echo ${CRAB_ReqName} | sed 's|.*_||')
3+
if [ "${JENKINS_ID}" = "" ] ; then JENKINS_ID="$$" ; fi
4+
req=$(date +%s)
5+
rm -rf cmdrun
6+
mkdir -p cmdrun
7+
xstart=$(echo "START" | base64)
8+
xend=$(echo "END" | base64)
9+
pushd cmdrun
10+
touch run.log
11+
curl -s -L "https://muzaffar.web.cern.ch/cgi-bin/test-v2?START=1&req=${req}&uid=${JENKINS_ID}" >>run.log 2>&1
12+
req=$(date +%s)
13+
LRUN=${req}
14+
PRECMD=""
15+
RUN_GAP=0
16+
while [ $RUN_GAP -lt 3600 ] ; do
17+
req=$(date +%s)
18+
curl -s -L -o cmd.txt "https://muzaffar.web.cern.ch/crab-test/cmd.txt?req=${req}&uid=${JENKINS_ID}"
19+
cmd=$(grep "^cmd=${JENKINS_ID}=" cmd.txt || true)
20+
if [ "${cmd}" = "" ] ; then
21+
cmd=$(grep "^cmd=0=" cmd.txt || true)
22+
fi
23+
rm -f cmd.txt
24+
cmd=$(echo "$cmd" | sed 's|^.*=|cmd=|')
25+
if [ "$cmd" = "cmd=0" ] ; then
26+
break
27+
fi
28+
if [ "${PRECMD}" = "$cmd" -o "${cmd}" = "" ] ; then
29+
xt=$(date +%s)
30+
xd=0
31+
while [ $xd -lt 9 ] ; do
32+
for i in 0 1 2 3 4 5 6 7 8 9 ; do
33+
for i in 0 1 2 3 4 5 6 7 8 9 ; do
34+
for i in 0 1 2 3 4 5 6 7 8 9 ; do
35+
true
36+
done
37+
done
38+
done
39+
let xd=$(date +%s)-${xt} || true
40+
done
41+
let RUN_GAP=$(date +%s)-${LRUN}
42+
b64=$(echo "previous_${cmd}" | base64)
43+
curl -s -L -X POST -d "$b64" "https://muzaffar.web.cern.ch/cgi-bin/test-v2?WAITING=1&${cmd}&req=${req}&uid=${JENKINS_ID}" >>run.log 2>&1
44+
else
45+
curl -s -L -o run.sh "https://muzaffar.web.cern.ch/crab-test/run.sh?req=${req}&uid=${JENKINS_ID}"
46+
curl -s -L -X POST -d "${xstart}" "https://muzaffar.web.cern.ch/cgi-bin/test-v2?RUN=START&req=${req}&${cmd}&uid=${JENKINS_ID}" >>run.log 2>&1
47+
chmod +x run.sh
48+
./run.sh > run.log 2>&1 || true
49+
total_lines=$(cat run.log | wc -l)
50+
sline=1
51+
xline=20
52+
while [ $sline -le $total_lines ] ; do
53+
sed -n "${sline},+${xline}p" run.log | base64 > run.base64
54+
curl -s -L -X POST -d @run.base64 "https://muzaffar.web.cern.ch/cgi-bin/test-v2?result=${sline}of${total_lines}&${cmd}&req=${req}&uid=${JENKINS_ID}" >>run.log 2>&1
55+
sleep 1
56+
let sline=$sline+$xline+1
57+
done
58+
curl -s -L -X POST -d "${xend}" "https://muzaffar.web.cern.ch/cgi-bin/test-v2?RUN=END&req=${req}&${cmd}&uid=${JENKINS_ID}" >>run.log 2>&1
59+
rm -f run.sh run.log run.base64
60+
PRECMD="${cmd}"
61+
LRUN=$(date +%s)
62+
RUN_GAP=0
63+
fi
64+
done
65+
popd
66+
req=$(date +%s)
67+
mv cmdrun/run.log .
68+
rm -rf cmdrun
69+
curl -s -L "https://muzaffar.web.cern.ch/cgi-bin/test-v2?END=1&req=${req}&uid=${JENKINS_ID}" >>run.log 2>&1

crab/crab-test/setup.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash -ex
2+
scram build enable-multi-targets
3+
cp $(dirname $0)/../FrameworkJobReport.xml $WORKSPACE/
4+
cp $(dirname $0)/../minbias.root $WORKSPACE/

crab/crab-test/task.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
from CRABClient.UserUtilities import config
2+
import os, re, time
3+
4+
archs = os.environ["SCRAM_ARCH"].split("_")
5+
osMajorVer = int(re.sub("[a-z]", "", archs[0]))
6+
7+
config = config()
8+
config.General.instance = os.getenv("CRABCONFIGINSTANCE", "prod")
9+
config.General.requestName = os.getenv("CRAB_REQUEST", str(int(time.time())))
10+
config.General.transferOutputs = True
11+
config.General.transferLogs = False
12+
13+
config.Data.unitsPerJob = 10
14+
config.Data.totalUnits = 10
15+
config.Data.splitting = "EventBased"
16+
config.Data.publication = False
17+
18+
config.JobType.psetName = "pset.py"
19+
config.JobType.pluginName = "PrivateMC"
20+
config.JobType.maxJobRuntimeMin = int(os.getenv("CRAB_MAX_TIME", "600"))
21+
config.JobType.maxMemoryMB = 2000
22+
config.JobType.numCores = 1
23+
config.JobType.allowUndistributedCMSSW = True
24+
config.JobType.scriptExe = "run.sh"
25+
config.JobType.disableAutomaticOutputCollection = True
26+
config.JobType.outputFiles = ["run.log"]
27+
config.JobType.inputFiles = ["FrameworkJobReport.xml", "minbias.root"]
28+
29+
config.Site.storageSite = "T2_CH_CERN"
30+
31+
if "CRAB_SCHEDD_NAME" in os.environ and os.environ["CRAB_SCHEDD_NAME"] != "":
32+
config.Debug.scheddName = os.environ["CRAB_SCHEDD_NAME"]
33+
if "CRAB_COLLECTOR" in os.environ and os.environ["CRAB_COLLECTOR"] != "":
34+
config.Debug.collector = os.environ["CRAB_COLLECTOR"]
35+
36+
config.Debug.extraJDL = ['+REQUIRED_OS="rhel%s"' % osMajorVer]
37+
if "amd64" == archs[1]:
38+
config.Debug.extraJDL.append(
39+
'+DESIRED_Archs="%s"' % "X86_64" if ("amd64" == archs[1]) else archs[1]
40+
)
41+
if "SINGULARITY_IMAGE" in os.environ and os.environ["SINGULARITY_IMAGE"] != "":
42+
config.Debug.extraJDL.append('+SingularityImage="%s"' % os.environ["SINGULARITY_IMAGE"])
43+
if "CRAB_SITE" in os.environ and os.environ["CRAB_SITE"] != "":
44+
config.Debug.extraJDL.append('+DESIRED_Sites="%s"' % os.environ["CRAB_SITE"])

crab/ib-run-crab.sh

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,16 @@ report() {
99
fi
1010
}
1111

12+
thisdir=$(dirname $0)
13+
[ "${CRABCLIENT_TYPE}" != "" ] || export CRABCLIENT_TYPE="prod"
14+
[ "${BUILD_ID}" != "" ] || export BUILD_ID=$(date +%s)
15+
[ "${WORKSPACE}" != "" ] || export WORKSPACE=$(pwd)
16+
[ "${CRABCONFIGINSTANCE}" != "" ]|| export CRABCONFIGINSTANCE="prod"
17+
[ "${JOB_DIR}" != "" ] || JOB_DIR="."
18+
1219
#Checkout a package
1320
git cms-addpkg FWCore/Version
21+
[ -x ${thisdir}/${JOB_DIR}/setup.sh ] && ${thisdir}/${JOB_DIR}/setup.sh
1422
#Added test python module and script to make sure it is part of card sandbox
1523
mkdir -p ${CMSSW_BASE}/src/FWCore/Version/python ${CMSSW_BASE}/src/FWCore/Version/scripts
1624
echo 'CMSBOT_CRAB_TEST="OK"' > ${CMSSW_BASE}/src/FWCore/Version/python/cmsbot_crab_test.py
@@ -23,11 +31,6 @@ if [ -d ${CMSSW_BASE}/biglib/${SCRAM_ARCH} ] ; then
2331
[ -e $l ] || rm -f $l
2432
done
2533
fi
26-
[ "${CRABCLIENT_TYPE}" != "" ] || export CRABCLIENT_TYPE="prod"
27-
[ "${BUILD_ID}" != "" ] || export BUILD_ID=$(date +%s)
28-
[ "${WORKSPACE}" != "" ] || export WORKSPACE=$(pwd) && cd $WORKSPACE
29-
[ "${CRABCONFIGINSTANCE}" != "" ]|| export CRABCONFIGINSTANCE="prod"
30-
[ "${JOB_DIR}" != "" ] || JOB_DIR="."
3134

3235
if [ "${SINGULARITY_IMAGE}" = "" ] ; then
3336
osver=$(echo ${SCRAM_ARCH} | tr '_' '\n' | head -1 | sed 's|^[a-z][a-z]*||')
@@ -41,20 +44,26 @@ fi
4144

4245
export CRAB_REQUEST="Jenkins_${CMSSW_VERSION}_${SCRAM_ARCH}_${BUILD_ID}"
4346
cmssw_queue=$(echo ${CMSSW_VERSION} | cut -d_ -f1-3)_X
44-
thisdir=$(dirname $0)
45-
cp ${thisdir}/${JOB_DIR}/run.sh .
47+
cd $WORKSPACE
48+
for f in run.sh task.py pset.py ; do
49+
if [ -e ${thisdir}/${JOB_DIR}/$f ] ; then
50+
cp ${thisdir}/${JOB_DIR}/$f .
51+
else
52+
cp ${thisdir}/$f .
53+
fi
54+
done
4655
if [ -e ${thisdir}/${cmssw_queue}/pset.py ] ; then
56+
rm -f pset.py
4757
cp ${thisdir}/${cmssw_queue}/pset.py .
48-
else
49-
cp ${thisdir}/${JOB_DIR}/pset.py .
5058
fi
5159
if [ "${X509_USER_PROXY}" = "" ] ; then
5260
voms-proxy-init -voms cms
5361
export X509_USER_PROXY=$(voms-proxy-info -path)
5462
fi
5563
pyver=$(${CMSBOT_PYTHON_CMD} -c 'import sys;print("python%s%s" % (sys.version_info[0],sys.version_info[1]))')
5664
if [ -e ${thisdir}/${pyver} ] ; then export PYTHONPATH="${thisdir}/${pyver}:${PYTHONPATH}"; fi
57-
crab submit --proxy ${X509_USER_PROXY} -c ${thisdir}/${JOB_DIR}/task.py
65+
ls
66+
crab submit --proxy ${X509_USER_PROXY} -c ./task.py
5867
rm -rf ${WORKSPACE}/crab
5968
mv crab_${CRAB_REQUEST} ${WORKSPACE}/crab
6069
echo "INPROGRESS" > $WORKSPACE/crab/statusfile

crab/multiarch/setup.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
scram build enable-multi-targets

crab/run.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#!/bin/bash -ex
2-
pwd
3-
ls
42
env > run.log
53
ld.so --help | grep supported | grep x86-64-v
64
which cmsRun
7-
cmsRun --help
8-
cmsRun -j FrameworkJobReport.xml PSet.py
5+
cmsRun -j FrameworkJobReport.xml PSet.py >>run.log 2>&1

crab/scram-build/run.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ pushd $CMSSW_BASE
66
scram build enable-multi-targets
77
rm -rf src
88
mkdir src
9-
git clone https://github.com/cms-sw/cmssw-config
10-
cd cmssw-config; git checkout V09-06-02 ; cd ..
11-
rm -rf config/SCRAM; mv cmssw-config/SCRAM config/SCRAM
129
git cms-addpkg '*' > $log
1310
scram b -v -k -j $(nproc) >$log 2>&1 || true
1411
eval `scram run -sh`
@@ -17,5 +14,4 @@ pushd $CMSSW_BASE
1714
which cmsRun
1815
cmsRun --help >>$log || true
1916
popd
20-
[ -f $log ] || mv $CMSSW_BASE/$log $log
21-
cmsRun -j FrameworkJobReport.xml PSet.py || true
17+
cmsRun -j FrameworkJobReport.xml PSet.py >run.log 2>&1 || true

crab/scram-build/task.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
config.JobType.numCores = 8
2323
config.JobType.allowUndistributedCMSSW = True
2424
config.JobType.scriptExe = "run.sh"
25+
config.JobType.disableAutomaticOutputCollection = True
2526
config.JobType.outputFiles = ["run.log"]
2627

2728
config.Site.storageSite = "T2_CH_CERN"

0 commit comments

Comments
 (0)