-
Notifications
You must be signed in to change notification settings - Fork 26
/
SubmitFileGSD.sh
executable file
·56 lines (50 loc) · 1.33 KB
/
SubmitFileGSD.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
export XRD_NETWORKSTACK=IPv4
## External vars
clusterid=${1}
procid=${2}
curDir=${3}
outDir=${4}
cfgFileGSD=${5}
cfgFileRECO=${6}
cfgFileNTUP=${7}
localFlag=${8}
CMSSWVER=${9} # CMSSW_8_1_0_pre7
CMSSWDIR=${10} # ${curDir}/../${CMSSWVER}
CMSSWARCH=${11} # slc6_amd64_gcc530
eosArea=${12}
dataTier=${13}
keepDQMfile=${14}
##Create Work Area
export SCRAM_ARCH=${CMSSWARCH}
source /afs/cern.ch/cms/cmsset_default.sh
eval `scramv1 project CMSSW ${CMSSWVER}`
cd ${CMSSWVER}/
rm -rf ./*
cp -r -d ${CMSSWDIR}/* ./
cd src
eval `scramv1 runtime -sh`
edmPluginRefresh -p ../lib/$SCRAM_ARCH
## Execute job and retrieve the outputs
echo "Job running on `hostname` at `date`"
cmsRun ${curDir}/${outDir}/cfg/${cfgFileGSD}
if [ $dataTier = "ALL" ]; then
cmsRun ${curDir}/${outDir}/cfg/${cfgFileRECO}
cmsRun ${curDir}/${outDir}/cfg/${cfgFileNTUP}
dataTier="NTUP"
fi
# copy to outDir in curDir or at given EOS area
if [ ${localFlag} == "True" ]
then
cp *${dataTier}*.root ${curDir}/${outDir}/${dataTier}/
if [ ${keepDQMfile} == "True" ]
then
cp *DQM*.root ${curDir}/${outDir}/DQM/
fi
else
xrdcp -N -v *${dataTier}*.root root://eoscms.cern.ch/${eosArea}/${outDir}/${dataTier}/
if [ ${keepDQMfile} == "True" ]
then
xrdcp -N -v *DQM*.root root://eoscms.cern.ch/${eosArea}/${outDir}/DQM/
fi
fi