From 68db82ab706c0cbc5951e3be3eb4346812e32240 Mon Sep 17 00:00:00 2001 From: Sandro Wenzel Date: Mon, 9 Nov 2026 16:51:38 +0100 Subject: [PATCH] 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 --- MC/bin/o2dpg_sim_workflow.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MC/bin/o2dpg_sim_workflow.py b/MC/bin/o2dpg_sim_workflow.py index 470e538f7..c3e598312 100755 --- a/MC/bin/o2dpg_sim_workflow.py +++ b/MC/bin/o2dpg_sim_workflow.py @@ -1160,6 +1160,8 @@ def putConfigValues(listOfMainKeys=[], localCF = {}, globalTFConfig = True): tpcLocalCF['TPCCorrMap.lumiInst'] = str(CTPSCALER * lumiInstFactor) tpcdigimem = 12000 if havePbPb else 9000 + # the scaled distortions are computed once per job and shared through a file by all digitizers + tpcDistortionFile = tpcDistortionType == 2 and option_if_available('o2-sim-digitizer-workflow', '--tpc-distortion-file') != '' TPCDigitask=createTask(name='tpcdigi_'+str(tf), needs=tpcdigineeds, tf=tf, cwd=timeframeworkdir, lab=["DIGI"], cpu=NWORKERS_TF, mem=str(tpcdigimem)) TPCDigitask['cmd'] = ('','ln -nfs ../bkg_HitsTPC.root . ;')[doembedding] @@ -1169,9 +1171,12 @@ def putConfigValues(listOfMainKeys=[], localCF = {}, globalTFConfig = True): + ' --onlyDet TPC --TPCuseCCDB --interactionRate ' + str(INTRATE) + ' --tpc-lanes ' + str(NWORKERS_TF) \ + ' --incontext ' + str(CONTEXTFILE) + ' --disable-write-ini --early-forward-policy always --forceSelectedDets ' \ + ' --tpc-distortion-type ' + str(tpcDistortionType) \ - + ' --n-threads-distortions 1 ' \ + + ' --n-threads-distortions ' + (str(NWORKERS_TF) if tpcDistortionFile else '1') + ' ' \ + putConfigValues(["TPCGasParam","TPCGEMParam","TPCEleParam","TPCITCorr","TPCDetParam"], localCF=tpcLocalCF) + if tpcDistortionFile: + # only one lane computes the distortions while the others wait, so it gets all threads + TPCDigitask['cmd'] += ' --tpc-distortion-file ../tpc_scaled_distortions.root' TPCDigitask['cmd'] += (' --tpc-chunked-writer','')[args.no_tpc_digitchunking] TPCDigitask['cmd'] += ('',' --disable-mc')[args.no_mc_labels] # we add any other extra command line options (power user customization) with an environment variable