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