ATLAS Offline Software
Loading...
Searching...
No Matches
python.StandardTests.DerivationTest Class Reference
Inheritance diagram for python.StandardTests.DerivationTest:
Collaboration diagram for python.StandardTests.DerivationTest:

Public Member Functions

None __init__ (self, str ID, WorkflowRun run, WorkflowType type, list[str] steps, TestSetup setup, str extra_args="")
None run_reference (self)
None run_validation (self)
bool run_checks (self, list[WorkflowCheck] performance_checks)

Public Attributes

 ID = ID
 tag = ID
 steps = steps
 command
list output_checks = []
list digest_checks = []
bool skip_performance_checks = False
 diff_tolerances = None
 run = run
 type = type
 setup = setup
 logger = setup.logger
Path validation_path = self.setup.validation_run_path / f"run_{self.ID}"
Path reference_path = self.setup.reference_run_path / f"run_{self.ID}"

Detailed Description

Derivations test.

Definition at line 224 of file StandardTests.py.

Constructor & Destructor Documentation

◆ __init__()

None python.StandardTests.DerivationTest.__init__ ( self,
str ID,
WorkflowRun run,
WorkflowType type,
list[str] steps,
TestSetup setup,
str extra_args = "" )

Definition at line 227 of file StandardTests.py.

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() # remove MT
236 test_def.append(test_run) # add run back to the end
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 # If we're running a DAOD to DAOD job, the output stream is called D2AOD
245 out_stream = "DAOD"
246 parallel_compression = "True"
247 if "inputDAOD_PHYSFile" in extra_args:
248 out_stream = "D2AOD"
249 parallel_compression = "False" # Disable parallel compression for DAOD to DAOD tests (ATEAM-1194)
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 # could also use p5503
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 # skip performance checks for now
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

Member Function Documentation

◆ run_checks()

bool python.Test.WorkflowTest.run_checks ( self,
list[WorkflowCheck] performance_checks )
inherited

Definition at line 203 of file Tools/WorkflowTestRunner/python/Test.py.

203 def run_checks(self, performance_checks: list[WorkflowCheck]) -> bool:
204 self.logger.info("-----------------------------------------------------")
205 self.logger.info(f"----------- Post-processing of {self.ID} Test -----------")
206 result = True
207
208 # digest checks
209 for check in self.digest_checks:
210 result = check.run(self) and result
211
212 # output checks
213 if not self.setup.disable_output_checks:
214 for check in self.output_checks:
215 result = check.run(self) and result
216
217 if self.setup.validation_only or self.skip_performance_checks:
218 return result # Performance checks against static references not possible
219
220 # performance checks
221 for check in performance_checks:
222 result = check.run(self) and result
223
224 return result

◆ run_reference()

None python.Test.WorkflowTest.run_reference ( self)
inherited

Definition at line 166 of file Tools/WorkflowTestRunner/python/Test.py.

166 def run_reference(self) -> None:
167 self.logger.info(f"Running reference in rel {self.setup.release_reference}")
168 self.logger.info(f"\"{self.command}\"")
169
170 self.reference_path.mkdir(parents=True, exist_ok=True)
171
172 cmd = (f"cd {self.reference_path};"
173 f"source $AtlasSetup/scripts/asetup.sh {self.setup.release_reference} >& /dev/null;")
174 cmd += f"TRF_NOECHO=1 {self.command} > {self.ID}.log 2>&1"
175
176 subprocess.call(cmd, shell=True)
177
178 self.logger.info(f"Finished clean in rel {self.setup.release_reference}")
179 self.logger.info(f"\"{self.command}\"")
180

◆ run_validation()

None python.Test.WorkflowTest.run_validation ( self)
inherited

Definition at line 181 of file Tools/WorkflowTestRunner/python/Test.py.

181 def run_validation(self) -> None:
182 self.logger.info(f"Running validation in rel {self.setup.release_validation}")
183 self.logger.info(f"\"{self.command}\"")
184
185 self.validation_path.mkdir(parents=True, exist_ok=True)
186
187 cmd = f"cd {self.validation_path};"
188 if self.setup.disable_release_setup or not self.setup.release_validation:
189 pass
190 elif "WorkDir_DIR" in environ:
191 cmake_build_dir = environ["WorkDir_DIR"]
192 cmd += (f"source $AtlasSetup/scripts/asetup.sh {self.setup.release_validation} >& /dev/null;"
193 f"source {cmake_build_dir}/setup.sh;")
194 else:
195 cmd += f"source $AtlasSetup/scripts/asetup.sh {self.setup.release_validation} >& /dev/null;"
196 cmd += f"TRF_NOECHO=1 {self.command} > {self.ID}.log 2>&1"
197
198 subprocess.call(cmd, shell=True)
199
200 self.logger.info(f"Finished validation in rel {self.setup.release_validation}")
201 self.logger.info(f"\"{self.command}\"")
202

Member Data Documentation

◆ command

python.Test.WorkflowTest.command
inherited

Definition at line 144 of file Tools/WorkflowTestRunner/python/Test.py.

◆ diff_tolerances

python.Test.WorkflowTest.diff_tolerances = None
inherited

Definition at line 157 of file Tools/WorkflowTestRunner/python/Test.py.

◆ digest_checks

list python.Test.WorkflowTest.digest_checks = []
inherited

Definition at line 151 of file Tools/WorkflowTestRunner/python/Test.py.

◆ ID

python.Test.WorkflowTest.ID = ID
inherited

Definition at line 136 of file Tools/WorkflowTestRunner/python/Test.py.

◆ logger

python.Test.WorkflowTest.logger = setup.logger
inherited

Definition at line 162 of file Tools/WorkflowTestRunner/python/Test.py.

◆ output_checks

list python.Test.WorkflowTest.output_checks = []
inherited

Definition at line 148 of file Tools/WorkflowTestRunner/python/Test.py.

◆ reference_path

Path python.Test.WorkflowTest.reference_path = self.setup.reference_run_path / f"run_{self.ID}"
inherited

Definition at line 164 of file Tools/WorkflowTestRunner/python/Test.py.

◆ run

python.Test.WorkflowTest.run = run
inherited

Definition at line 159 of file Tools/WorkflowTestRunner/python/Test.py.

◆ setup

python.Test.WorkflowTest.setup = setup
inherited

Definition at line 161 of file Tools/WorkflowTestRunner/python/Test.py.

◆ skip_performance_checks

bool python.Test.WorkflowTest.skip_performance_checks = False
inherited

Definition at line 154 of file Tools/WorkflowTestRunner/python/Test.py.

◆ steps

python.Test.WorkflowTest.steps = steps
inherited

Definition at line 142 of file Tools/WorkflowTestRunner/python/Test.py.

◆ tag

python.Test.WorkflowTest.tag = ID
inherited

Definition at line 139 of file Tools/WorkflowTestRunner/python/Test.py.

◆ type

python.Test.WorkflowTest.type = type
inherited

Definition at line 160 of file Tools/WorkflowTestRunner/python/Test.py.

◆ validation_path

Path python.Test.WorkflowTest.validation_path = self.setup.validation_run_path / f"run_{self.ID}"
inherited

Definition at line 163 of file Tools/WorkflowTestRunner/python/Test.py.


The documentation for this class was generated from the following file: