227 def __init__(self, ID: str, run: WorkflowRun, type: WorkflowType, steps: list[str], setup: TestSetup, extra_args: str = "") -> None:
228 self.diff_tolerances = "PROCTools/DAOD_diff-tolerances.yaml"
229
230 test_def = ID.split("_")
231 multithreaded = False
232 if test_def[-2] == "MT":
233 multithreaded = True
234 test_run = test_def.pop()
235 test_def.pop()
236 test_def.append(test_run)
237 data_type = test_def[0].lower()
238 formats = [format.upper() for format in test_def[1:-1]]
239
240 threads = 0
241 if setup.custom_threads is not None:
242 threads = setup.custom_threads
243
244
245 out_stream = "DAOD"
246 parallel_compression = "True"
247 if "inputDAOD_PHYSFile" in extra_args:
248 out_stream = "D2AOD"
249 parallel_compression = "False"
250
251 if "maxEvents" not in extra_args:
252 base_events = 100
253 events = threads * base_events + 1
254 extra_args += f" --maxEvents {events}"
255
256 if not multithreaded:
257 flush = 80
258 format_flush = ", ".join([f"\"{out_stream}_{format}\": {flush}" for format in formats])
259 extra_args += f" --preExec 'flags.Output.TreeAutoFlush={{{format_flush}}}'"
260
261 if "inputAODFile" not in extra_args and "inputDAOD_PHYSFile" not in extra_args:
262 extra_args += f" --inputAODFile {input_AOD[run][data_type]}"
263
264
265 if not multithreaded:
266 self.command = \
267 (f"ATHENA_CORE_NUMBER={threads} Derivation_tf.py"
268 f" --formats {' '.join(formats)}"
269 " --multiprocess --multithreadedFileValidation True"
270 f" --athenaMPMergeTargetSize '{out_stream}_*:0'"
271 " --sharedWriter True"
272 f" --parallelCompression {parallel_compression}"
273 f" --output{out_stream}File myOutput.pool.root"
274 f" --imf False {extra_args}")
275 else:
276 self.command = \
277 (f"ATHENA_CORE_NUMBER={threads} Derivation_tf.py"
278 f" --formats {' '.join(formats)}"
279 " --multithreaded"
280 f" --output{out_stream}File myOutput.pool.root"
281 f" --imf False {extra_args}")
282
283
284 self.skip_performance_checks = True
285
286 self.output_checks = []
287 for format in formats:
288 self.output_checks.append(FrozenTier0PolicyCheck(setup, f"{out_stream}_{format}", 10))
289 self.output_checks.append(MetadataCheck(setup, f"{out_stream}_{format}"))
290
291 super().__init__("_".join(test_def), run, type, steps, setup)
292
293