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 == '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 == 'athenaEF' 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 == 'athenaEF':
235 if self.threads is None:
236 self.threads = 1
237 if self.concurrent_events is None:
238 self.concurrent_events = 1
239
240
241 if self.threads is not None:
242 athenaopts += ' --threads={}'.format(self.threads)
243 if self.concurrent_events is not None:
244 athenaopts += ' --concurrent-events={}'.format(
245 self.concurrent_events)
246 if self.forks is not None and self.type != 'athenaEF':
247 athenaopts += ' --nprocs={}'.format(self.forks)
248
249
250 athenaopts = athenaopts.strip()
251 if self.type.endswith('_tf'):
252 self.args += ' --athenaopts="{}"'.format(athenaopts)
253 else:
254 self.args += ' '+athenaopts
255
256
257 if self.max_events is None:
258 if test.art_type == 'build':
259 if test.package_name == 'TrigP1Test':
260 self.max_events = 80
261 else:
262 self.max_events = 20
263 else:
264 self.max_events = 1000
265
266
267 if self.prmon:
268 if self.max_events <= 100:
269 self.prmon_interval = 5
270 else:
271 self.prmon_interval = 10
272
273
274 if self.type == 'athena':
275 self.args += ' --evtMax={}'.format(self.max_events)
276 elif self.type == 'athenaEF':
277 self.args += ' --number-of-events={}'.format(self.max_events)
278 elif self.type.endswith('_tf'):
279 self.args += ' --maxEvents={}'.format(self.max_events)
280 if self.skip_events is not None:
281 if self.type == 'athena':
282 self.args += ' --skipEvents={}'.format(self.skip_events)
283 elif self.type == 'athenaEF':
284 self.args += ' --skip-events={}'.format(self.skip_events)
285 elif self.type.endswith('_tf'):
286 self.args += ' --skipEvents={}'.format(self.skip_events)
287
288
289 if len(self.input) > 0:
290 if self.input_object is not None:
291 if self.type == 'athenaEF':
292 input_str = ' --file='.join(self.input_object.paths)
293 else:
294 input_str = ','.join(self.input_object.paths)
295 else:
296 input_str = self.input
297 if self.type == 'athena':
298 self.args += ' --filesInput={}'.format(input_str)
299 elif self.type == 'athenaEF':
300 self.args += ''.join([f" --file={inputFile}" for inputFile in input_str.split(',')])
301 elif self.type.endswith('_tf'):
302 if self.input_object is None:
303 self.misconfig_abort(
304 'Cannot build inputXYZFile string for transform '
305 ' from explicit input path. Use input=\'\' and '
306 'specify the input explicitly in args')
307 if self.type == 'Trig_reco_tf' and '--prodSysBSRDO True' in self.args:
308 self.args += ' --inputBS_RDOFile={}'.format(input_str)
309 else:
310 self.args += ' --input{}File={}'.format(
311 self.input_object.format, input_str)
312
313
314
315 if self.job_options is not None:
316 self.args += ' '+self.job_options
317
318
319 if self.flags:
320 if not isinstance(self.flags, (list, tuple)):
321 self.misconfig_abort('Wrong type for flags. Expected list or tuple.')
322
323 if self.type.endswith('_tf'):
324 if self.type == 'Trig_reco_tf':
325
326 self.add_trf_precommand(' '.join(f'{flag}' for flag in self.flags))
327 else:
328 self.add_trf_precommand(';'.join(f'flags.{flag}' for flag in self.flags))
329 else:
330 self.args += ' ' + ' '.join(self.flags)
331
332
333 self.args = self.args.
strip()