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 if "maxEvents" not in extra_args:
231 base_events = 100
232 events = threads * base_events + 1
233 extra_args += f" --maxEvents {events}"
234
235 if not multithreaded:
236 flush = 80
237 format_flush = ", ".join([f"\"DAOD_{format}\": {flush}" for format in formats])
238 extra_args += f" --preExec 'flags.Output.TreeAutoFlush={{{format_flush}}}'"
239
240 if "inputAODFile" not in extra_args and "inputDAOD_PHYSFile" not in extra_args:
241 extra_args += f" --inputAODFile {input_AOD[run][data_type]}"
242
243
244 if not multithreaded:
245 self.command = \
246 (f"ATHENA_CORE_NUMBER={threads} Derivation_tf.py"
247 f" --formats {' '.join(formats)}"
248 " --multiprocess --multithreadedFileValidation True"
249 " --athenaMPMergeTargetSize 'DAOD_*:0'"
250 " --sharedWriter True"
251 " --outputDAODFile myOutput.pool.root"
252 f" --imf False {extra_args}")
253 else:
254 self.command = \
255 (f"ATHENA_CORE_NUMBER={threads} Derivation_tf.py"
256 f" --formats {' '.join(formats)}"
257 " --outputDAODFile myOutput.pool.root"
258 f" --imf False {extra_args}")
259
260
261 self.skip_performance_checks = True
262
263 self.output_checks = []
264 for format in formats:
265 self.output_checks.append(FrozenTier0PolicyCheck(setup, f"DAOD_{format}", 10))
266 self.output_checks.append(MetadataCheck(setup, f"DAOD_{format}"))
267
268 super().__init__(ID, run, type, steps, setup)
269
270