Skip to content

Commit e62bcf9

Browse files
committed
Refactor of TPC clusterization configuration
* beautification of configuration * coupling to task-finalizer to be able to inject config-keys from outside * make sensitive to GPU_proc_nn for the ML clusterization keys
1 parent 8ca8e84 commit e62bcf9

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

MC/bin/o2dpg_sim_workflow.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1253,7 +1253,22 @@ def getDigiTaskName(det):
12531253
tpcclustertasks.append(taskname)
12541254
tpcclussect = createTask(name=taskname, needs=tpcclusterneed, tf=tf, cwd=timeframeworkdir, lab=["RECO"], cpu='2', mem='8000')
12551255
digitmergerstr = '${O2_ROOT}/bin/o2-tpc-chunkeddigit-merger --tpc-sectors ' + str(s)+'-'+str(s+sectorpertask-1) + ' --tpc-lanes ' + str(NWORKERS_TF) + ' | '
1256-
tpcclussect['cmd'] = (digitmergerstr,'')[args.no_tpc_digitchunking] + ' ${O2_ROOT}/bin/o2-tpc-reco-workflow ' + getDPL_global_options(bigshm=True) + ' --input-type ' + ('digitizer','digits')[args.no_tpc_digitchunking] + ' --output-type clusters,send-clusters-per-sector --tpc-native-cluster-writer \" --outfile tpc-native-clusters-part'+ str((int)(s/sectorpertask)) + '.root\" --tpc-sectors ' + str(s)+'-'+str(s+sectorpertask-1) + ' ' + putConfigValues(["GPU_global"], {"GPU_proc.ompThreads" : 4}) + ('',' --disable-mc')[args.no_mc_labels]
1256+
tpcclussect['cmd'] = (digitmergerstr,'')[args.no_tpc_digitchunking] + task_finalizer(
1257+
[
1258+
'${O2_ROOT}/bin/o2-tpc-reco-workflow',
1259+
getDPL_global_options(bigshm=True),
1260+
'--input-type ' + ('digitizer','digits')[args.no_tpc_digitchunking],
1261+
'--output-type clusters,send-clusters-per-sector',
1262+
f'--tpc-native-cluster-writer \" --outfile tpc-native-clusters-part{(int)(s/sectorpertask)}.root\"',
1263+
f'--tpc-sectors {s}-{s+sectorpertask-1}',
1264+
putConfigValues(["GPU_global",
1265+
"GPU_proc_nn",
1266+
"TPCCorrMap",
1267+
"TPCGasParam"], {"GPU_proc.ompThreads" : 4}),
1268+
'--disable-mc' if args.no_mc_labels else None
1269+
], configname="tpcclusterizertask"
1270+
)
1271+
12571272
tpcclussect['env'] = { "OMP_NUM_THREADS" : "4" , "TBB_NUM_THREADS" : "4" }
12581273
tpcclussect['semaphore'] = "tpctriggers.root"
12591274
tpcclussect['retry_count'] = 2 # the task has a race condition --> makes sense to retry
@@ -1264,6 +1279,7 @@ def getDigiTaskName(det):
12641279
workflow['stages'].append(TPCCLUSMERGEtask)
12651280
tpcreconeeds.append(TPCCLUSMERGEtask['name'])
12661281
else:
1282+
# TODO: adapt this to the case above and merge code / avoid code duplication
12671283
tpcclus = createTask(name='tpccluster_' + str(tf), needs=tpcclusterneed, tf=tf, cwd=timeframeworkdir, lab=["RECO"], cpu=NWORKERS_TF, mem='2000')
12681284
tpcclus['cmd'] = '${O2_ROOT}/bin/o2-tpc-chunkeddigit-merger --tpc-lanes ' + str(NWORKERS_TF)
12691285
tpcclus['cmd'] += ' | ${O2_ROOT}/bin/o2-tpc-reco-workflow ' + getDPL_global_options() + ' --input-type digitizer --output-type clusters,send-clusters-per-sector ' + putConfigValues(["GPU_global","TPCGasParam","TPCCorrMap"],{"GPU_proc.ompThreads" : 1}) + ('',' --disable-mc')[args.no_mc_labels]

0 commit comments

Comments
 (0)