Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion MC/bin/o2dpg_qc_finalization_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import argparse
from os import environ, mkdir
from os.path import join, dirname, isdir
import re

sys.path.append(join(dirname(__file__), '.', 'o2dpg_workflow_utils'))

Expand Down Expand Up @@ -48,9 +49,17 @@ def add_QC_finalization(taskName, qcConfigPath, needs=None):
needs = [taskName + '_local' + str(tf) for tf in range(1, ntimeframes + 1)]

task = createTask(name=QC_finalize_name(taskName), needs=needs, cwd=qcdir, lab=["QC"], cpu=1, mem='2000')
task['cmd'] = f'o2-qc --config {qcConfigPath} --remote-batch {taskName}.root' + \
def remove_json_prefix(path):
return re.sub(r'^json://', '', path)

configFilePathOnDisk = remove_json_prefix(qcConfigPath)
# we check if the configFilePath actually exists in the currently loaded software. Otherwise we exit immediately and gracefully
task['cmd'] = ' if [ -f ' + configFilePathOnDisk + ' ]; then { '
task['cmd'] += f'o2-qc --config {qcConfigPath} --remote-batch {taskName}.root' + \
f' --override-values "qc.config.database.host={qcdbHost};qc.config.Activity.number={run};qc.config.Activity.type=PHYSICS;qc.config.Activity.periodName={productionTag};qc.config.Activity.beamType={beamType};qc.config.conditionDB.url={conditionDB}"' + \
' ' + getDPL_global_options()
task['cmd'] += ' ;} else { echo "Task ' + taskName + ' not performed due to config file not found "; } fi'

stages.append(task)

## Adds a postprocessing QC workflow
Expand Down
14 changes: 12 additions & 2 deletions MC/bin/o2dpg_sim_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1337,11 +1337,21 @@ def getDigiTaskName(det):
def addQCPerTF(taskName, needs, readerCommand, configFilePath, objectsFile=''):
task = createTask(name=taskName + '_local' + str(tf), needs=needs, tf=tf, cwd=timeframeworkdir, lab=["QC"], cpu=1, mem='2000')
objectsFile = objectsFile if len(objectsFile) > 0 else taskName + '.root'
# the --local-batch argument will make QC Tasks store their results in a file and merge with any existing objects
task['cmd'] = f'{readerCommand} | o2-qc --config {configFilePath}' + \

def remove_json_prefix(path):
return re.sub(r'^json://', '', path)

configFilePathOnDisk = remove_json_prefix(configFilePath)
# we check if the configFilePath actually exists in the currently loaded software. Otherwise we exit immediately and gracefully
task['cmd'] = ' if [ -f ' + configFilePathOnDisk + ' ]; then { '
# The actual QC command
# the --local-batch argument will make QC Tasks store their results in a file and merge with any existing objects
task['cmd'] += f'{readerCommand} | o2-qc --config {configFilePath}' + \
f' --local-batch ../{qcdir}/{objectsFile}' + \
f' --override-values "qc.config.database.host={args.qcdbHost};qc.config.Activity.number={args.run};qc.config.Activity.type=PHYSICS;qc.config.Activity.periodName={args.productionTag};qc.config.Activity.beamType={args.col};qc.config.Activity.start={args.timestamp};qc.config.conditionDB.url={args.conditionDB}"' + \
' ' + getDPL_global_options(ccdbbackend=False)
task['cmd'] += ' ;} else { echo "Task ' + taskName + ' not performed due to config file not found "; } fi'

# Prevents this task from being run for multiple TimeFrames at the same time, thus trying to modify the same file.
task['semaphore'] = objectsFile
workflow['stages'].append(task)
Expand Down