Skip to content

Commit 68db82a

Browse files
sawenzelclaude
andcommitted
Share the scaled TPC distortions between the digitizers of a job
This passes a common distortion file to the TPC digitizer lanes, so that the scaled distortions are computed once per job. - Used for distortion type 2 when o2-sim-digitizer-workflow knows --tpc-distortion-file. - The file is tpc_scaled_distortions.root in the job directory. - Only one lane computes, so the lanes get NWORKERS_TF threads for the distortions. https://its.cern.ch/jira/browse/O2-7309 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 9132c20 commit 68db82a

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎MC/bin/o2dpg_sim_workflow.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,8 @@ def putConfigValues(listOfMainKeys=[], localCF = {}, globalTFConfig = True):
11601160
tpcLocalCF['TPCCorrMap.lumiInst'] = str(CTPSCALER * lumiInstFactor)
11611161

11621162
tpcdigimem = 12000 if havePbPb else 9000
1163+
# the scaled distortions are computed once per job and shared through a file by all digitizers
1164+
tpcDistortionFile = tpcDistortionType == 2 and option_if_available('o2-sim-digitizer-workflow', '--tpc-distortion-file') != ''
11631165
TPCDigitask=createTask(name='tpcdigi_'+str(tf), needs=tpcdigineeds,
11641166
tf=tf, cwd=timeframeworkdir, lab=["DIGI"], cpu=NWORKERS_TF, mem=str(tpcdigimem))
11651167
TPCDigitask['cmd'] = ('','ln -nfs ../bkg_HitsTPC.root . ;')[doembedding]
@@ -1169,9 +1171,12 @@ def putConfigValues(listOfMainKeys=[], localCF = {}, globalTFConfig = True):
11691171
+ ' --onlyDet TPC --TPCuseCCDB --interactionRate ' + str(INTRATE) + ' --tpc-lanes ' + str(NWORKERS_TF) \
11701172
+ ' --incontext ' + str(CONTEXTFILE) + ' --disable-write-ini --early-forward-policy always --forceSelectedDets ' \
11711173
+ ' --tpc-distortion-type ' + str(tpcDistortionType) \
1172-
+ ' --n-threads-distortions 1 ' \
1174+
+ ' --n-threads-distortions ' + (str(NWORKERS_TF) if tpcDistortionFile else '1') + ' ' \
11731175
+ putConfigValues(["TPCGasParam","TPCGEMParam","TPCEleParam","TPCITCorr","TPCDetParam"],
11741176
localCF=tpcLocalCF)
1177+
if tpcDistortionFile:
1178+
# only one lane computes the distortions while the others wait, so it gets all threads
1179+
TPCDigitask['cmd'] += ' --tpc-distortion-file ../tpc_scaled_distortions.root'
11751180
TPCDigitask['cmd'] += (' --tpc-chunked-writer','')[args.no_tpc_digitchunking]
11761181
TPCDigitask['cmd'] += ('',' --disable-mc')[args.no_mc_labels]
11771182
# we add any other extra command line options (power user customization) with an environment variable

0 commit comments

Comments
 (0)