Skip to content

Commit

Permalink
[AnalysisQC] Make common args better adjustable
Browse files Browse the repository at this point in the history
  • Loading branch information
Benedikt Volkel committed Mar 1, 2024
1 parent b818d34 commit f8a9875
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
9 changes: 8 additions & 1 deletion MC/analysis_testing/o2dpg_analysis_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def full_ana_name(raw_ana_name):
return f"{ANALYSIS_LABEL}_{raw_ana_name}"


def get_common_args_as_string(analysis_name, all_common_args):
def get_common_args_as_string(ana, all_common_args):
"""
all_common_args is of the form
[<ana_name1>-shm-segment-size <value>, <ana_name2>-readers <value>, ...]
Expand All @@ -88,6 +88,11 @@ def make_args_string(args_map_in):
"readers": 1,
"aod-memory-rate-limit": 500000000}

# get common args from analysis configuration and add to args_map
common_args_from_config = ana.get("common_args", {})
for key, value in common_args_from_config.items():
args_map[key] = value

# arguments dedicated for this analysis
args_map_overwrite = {}

Expand All @@ -98,6 +103,8 @@ def make_args_string(args_map_in):
print("ERROR: Cannot digest common args.")
return None

analysis_name = ana["name"]

for i in range(0, len(all_common_args), 2):
tokens = all_common_args[i].split("-")
key = "-".join(tokens[1:])
Expand Down
2 changes: 1 addition & 1 deletion MC/analysis_testing/o2dpg_analysis_test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def add_analysis_tasks(workflow, input_aod="./AO2D.root", output_dir="./Analysis
continue
print(f"INFO: Analysis {ana['name']} uses configuration {configuration}")

add_common_args_ana = get_common_args_as_string(ana["name"], add_common_args)
add_common_args_ana = get_common_args_as_string(ana, add_common_args)
if not add_common_args_ana:
print(f"ERROR: Cannot parse common args for analysis {ana['name']}")
continue
Expand Down
3 changes: 3 additions & 0 deletions MC/config/analysis_testing/json/analyses_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@
"expected_output": ["AnalysisResults.root"],
"valid_mc": true,
"valid_data": true,
"common_args": {
"shm-segment-size": 2500000000
},
"tasks": ["o2-analysis-je-emc-eventselection-qa",
"o2-analysis-je-emc-cellmonitor",
"o2-analysis-je-emcal-correction-task",
Expand Down

0 comments on commit f8a9875

Please sign in to comment.