Skip to content

Commit 2273127

Browse files
committed
simworkflow: option for early cleanup / disable OpenMP for TPC clusters
1 parent f2e6212 commit 2273127

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

MC/bin/o2dpg_sim_workflow.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@
5858
# arguments for background event caching
5959
parser.add_argument('--upload-bkg-to',help='where to upload background event files (alien path)')
6060
parser.add_argument('--use-bkg-from',help='take background event from given alien path')
61+
62+
# argument for early cleanup
63+
parser.add_argument('--early-tf-cleanup',action='store_true', help='whether to cleanup intermediate artefacts after each timeframe is done')
64+
6165
# power feature (for playing) --> does not appear in help message
6266
# help='Treat smaller sensors in a single digitization')
6367
parser.add_argument('--combine-smaller-digi', action='store_true', help=argparse.SUPPRESS)
@@ -441,6 +445,7 @@ def createRestDigiTask(name, det='ALLSMALLER'):
441445
tpcclussect = createTask(name=taskname, needs=[TPCDigitask['name']], tf=tf, cwd=timeframeworkdir, lab=["RECO"], cpu='1', mem='2000')
442446
tpcclussect['cmd'] = 'o2-tpc-chunkeddigit-merger --tpc-sectors ' + str(s) + ' --rate 1000 --tpc-lanes ' + str(NWORKERS)
443447
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"'
448+
tpcclussect['env'] = { "OMP_NUM_THREADS" : "1" } # we disable OpenMP since running in scalar mode anyway
444449
workflow['stages'].append(tpcclussect)
445450

446451
TPCCLUSMERGEtask=createTask(name='tpcclustermerge_'+str(tf), needs=tpcclustertasks, tf=tf, cwd=timeframeworkdir, lab=["RECO"], cpu='1')
@@ -510,6 +515,19 @@ def createRestDigiTask(name, det='ALLSMALLER'):
510515
AOD_merge_task['semaphore'] = 'aodmerge' #<---- this is making sure that only one merge is running at any time
511516
workflow['stages'].append(AOD_merge_task)
512517

518+
# cleanup
519+
# --------
520+
# On the GRID it may be important to cleanup as soon as possible because disc space
521+
# is limited (which would restrict the number of timeframes). We offer a timeframe cleanup function
522+
# taking away digits, clusters and other stuff as soon as possible.
523+
# TODO: cleanup by labels or task names
524+
if args.early_tf_cleanup == True:
525+
TFcleanup = createTask(name='tfcleanup_'+str(tf), needs= [ AOD_merge_task['name'] ], tf=tf, cwd=timeframeworkdir, lab=["CLEANUP"], mem='0', cpu='1')
526+
TFcleanup['cmd'] = 'rm *digi*.root;'
527+
TFcleanup['cmd'] += 'rm *cluster*.root'
528+
workflow['stages'].append(TFcleanup);
529+
530+
513531
def trimString(cmd):
514532
return ' '.join(cmd.split())
515533

0 commit comments

Comments
 (0)