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
 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 212 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 215 of file StandardTests.py.

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() # remove MT
222 test_def.append(test_run) # add run back to the end
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 # could also use p5503
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 # skip performance checks for now
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

Member Function Documentation

◆ run_checks()

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

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

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

◆ run_reference()

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

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

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

◆ run_validation()

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

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

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

Member Data Documentation

◆ command

python.Test.WorkflowTest.command
inherited

Definition at line 144 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 159 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 161 of file Tools/WorkflowTestRunner/python/Test.py.

◆ run

python.Test.WorkflowTest.run = run
inherited

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

◆ setup

python.Test.WorkflowTest.setup = setup
inherited

Definition at line 158 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 157 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 160 of file Tools/WorkflowTestRunner/python/Test.py.


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