Skip to content

Commit 6d80d44

Browse files
authored
Add benchmark for analysis (#3203)
1 parent 9ed8144 commit 6d80d44

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ add_subdirectory(Generators)
7474
add_subdirectory(Steer) # consider building this only for simulation ?
7575
add_subdirectory(prodtests)
7676
add_subdirectory(Analysis)
77+
add_subdirectory(scripts)
7778

7879
if(BUILD_EXAMPLES)
7980
add_subdirectory(Examples)

scripts/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
install(PROGRAMS analysis-benchmark.sh DESTINATION bin)

scripts/analysis-benchmark.sh

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
SHA256_ATTEMPTS="16 12 8 6 4 2 1"
3+
FILELIST=~/src/data/filelist.txt
4+
DATE=`date +%Y-%m-%d`
5+
HOST=`hostname -s`
6+
FILES=`cat $FILELIST | wc -l`
7+
FILES_SIZE=$(du -cm `cat ~/src/data/filelist.txt` | tail -n 1 | awk '{print $1}')
8+
9+
for x in $SHA256_ATTEMPTS; do
10+
T=`(time -p (cat $FILELIST | xargs -P $x -n1 -I{} sha256sum {} >&2)) 2>&1 | grep real | sed -e 's/real //'`
11+
TP=$(bc -l <<< "scale=2; $FILES_SIZE/$T")
12+
TPP=$(bc -l <<< "scale=2; $FILES_SIZE/$T/$x")
13+
echo sha256sum,$x,$T,$FILES_SIZE,$FILES,$TP,$TPP,$DATE,$HOST
14+
done
15+
16+
BENCHMARK=stage/bin/o2-analysistutorial-histograms
17+
HISTO_ATTEMPTS="16 8 4 2 1"
18+
for x in $HISTO_ATTEMPTS ; do
19+
T=`(time -p $BENCHMARK -b --aod-file @$FILELIST --pipeline eta-and-phi-histograms:1,pt-histogram:1,etaphi-histogram:1 --readers $x > log$x.txt) 2>&1 | grep real | sed -e 's/real //'`
20+
TP=$(bc -l <<< "scale=2; $FILES_SIZE/$T")
21+
TPP=$(bc -l <<< "scale=2; $FILES_SIZE/$T/$x")
22+
echo "histo (readers),$x,$T,$FILES_SIZE,$FILES,$TP,$TPP,$DATE,$HOST"
23+
echo "histo (total),$(($x + 4 )),$T,$FILES_SIZE,$FILES,$TP,$TPP,$DATE,$HOST"
24+
done
25+
26+
BENCHMARK=stage/bin/o2-analysistutorial-histograms
27+
HISTO_ATTEMPTS="16 8 4 2 1"
28+
for x in $HISTO_ATTEMPTS ; do
29+
T=`(time -p $BENCHMARK -b --aod-file @$FILELIST --pipeline eta-and-phi-histograms:2,pt-histogram:2,etaphi-histogram:2 --readers $x > log$x.txt) 2>&1 | grep real | sed -e 's/real //'`
30+
TP=$(bc -l <<< "scale=2; $FILES_SIZE/$T")
31+
TPP=$(bc -l <<< "scale=2; $FILES_SIZE/$T/$x")
32+
echo "histo with 2 jobs (readers),$x,$T,$FILES_SIZE,$FILES,$TP,$TPP,$DATE,$HOST"
33+
echo "histo with 2 jobs (total),$(($x + 7 )),$T,$FILES_SIZE,$FILES,$TP,$TPP,$DATE,$HOST"
34+
done
35+
36+
BENCHMARK=stage/bin/o2-analysis-vertexing-hf
37+
HISTO_ATTEMPTS="8 4 2 1"
38+
for x in $HISTO_ATTEMPTS ; do
39+
echo $BENCHMARK -b --aod-file @$FILELIST --pipeline vertexerhf-candidatebuildingDzero:2,vertexerhf-decayvertexbuilder2prong:2 --readers $x > log$x.txt >&2
40+
TP=$(bc -l <<< "scale=2; $FILES_SIZE/$T")
41+
TPP=$(bc -l <<< "scale=2; $FILES_SIZE/$T/$x")
42+
T=`(time -p $BENCHMARK --aod-file @$FILELIST -q --pipeline vertexerhf-candidatebuildingDzero:2,vertexerhf-decayvertexbuilder2prong:2 --readers $x > log$x.txt) 2>&1 | grep real | sed -e 's/real //'`
43+
echo "o2-analysis-vertexing-hf with 2 jobs (readers),$x,$T,$FILES_SIZE,$FILES,$TP,$TPP,$DATE,$HOST"
44+
echo "o2-analysis-vertexing-hf (total),$(($x + 6)),$T,$FILES_SIZE,$FILES,$TP,$TPP,$DATE,$HOST"
45+
done

0 commit comments

Comments
 (0)