Skip to content

Commit 5510ade

Browse files
benedikt-voelkelBenedikt Volkel
andauthored
[AnalysisQC] Make common args better adjustable (#1514)
Co-authored-by: Benedikt Volkel <benedikt.volkel@cern.ch>
1 parent b818d34 commit 5510ade

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

MC/analysis_testing/o2dpg_analysis_test_utils.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def full_ana_name(raw_ana_name):
6969
return f"{ANALYSIS_LABEL}_{raw_ana_name}"
7070

7171

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

91+
# get common args from analysis configuration and add to args_map
92+
common_args_from_config = ana.get("common_args", {})
93+
for key, value in common_args_from_config.items():
94+
args_map[key] = value
95+
9196
# arguments dedicated for this analysis
9297
args_map_overwrite = {}
9398

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

106+
analysis_name = ana["name"]
107+
101108
for i in range(0, len(all_common_args), 2):
102109
tokens = all_common_args[i].split("-")
103110
key = "-".join(tokens[1:])

MC/analysis_testing/o2dpg_analysis_test_workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def add_analysis_tasks(workflow, input_aod="./AO2D.root", output_dir="./Analysis
251251
continue
252252
print(f"INFO: Analysis {ana['name']} uses configuration {configuration}")
253253

254-
add_common_args_ana = get_common_args_as_string(ana["name"], add_common_args)
254+
add_common_args_ana = get_common_args_as_string(ana, add_common_args)
255255
if not add_common_args_ana:
256256
print(f"ERROR: Cannot parse common args for analysis {ana['name']}")
257257
continue

MC/config/analysis_testing/json/analyses_config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@
233233
"expected_output": ["AnalysisResults.root"],
234234
"valid_mc": true,
235235
"valid_data": true,
236+
"common_args": {
237+
"shm-segment-size": 2500000000
238+
},
236239
"tasks": ["o2-analysis-je-emc-eventselection-qa",
237240
"o2-analysis-je-emc-cellmonitor",
238241
"o2-analysis-je-emcal-correction-task",

0 commit comments

Comments
 (0)