Skip to content

Commit

Permalink
simworkflow: option for early cleanup / disable OpenMP for TPC clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
sawenzel committed Jun 15, 2021
1 parent f2e6212 commit 2273127
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions MC/bin/o2dpg_sim_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
# arguments for background event caching
parser.add_argument('--upload-bkg-to',help='where to upload background event files (alien path)')
parser.add_argument('--use-bkg-from',help='take background event from given alien path')

# argument for early cleanup
parser.add_argument('--early-tf-cleanup',action='store_true', help='whether to cleanup intermediate artefacts after each timeframe is done')

# power feature (for playing) --> does not appear in help message
# help='Treat smaller sensors in a single digitization')
parser.add_argument('--combine-smaller-digi', action='store_true', help=argparse.SUPPRESS)
Expand Down Expand Up @@ -441,6 +445,7 @@ def createRestDigiTask(name, det='ALLSMALLER'):
tpcclussect = createTask(name=taskname, needs=[TPCDigitask['name']], tf=tf, cwd=timeframeworkdir, lab=["RECO"], cpu='1', mem='2000')
tpcclussect['cmd'] = 'o2-tpc-chunkeddigit-merger --tpc-sectors ' + str(s) + ' --rate 1000 --tpc-lanes ' + str(NWORKERS)
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"'
tpcclussect['env'] = { "OMP_NUM_THREADS" : "1" } # we disable OpenMP since running in scalar mode anyway
workflow['stages'].append(tpcclussect)

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

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


def trimString(cmd):
return ' '.join(cmd.split())

Expand Down

0 comments on commit 2273127

Please sign in to comment.