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