forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfull_system_test.sh
More file actions
executable file
·202 lines (176 loc) · 8.81 KB
/
Copy pathfull_system_test.sh
File metadata and controls
executable file
·202 lines (176 loc) · 8.81 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
#!/bin/bash
#
# A workflow performing a full system test:
# - simulation of digits
# - creation of raw data
# - reconstruction of raw data
#
# Note that this might require a production server to run.
#
# This script can use additional binary objects which can be optionally provided:
# - matbud.root + ITSdictionary.bin
#
# authors: D. Rohr / S. Wenzel
if [ "0$O2_ROOT" == "0" ] || [ "0$AEGIS_ROOT" == "0" ]; then
echo Missing O2sim environment
exit 1
fi
# include jobutils, which notably brings
# --> the taskwrapper as a simple control and monitoring tool
# (look inside the jobutils.sh file for documentation)
# --> utilities to query CPU count
. ${O2_ROOT}/share/scripts/jobutils.sh
# make sure that correct format will be used irrespecive of the locale
export LC_NUMERIC=C
export LC_ALL=C
NEvents=${NEvents:-10} #550 for full TF (the number of PbPb events)
NEventsQED=${NEventsQED:-1000} #35000 for full TF
NCPUS=$(getNumberOfPhysicalCPUCores)
echo "Found ${NCPUS} physical CPU cores"
NJOBS=${NJOBS:-"${NCPUS}"}
SHMSIZE=${SHMSIZE:-8000000000} # Size of shared memory for messages (use 128 GB for 550 event full TF)
TPCTRACKERSCRATCHMEMORY=${SHMSIZE:-4000000000} # Size of memory allocated by TPC tracker. (Use 24 GB for 550 event full TF)
ENABLE_GPU_TEST=${ENABLE_GPU_TEST:-0} # Run the full system test also on the GPU
GPUMEMSIZE=${GPUMEMSIZE:-6000000000} # Size of GPU memory to use in case ENABBLE_GPU_TEST=1
NTIMEFRAMES=${NTIMEFRAMES:-1} # Number of time frames to process
TFDELAY=${TFDELAY:-100} # Delay in seconds between publishing time frames
NOMCLABELS="--disable-mc"
O2SIMSEED=${O2SIMSEED:--1}
SPLITTRDDIGI=${SPLITTRDDIGI:-1}
NHBPERTF=${NHBPERTF:-128}
RUNFIRSTORBIT=${RUNFIRSTORBIT:-0}
FIRSTSAMPLEDORBIT=${FIRSTSAMPLEDORBIT:-0}
FST_GENERATOR=${FST_GENERATOR:-pythia8hi}
FST_MC_ENGINE=${FST_MC_ENGINE:-TGeant4}
[ "$FIRSTSAMPLEDORBIT" -lt "$RUNFIRSTORBIT" ] && FIRSTSAMPLEDORBIT=$RUNFIRSTORBIT
# allow skipping
JOBUTILS_SKIPDONE=ON
# enable memory monitoring (independent on whether DPL or not)
JOBUTILS_MONITORMEM=ON
# CPU monitoring JOBUTILS_MONITORCPU=ON
# prepare some metrics file for the monitoring system
METRICFILE=metrics.dat
CONFIG="full_system_test_N${NEvents}"
HOST=`hostname`
# include header information such as tested alidist tag and O2 tag
TAG="conf=${CONFIG},host=${HOST}${ALIDISTCOMMIT:+,alidist=$ALIDISTCOMMIT}${O2COMMIT:+,o2=$O2COMMIT}"
echo "versions,${TAG} alidist=\"${ALIDISTCOMMIT}\",O2=\"${O2COMMIT}\" " > ${METRICFILE}
GLOBALDPLOPT="-b" # --monitoring-backend no-op:// is currently removed due to https://alice.its.cern.ch/jira/browse/O2-1887
HBFUTILPARAMS="HBFUtils.nHBFPerTF=${NHBPERTF};HBFUtils.orbitFirst=${RUNFIRSTORBIT};HBFUtils.orbitFirstSampled=${FIRSTSAMPLEDORBIT}"
[ "0$ALLOW_MULTIPLE_TF" != "01" ] && HBFUTILPARAMS+=";HBFUtils.maxNOrbits=${NHBPERTF};"
ulimit -n 4096 # Make sure we can open sufficiently many files
[ $? == 0 ] || (echo Failed setting ulimit && exit 1)
mkdir -p qed
cd qed
PbPbXSec="8."
taskwrapper qedsim.log o2-sim --seed $O2SIMSEED -j $NJOBS -n $NEventsQED -m PIPE ITS MFT FT0 FV0 FDD -g extgen -e ${FST_MC_ENGINE} --configKeyValues '"GeneratorExternal.fileName=$O2_ROOT/share/Generators/external/QEDLoader.C;QEDGenParam.yMin=-7;QEDGenParam.yMax=7;QEDGenParam.ptMin=0.001;QEDGenParam.ptMax=1.;Diamond.width[2]=6."'
QED2HAD=$(awk "BEGIN {printf \"%.2f\",`grep xSectionQED qedgenparam.ini | cut -d'=' -f 2`/$PbPbXSec}")
echo "Obtained ratio of QED to hadronic x-sections = $QED2HAD" >> qedsim.log
cd ..
DIGITRDOPTREAL="--configKeyValues \"${HBFUTILPARAMS};TRDSimParams.digithreads=${NJOBS}\" "
if [ $SPLITTRDDIGI == "1" ]; then
DIGITRDOPT="--configKeyValues \"${HBFUTILPARAMS}\" --skipDet TRD"
else
DIGITRDOPT=$DIGITRDOPTREAL
fi
taskwrapper sim.log o2-sim --seed $O2SIMSEED -n $NEvents --configKeyValues "Diamond.width[2]=6." -g ${FST_GENERATOR} -e ${FST_MC_ENGINE} -j $NJOBS
taskwrapper digi.log o2-sim-digitizer-workflow -n $NEvents --simPrefixQED qed/o2sim --qed-x-section-ratio ${QED2HAD} ${NOMCLABELS} --tpc-lanes $((NJOBS < 36 ? NJOBS : 36)) --shm-segment-size $SHMSIZE ${GLOBALDPLOPT} ${DIGITRDOPT}
[ $SPLITTRDDIGI == "1" ] && taskwrapper digiTRD.log o2-sim-digitizer-workflow -n $NEvents ${NOMCLABELS} --onlyDet TRD --shm-segment-size $SHMSIZE ${GLOBALDPLOPT} --incontext collisioncontext.root ${DIGITRDOPTREAL}
touch digiTRD.log_done
if [ "0$GENERATE_ITSMFT_DICTIONARIES" == "01" ]; then
taskwrapper itsmftdict1.log o2-its-reco-workflow --trackerCA --disable-mc --configKeyValues '"fastMultConfig.cutMultClusLow=30000;fastMultConfig.cutMultClusHigh=2000000;fastMultConfig.cutMultVtxHigh=500"'
cp ~/alice/O2/Detectors/ITSMFT/ITS/macros/test/CreateDictionaries.C .
taskwrapper itsmftdict2.log root -b -q CreateDictionaries.C++
rm -f CreateDictionaries_C* CreateDictionaries.C
taskwrapper itsmftdict3.log o2-mft-reco-workflow --disable-mc
cp ~/alice/O2/Detectors/ITSMFT/MFT/macros/test/CreateDictionaries.C .
taskwrapper itsmftdict4.log root -b -q CreateDictionaries.C++
rm -f CreateDictionaries_C* CreateDictionaries.C
fi
mkdir -p raw
taskwrapper itsraw.log o2-its-digi2raw --file-for cru -o raw/ITS
taskwrapper mftraw.log o2-mft-digi2raw --file-for link -o raw/MFT
taskwrapper ft0raw.log o2-ft0-digi2raw --file-for link -o raw/FT0
taskwrapper fv0raw.log o2-fv0-digi2raw --file-for link -o raw/FV0
taskwrapper fddraw.log o2-fdd-digit2raw --file-for link -o raw/FDD
taskwrapper tpcraw.log o2-tpc-digits-to-rawzs --file-for cru -i tpcdigits.root -o raw/TPC
taskwrapper tofraw.log o2-tof-reco-workflow ${GLOBALDPLOPT} --tof-raw-file-for link --output-type raw --tof-raw-outdir raw/TOF
taskwrapper midraw.log o2-mid-digits-to-raw-workflow ${GLOBALDPLOPT} --mid-raw-outdir raw/MID --mid-raw-perlink
taskwrapper mchraw.log o2-mch-digits-to-raw --input-file mchdigits.root --output-dir raw/MCH --file-for link
taskwrapper emcraw.log o2-emcal-rawcreator --file-for link -o raw/EMC
taskwrapper phsraw.log o2-phos-digi2raw --file-for link -o raw/PHS
taskwrapper cpvraw.log o2-cpv-digi2raw --file-for link -o raw/CPV
taskwrapper zdcraw.log o2-zdc-digi2raw --file-for link -o raw/ZDC
taskwrapper hmpraw.log o2-hmpid-digits-to-raw-workflow --file-for link --outdir raw/HMP
taskwrapper trdraw.log o2-trd-trap2raw -o raw/TRD --fileper halfcru
cat raw/*/*.cfg > rawAll.cfg
if [ "0$DISABLE_PROCESSING" == "01" ]; then
echo "Skipping the processing part of the full system test"
exit 0
fi
# We run the workflow in both CPU-only and With-GPU mode
STAGES="NOGPU"
if [ $ENABLE_GPU_TEST != "0" ]; then
STAGES+=" WITHGPU"
fi
STAGES+=" ASYNC"
# give a possibility to run the FST with external existing dictionary (i.e. with CREATECTFDICT=0 full_system_test.sh)
[ ! -z "$CREATECTFDICT" ] && SYNCMODEDOCTFDICT="$CREATECTFDICT" || SYNCMODEDOCTFDICT=1
for STAGE in $STAGES; do
logfile=reco_${STAGE}.log
ARGS_ALL="--session default"
DICTCREATION=""
if [[ "$STAGE" = "WITHGPU" ]]; then
export CREATECTFDICT=0
export GPUTYPE=CUDA
export HOSTMEMSIZE=1000000000
export SYNCMODE=1
export CTFINPUT=0
export SAVECTF=0
elif [[ "$STAGE" = "ASYNC" ]]; then
export CREATECTFDICT=0
export GPUTYPE=CPU
export SYNCMODE=0
export HOSTMEMSIZE=$TPCTRACKERSCRATCHMEMORY
export CTFINPUT=1
export SAVECTF=0
else
export CREATECTFDICT=$SYNCMODEDOCTFDICT
export GPUTYPE=CPU
export SYNCMODE=1
export HOSTMEMSIZE=$TPCTRACKERSCRATCHMEMORY
export CTFINPUT=0
export SAVECTF=1
unset JOBUTILS_JOB_SKIPCREATEDONE
fi
export SHMSIZE
export NTIMEFRAMES
export TFDELAY
export GLOBALDPLOPT
export GPUMEMSIZE
taskwrapper ${logfile} "$O2_ROOT/prodtests/full-system-test/dpl-workflow.sh"
# --- record interesting metrics to monitor ----
# boolean flag indicating if workflow completed successfully at all
RC=$?
SUCCESS=0
[ -f "${logfile}_done" ] && [ "$RC" = 0 ] && SUCCESS=1
echo "success_${STAGE},${TAG} value=${SUCCESS}" >> ${METRICFILE}
if [ "${SUCCESS}" = "1" ]; then
# runtime
walltime=`grep "#walltime" ${logfile}_time | awk '//{print $2}'`
echo "walltime_${STAGE},${TAG} value=${walltime}" >> ${METRICFILE}
# GPU reconstruction (also in CPU version) processing time
gpurecotime=`grep "gpu-reconstruction" reco_NOGPU.log | grep -e "Total Wall Time:" | awk '//{printf "%f", $6/1000000}'`
echo "gpurecotime_${STAGE},${TAG} value=${gpurecotime}" >> ${METRICFILE}
# memory
maxmem=`awk '/PROCESS MAX MEM/{print $5}' ${logfile}` # in MB
avgmem=`awk '/PROCESS AVG MEM/{print $5}' ${logfile}` # in MB
echo "maxmem_${STAGE},${TAG} value=${maxmem}" >> ${METRICFILE}
echo "avgmem_${STAGE},${TAG} value=${avgmem}" >> ${METRICFILE}
# some physics quantities
tpctracks=`grep "gpu-reconstruction" ${logfile} | grep -e "found.*track" | awk '//{print $4}'`
echo "tpctracks_${STAGE},${TAG} value=${tpctracks}" >> ${METRICFILE}
tpcclusters=`grep -e "Event has.*TPC Clusters" ${logfile} | awk '//{print $5}'`
echo "tpcclusters_${STAGE},${TAG} value=${tpcclusters}" >> ${METRICFILE}
fi
done