Skip to content

Commit c66d6a0

Browse files
committed
Move multiplicity settings to O2DPG
1 parent cc80ffa commit c66d6a0

1 file changed

Lines changed: 80 additions & 0 deletions

File tree

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#!/bin/bash
2+
3+
if [[ -z $SOURCE_GUARD_MULTIPLICITIES ]]; then
4+
SOURCE_GUARD_MULTIPLICITIES=1
5+
6+
# ---------------------------------------------------------------------------------------------------------------------
7+
# Threads
8+
9+
[[ -z $NITSDECTHREADS ]] && NITSDECTHREADS=2
10+
[[ -z $NMFTDECTHREADS ]] && NMFTDECTHREADS=2
11+
12+
[[ -z $SVERTEX_THREADS ]] && SVERTEX_THREADS=$(( $SYNCMODE == 1 ? 1 : 2 ))
13+
# FIXME: multithreading in the itsmft reconstruction does not work on macOS.
14+
if [[ $(uname) == "Darwin" ]]; then
15+
NITSDECTHREADS=1
16+
NMFTDECTHREADS=1
17+
fi
18+
19+
[[ $SYNCMODE == 1 ]] && NTRDTRKTHREADS=1
20+
21+
# ---------------------------------------------------------------------------------------------------------------------
22+
# Process multiplicities
23+
24+
N_F_REST=$MULTIPLICITY_FACTOR_REST
25+
N_F_RAW=$MULTIPLICITY_FACTOR_RAWDECODERS
26+
N_F_CTF=$MULTIPLICITY_FACTOR_CTFENCODERS
27+
28+
N_TPCTRK=$NGPUS
29+
if [[ $OPTIMIZED_PARALLEL_ASYNC != 0 ]]; then
30+
# Tuned multiplicities for async Pb-Pb processing
31+
if [[ $SYNCMODE == "1" ]]; then echo "Must not use OPTIMIZED_PARALLEL_ASYNC with GPU or SYNCMODE" 1>&2; exit 1; fi
32+
if [[ $NUMAGPUIDS != 0 ]]; then N_NUMAFACTOR=1; else N_NUMAFACTOR=2; fi
33+
GPU_CONFIG_KEY+="GPU_proc.ompThreads=6;"
34+
TRD_CONFIG_KEY+="GPU_proc.ompThreads=2;"
35+
if [[ $GPUTYPE == "CPU" ]]; then
36+
N_TPCENTDEC=$((2 * $N_NUMAFACTOR))
37+
N_MFTTRK=$((3 * $N_NUMAFACTOR))
38+
N_ITSTRK=$((3 * $N_NUMAFACTOR))
39+
N_TPCITS=$((2 * $N_NUMAFACTOR))
40+
N_MCHTRK=$((1 * $N_NUMAFACTOR))
41+
N_TOFMATCH=$((9 * $N_NUMAFACTOR))
42+
N_TPCTRK=$((6 * $N_NUMAFACTOR))
43+
else
44+
N_TPCENTDEC=$(math_max $((3 * $NGPUS * $OPTIMIZED_PARALLEL_ASYNC * $N_NUMAFACTOR / 4)) 1)
45+
N_MFTTRK=$(math_max $((6 * $NGPUS * $OPTIMIZED_PARALLEL_ASYNC * $N_NUMAFACTOR / 4)) 1)
46+
N_ITSTRK=$(math_max $((6 * $NGPUS * $OPTIMIZED_PARALLEL_ASYNC * $N_NUMAFACTOR / 4)) 1)
47+
N_TPCITS=$(math_max $((4 * $NGPUS * $OPTIMIZED_PARALLEL_ASYNC * $N_NUMAFACTOR / 4)) 1)
48+
N_MCHTRK=$(math_max $((2 * $NGPUS * $OPTIMIZED_PARALLEL_ASYNC * $N_NUMAFACTOR / 4)) 1)
49+
N_TOFMATCH=$(math_max $((20 * $NGPUS * $OPTIMIZED_PARALLEL_ASYNC * $N_NUMAFACTOR / 4)) 1)
50+
fi
51+
elif [[ $EPNPIPELINES != 0 ]]; then
52+
# Tuned multiplicities for sync Pb-Pb processing
53+
N_TPCENT=$(math_max $((3 * $EPNPIPELINES * $NGPUS / 4)) 1)
54+
N_TPCITS=$(math_max $((3 * $EPNPIPELINES * $NGPUS / 4)) 1)
55+
if [[ $BEAMTYPE == "pp" ]]; then
56+
N_ITSTRK=$(math_max $((6 * $EPNPIPELINES * $NGPUS / 4)) 1)
57+
else
58+
N_ITSTRK=$(math_max $((2 * $EPNPIPELINES * $NGPUS / 4)) 1)
59+
fi
60+
N_ITSRAWDEC=$(math_max $((3 * $EPNPIPELINES * $NGPUS / 4)) 1)
61+
N_EMCREC=$(math_max $((3 * $EPNPIPELINES * $NGPUS / 4)) 1)
62+
N_TRDENT=$(math_max $((3 * $EPNPIPELINES * $NGPUS / 4)) 1)
63+
N_TRDTRK=$(math_max $((3 * $EPNPIPELINES * $NGPUS / 4)) 1)
64+
N_TPCRAWDEC=$(math_max $((12 * $EPNPIPELINES * $NGPUS / 4)) 1)
65+
if [[ $GPUTYPE == "CPU" ]]; then
66+
N_TPCTRK=8
67+
GPU_CONFIG_KEY+="GPU_proc.ompThreads=4;"
68+
fi
69+
# Scale some multiplicities with the number of nodes
70+
RECO_NUM_NODES_WORKFLOW_CMP=$((($RECO_NUM_NODES_WORKFLOW > 15 ? $RECO_NUM_NODES_WORKFLOW : 15) * ($NUMAGPUIDS != 0 ? 2 : 1))) # Limit the lower scaling factor, multiply by 2 if we have 2 NUMA domains
71+
N_ITSRAWDEC=$(math_max $((3 * 60 / $RECO_NUM_NODES_WORKFLOW_CMP)) ${N_ITSRAWDEC:-1}) # This means, if we have 60 EPN nodes, we need at least 3 ITS RAW decoders
72+
N_MFTRAWDEC=$(math_max $((3 * 60 / $RECO_NUM_NODES_WORKFLOW_CMP)) ${N_MFTRAWDEC:-1})
73+
N_ITSTRK=$(math_max $((1 * 200 / $RECO_NUM_NODES_WORKFLOW_CMP)) ${N_ITSTRK:-1})
74+
N_MFTTRK=$(math_max $((1 * 60 / $RECO_NUM_NODES_WORKFLOW_CMP)) ${N_MFTTRK:-1})
75+
N_CTPRAWDEC=$(math_max $((1 * 30 / $RECO_NUM_NODES_WORKFLOW_CMP)) ${N_CTPRAWDEC:-1})
76+
N_TRDRAWDEC=$(math_max $((3 * 60 / $RECO_NUM_NODES_WORKFLOW_CMP)) ${N_TRDRAWDEC:-1})
77+
N_GENERICRAWDEV=
78+
fi
79+
80+
fi

0 commit comments

Comments
 (0)