Skip to content

Commit 3a07564

Browse files
committed
sim-workflow: Option to use single TPC clusterization task
In small productions, its not necessary or counterproductive to split TPC clusterization by sector.
1 parent 89ed368 commit 3a07564

File tree

1 file changed

+26
-17
lines changed

1 file changed

+26
-17
lines changed

MC/bin/o2dpg_sim_workflow.py

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
# power feature (for playing) --> does not appear in help message
7474
# help='Treat smaller sensors in a single digitization')
7575
parser.add_argument('--combine-smaller-digi', action='store_true', help=argparse.SUPPRESS)
76+
parser.add_argument('--combine-tpc-clusterization', action='store_true', help=argparse.SUPPRESS) #<--- useful for small productions (pp, low interaction rate, small number of events)
7677

7778
args = parser.parse_args()
7879
print (args)
@@ -434,24 +435,32 @@ def createRestDigiTask(name, det='ALLSMALLER'):
434435
# -----------
435436
# reco
436437
# -----------
438+
tpcreconeeds=[]
439+
if not args.combine_tpc_clusterization:
440+
# TODO: check value for MaxTimeBin; A large value had to be set tmp in order to avoid crashes based on "exceeding timeframe limit"
441+
# We treat TPC clusterization in multiple (sector) steps in order to stay within the memory limit
442+
tpcclustertasks=[]
443+
for s in range(0,35):
444+
taskname = 'tpcclusterpart' + str(s) + '_' + str(tf)
445+
tpcclustertasks.append(taskname)
446+
tpcclussect = createTask(name=taskname, needs=[TPCDigitask['name']], tf=tf, cwd=timeframeworkdir, lab=["RECO"], cpu='1', mem='2000')
447+
tpcclussect['cmd'] = 'o2-tpc-chunkeddigit-merger --tpc-sectors ' + str(s) + ' --rate 1000 --tpc-lanes ' + str(NWORKERS)
448+
tpcclussect['cmd'] += ' | o2-tpc-reco-workflow ' + getDPL_global_options() + ' --input-type digitizer --output-type clusters,send-clusters-per-sector --outfile tpc-native-clusters-part' + str(s) + '.root --tpc-sectors ' + str(s) + ' --configKeyValues "GPU_global.continuousMaxTimeBin=100000;GPU_proc.ompThreads=1"'
449+
tpcclussect['env'] = { "OMP_NUM_THREADS" : "1" } # we disable OpenMP since running in scalar mode anyway
450+
workflow['stages'].append(tpcclussect)
451+
452+
TPCCLUSMERGEtask=createTask(name='tpcclustermerge_'+str(tf), needs=tpcclustertasks, tf=tf, cwd=timeframeworkdir, lab=["RECO"], cpu='1')
453+
TPCCLUSMERGEtask['cmd']='o2-commonutils-treemergertool -i tpc-native-clusters-part*.root -o tpc-native-clusters.root -t tpcrec' #--asfriend preferable but does not work
454+
workflow['stages'].append(TPCCLUSMERGEtask)
455+
tpcreconeeds.append(TPCCLUSMERGEtask['name'])
456+
else:
457+
tpcclus = createTask(name='tpccluster_' + str(tf), needs=[TPCDigitask['name']], tf=tf, cwd=timeframeworkdir, lab=["RECO"], cpu=NWORKERS, mem='2000')
458+
tpcclus['cmd'] = 'o2-tpc-chunkeddigit-merger --rate 1000 --tpc-lanes ' + str(NWORKERS)
459+
tpcclus['cmd'] += ' | o2-tpc-reco-workflow ' + getDPL_global_options() + ' --input-type digitizer --output-type clusters,send-clusters-per-sector --configKeyValues "GPU_global.continuousMaxTimeBin=100000;GPU_proc.ompThreads=1"'
460+
workflow['stages'].append(tpcclus)
461+
tpcreconeeds.append(tpcclus['name'])
437462

438-
# TODO: check value for MaxTimeBin; A large value had to be set tmp in order to avoid crashes based on "exceeding timeframe limit"
439-
# We treat TPC clusterization in multiple (sector) steps in order to stay within the memory limit
440-
tpcclustertasks=[]
441-
for s in range(0,35):
442-
taskname = 'tpcclusterpart' + str(s) + '_' + str(tf)
443-
tpcclustertasks.append(taskname)
444-
tpcclussect = createTask(name=taskname, needs=[TPCDigitask['name']], tf=tf, cwd=timeframeworkdir, lab=["RECO"], cpu='1', mem='2000')
445-
tpcclussect['cmd'] = 'o2-tpc-chunkeddigit-merger --tpc-sectors ' + str(s) + ' --rate 1000 --tpc-lanes ' + str(NWORKERS)
446-
tpcclussect['cmd'] += ' | o2-tpc-reco-workflow ' + getDPL_global_options() + ' --input-type digitizer --output-type clusters,send-clusters-per-sector --outfile tpc-native-clusters-part' + str(s) + '.root --tpc-sectors ' + str(s) + ' --configKeyValues "GPU_global.continuousMaxTimeBin=100000;GPU_proc.ompThreads=1"'
447-
tpcclussect['env'] = { "OMP_NUM_THREADS" : "1" } # we disable OpenMP since running in scalar mode anyway
448-
workflow['stages'].append(tpcclussect)
449-
450-
TPCCLUSMERGEtask=createTask(name='tpcclustermerge_'+str(tf), needs=tpcclustertasks, tf=tf, cwd=timeframeworkdir, lab=["RECO"], cpu='1')
451-
TPCCLUSMERGEtask['cmd']='o2-commonutils-treemergertool -i tpc-native-clusters-part*.root -o tpc-native-clusters.root -t tpcrec' #--asfriend preferable but does not work
452-
workflow['stages'].append(TPCCLUSMERGEtask)
453-
454-
TPCRECOtask=createTask(name='tpcreco_'+str(tf), needs=[TPCCLUSMERGEtask['name']], tf=tf, cwd=timeframeworkdir, lab=["RECO"], relative_cpu=3/8, mem='16000')
463+
TPCRECOtask=createTask(name='tpcreco_'+str(tf), needs=tpcreconeeds, tf=tf, cwd=timeframeworkdir, lab=["RECO"], relative_cpu=3/8, mem='16000')
455464
TPCRECOtask['cmd'] = 'o2-tpc-reco-workflow ' + getDPL_global_options(bigshm=True, nosmallrate=False) + ' --input-type clusters --output-type tracks,send-clusters-per-sector --configKeyValues "GPU_global.continuousMaxTimeBin=100000;GPU_proc.ompThreads='+str(NWORKERS)+'"'
456465
workflow['stages'].append(TPCRECOtask)
457466

0 commit comments

Comments
 (0)