172 def configure_args(self, test):
173 self.log.
debug(
'Configuring args for step %s', self.name)
174 if self.args is None:
175 self.args = ''
176 athenaopts = ''
177
178
179 if self.type == 'Reco_tf' or self.type == 'Derivation_tf':
180 self.prmon = False
181
182
183 if self.forks and self.forks > 1 and self.perfmon:
184 self.log.
debug(
'Disabling perfmon because forks=%d > 1', self.forks)
185 self.perfmon = False
186
187
188 if self.type.endswith('_tf') and self.perfmon:
189 self.log.
debug(
'Disabling perfmon for the transform step type %s', self.type)
190 self.perfmon = False
191
192
193 if self.type != 'other':
194 if self.imf:
195 athenaopts += ' --imf'
196 if self.perfmon:
197 if self.type == 'athenaHLT':
198 athenaopts += ' --perfmon'
199 elif self.type == 'athena':
200 athenaopts += ' --perfmon=fastmonmt'
201 if self.malloc:
202 athenaopts += " --stdcmalloc "
203
204
205 if self.type != 'other':
206 if self.costmon:
207 self.flags.append('Trigger.CostMonitoring.monitorAllEvents=True')
208 if self.fpe_auditor:
209 self.flags.append('Exec.FPE=1')
210
211
212 if self.config_only :
213
214 if self.type == 'athenaHLT' or (self.type == "other" and self.executable == "athenaHLT.py") :
215 athenaopts += ' --dump-config-exit'
216
217 elif self.type == 'athena' or self.type == 'Reco_tf' or self.type == 'Derivation_tf' or (self.type == "other" and self.executable == "athena.py") :
218 athenaopts += ' --config-only=' + self.name + '.pkl'
219
220
221
222 else :
223 self.misconfig_abort('Cannot determine what config-only option is needed. Consider adding the appropriate flag to "args" instead.')
224
225
226 if test.package_name == 'TrigP1Test' and self.type == 'athenaHLT':
227 if self.threads is None:
228 self.threads = 1
229 if self.concurrent_events is None:
230 self.concurrent_events = 1
231 if self.forks is None:
232 self.forks = 1
233
234
235 if self.threads is not None:
236 athenaopts += ' --threads={}'.format(self.threads)
237 if self.concurrent_events is not None:
238 athenaopts += ' --concurrent-events={}'.format(
239 self.concurrent_events)
240 if self.forks is not None:
241 athenaopts += ' --nprocs={}'.format(self.forks)
242
243
244 athenaopts = athenaopts.strip()
245 if self.type.endswith('_tf'):
246 self.args += ' --athenaopts="{}"'.format(athenaopts)
247 else:
248 self.args += ' '+athenaopts
249
250
251 if self.max_events is None:
252 if test.art_type == 'build':
253 if test.package_name == 'TrigP1Test':
254 self.max_events = 80
255 else:
256 self.max_events = 20
257 else:
258 self.max_events = 1000
259
260
261 if self.prmon:
262 if self.max_events <= 100:
263 self.prmon_interval = 5
264 else:
265 self.prmon_interval = 10
266
267
268 if self.type == 'athena':
269 self.args += ' --evtMax={}'.format(self.max_events)
270 elif self.type == 'athenaHLT':
271 self.args += ' --number-of-events={}'.format(self.max_events)
272 elif self.type.endswith('_tf'):
273 self.args += ' --maxEvents={}'.format(self.max_events)
274 if self.skip_events is not None:
275 if self.type == 'athena':
276 self.args += ' --skipEvents={}'.format(self.skip_events)
277 elif self.type == 'athenaHLT':
278 self.args += ' --skip-events={}'.format(self.skip_events)
279 elif self.type.endswith('_tf'):
280 self.args += ' --skipEvents={}'.format(self.skip_events)
281
282
283 if len(self.input) > 0:
284 if self.input_object is not None:
285 if self.type == 'athenaHLT':
286 input_str = ' --file='.join(self.input_object.paths)
287 else:
288 input_str = ','.join(self.input_object.paths)
289 else:
290 input_str = self.input
291 if self.type == 'athena':
292 self.args += ' --filesInput={}'.format(input_str)
293 elif self.type == 'athenaHLT':
294 self.args += ''.join([f" --file={inputFile}" for inputFile in input_str.split(',')])
295 elif self.type.endswith('_tf'):
296 if self.input_object is None:
297 self.misconfig_abort(
298 'Cannot build inputXYZFile string for transform '
299 ' from explicit input path. Use input=\'\' and '
300 'specify the input explicitly in args')
301 if self.type == 'Trig_reco_tf' and '--prodSysBSRDO True' in self.args:
302 self.args += ' --inputBS_RDOFile={}'.format(input_str)
303 else:
304 self.args += ' --input{}File={}'.format(
305 self.input_object.format, input_str)
306
307
308
309 if self.job_options is not None:
310 self.args += ' '+self.job_options
311
312
313 if self.flags:
314 if not isinstance(self.flags, (list, tuple)):
315 self.misconfig_abort('Wrong type for flags. Expected list or tuple.')
316
317 if self.type.endswith('_tf'):
318 if self.type == 'Trig_reco_tf':
319
320 self.add_trf_precommand(' '.join(f'{flag}' for flag in self.flags))
321 else:
322 self.add_trf_precommand(';'.join(f'flags.{flag}' for flag in self.flags))
323 else:
324 self.args += ' ' + ' '.join(self.flags)
325
326
327 self.args = self.args.
strip()