215 def __init__(self, ID: str, run: WorkflowRun, type: WorkflowType, steps: List[str], setup: TestSetup, extra_args: str = "") -> None:
216 test_def = ID.split("_")
217 multithreaded = False
218 if test_def[-2] == "MT":
219 multithreaded = True
220 test_run = test_def.pop()
221 test_def.pop()
222 test_def.append(test_run)
223 data_type = test_def[0].lower()
224 formats = [format.upper() for format in test_def[1:-1]]
225
226 threads = 0
227 if setup.custom_threads is not None:
228 threads = setup.custom_threads
229
230
231 out_stream = "DAOD"
232 if "inputDAOD_PHYSFile" in extra_args:
233 out_stream = "D2AOD"
234
235 if "maxEvents" not in extra_args:
236 base_events = 100
237 events = threads * base_events + 1
238 extra_args += f" --maxEvents {events}"
239
240 if not multithreaded:
241 flush = 80
242 format_flush = ", ".join([f"\"{out_stream}_{format}\": {flush}" for format in formats])
243 extra_args += f" --preExec 'flags.Output.TreeAutoFlush={{{format_flush}}}'"
244
245 if "inputAODFile" not in extra_args and "inputDAOD_PHYSFile" not in extra_args:
246 extra_args += f" --inputAODFile {input_AOD[run][data_type]}"
247
248
249 if not multithreaded:
250 self.command = \
251 (f"ATHENA_CORE_NUMBER={threads} Derivation_tf.py"
252 f" --formats {' '.join(formats)}"
253 " --multiprocess --multithreadedFileValidation True"
254 f" --athenaMPMergeTargetSize '{out_stream}_*:0'"
255 " --sharedWriter True"
256 f" --output{out_stream}File myOutput.pool.root"
257 f" --imf False {extra_args}")
258 else:
259 self.command = \
260 (f"ATHENA_CORE_NUMBER={threads} Derivation_tf.py"
261 f" --formats {' '.join(formats)}"
262 " --multithreaded"
263 f" --output{out_stream}File myOutput.pool.root"
264 f" --imf False {extra_args}")
265
266
267 self.skip_performance_checks = True
268
269 self.output_checks = []
270 for format in formats:
271 self.output_checks.append(FrozenTier0PolicyCheck(setup, f"{out_stream}_{format}", 10))
272 self.output_checks.append(MetadataCheck(setup, f"{out_stream}_{format}"))
273
274 super().__init__("_".join(test_def), run, type, steps, setup)
275
276