314def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr'):
315
316 from AthenaCommon.Logging import log
317 log.setLevel(flags.Exec.OutputLevel)
318
319 if flags.Exec.Interactive == "run":
320 LoopMgr="PyAthenaEventLoopMgr"
321 log.info("Interactive mode, switching to %s", LoopMgr)
322 else:
323
324 if flags.Concurrency.NumThreads > 0:
325 if flags.Concurrency.NumConcurrentEvents==0:
326 raise Exception("Requested Concurrency.NumThreads>0 and Concurrency.NumConcurrentEvents==0, "
327 "which will not process events!")
328 if flags.Exec.MTEventService:
329 LoopMgr = "AthenaMtesEventLoopMgr"
330 elif flags.Exec.MPI:
331 LoopMgr = "MPIHiveEventLoopMgr"
332 else:
333 LoopMgr = "AthenaHiveEventLoopMgr"
334
335 if flags.Concurrency.NumProcs > 0:
336 LoopMgr = "AthMpEvtLoopMgr"
337
338
339 cfg = MainServicesMiniCfg(flags, loopMgr=LoopMgr, masterSequence='AthMasterSeq')
340
341
342 addMainSequences(flags, cfg)
343
344
345 cfg.addService(CompFactory.ClassIDSvc(CLIDDBFiles = ['clid.db','Gaudi_clid.db']))
346
347 cfg.addService(CompFactory.AlgContextSvc(BypassIncidents=True))
348 cfg.addAuditor(CompFactory.AlgContextAuditor())
349
350 cfg.addService(CompFactory.StoreGateSvc(Dump=flags.Debug.DumpEvtStore))
351 cfg.addService(CompFactory.StoreGateSvc("DetectorStore",Dump=flags.Debug.DumpDetStore))
352 cfg.addService(CompFactory.StoreGateSvc("HistoryStore"))
353 cfg.addService(CompFactory.StoreGateSvc("ConditionStore",Dump=flags.Debug.DumpCondStore))
354
355 cfg.merge(MessageSvcCfg(flags))
356
357 from AthenaConfiguration.FPEAndCoreDumpConfig import FPEAndCoreDumpCfg
358 cfg.merge(FPEAndCoreDumpCfg(flags))
359
360
361
362
363 cfg.addService(CompFactory.ExceptionSvc(Catch="NONE"))
364
365
366 cfg.setAppProperty('AuditAlgorithms', True)
367 cfg.setAppProperty('InitializationLoopCheck', False)
368 cfg.setAppProperty('EvtMax', flags.Exec.MaxEvents)
369 if flags.Exec.OutputLevel > INFO:
370
371 cfg.setAppProperty('AppName', '')
372 cfg.setAppProperty('OutputLevel', flags.Exec.OutputLevel)
373
374 if flags.Exec.DebugStage != "":
375 cfg.setDebugStage(flags.Exec.DebugStage)
376
377 cfg.interactive=flags.Exec.Interactive
378
379 if flags.Concurrency.NumProcs > 0:
380 cfg.merge(AthenaMpEventLoopMgrCfg(flags))
381
382
383 if flags.Exec.EventTimeOut > 0:
384 timeoutAlg = CompFactory.TimeoutAlg(
385 Timeout = flags.Exec.EventTimeOut,
386 AbortJob = True,
387 DumpSchedulerState = False)
388 cfg.addEventAlgo(timeoutAlg, sequenceName='AthBeginSeq')
389
390
391 if flags.Concurrency.NumThreads > 0:
392 if flags.Exec.MTEventService:
393 cfg.merge(AthenaMtesEventLoopMgrCfg(flags,True,flags.Exec.MTEventServiceChannel))
394 elif flags.Exec.MPI:
395 cfg.merge(MPIHiveEventLoopMgrCfg(flags))
396 else:
397 cfg.merge(AthenaHiveEventLoopMgrCfg(flags))
398
399 cfg.addAuditor( CompFactory.SGCommitAuditor() )
400 elif LoopMgr == 'AthenaEventLoopMgr':
401 cfg.merge(AthenaEventLoopMgrCfg(flags))
402
403
404 if flags.PerfMon.doFastMonMT or flags.PerfMon.doFullMonMT:
405 from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
406 cfg.merge(PerfMonMTSvcCfg(flags))
407
408 if flags.PerfMon.doGPerfProf:
409 from PerfMonGPerfTools.GPT_ProfilerServiceConfig import GPT_ProfilerServiceCfg
410 cfg.merge(GPT_ProfilerServiceCfg(flags))
411
412 if len(flags.PerfMon.Valgrind.ProfiledAlgs)>0:
413 from Valkyrie.ValkyrieConfig import ValgrindServiceCfg
414 cfg.merge(ValgrindServiceCfg(flags))
415
416 return cfg
417
418