8 """Mininmal basic config, just good enough for HelloWorld and alike"""
9 cfg = ComponentAccumulator(CompFactory.AthSequencer(masterSequence, Sequential=
True))
11 cfg.setAppProperty(
'TopAlg',[
'AthSequencer/'+masterSequence])
12 cfg.setAppProperty(
'MessageSvcType',
'MessageSvc')
13 cfg.setAppProperty(
'EventLoop', loopMgr)
14 cfg.setAppProperty(
'ExtSvcCreates',
'False')
15 cfg.setAppProperty(
'JobOptionsSvcType',
'JobOptionsSvc')
16 cfg.setAppProperty(
'JobOptionsType',
'NONE')
17 cfg.setAppProperty(
'JobOptionsPostAction',
'')
18 cfg.setAppProperty(
'JobOptionsPreAction',
'')
19 cfg.setAppProperty(
'PrintAlgsSequence', flags.Exec.PrintAlgsSequence)
20 if flags.Debug.NameAuditor:
21 cfg.addAuditor(CompFactory.NameAuditor())
22 if flags.Exec.StopOnSignal:
23 cfg.setAppProperty(
"StopOnSignal",
True)
24 cfg.addService(CompFactory.Gaudi.Utils.StopSignalHandler(Signals=flags.Exec.StopOnSignal))
30 kwargs.setdefault(
"CheckDependencies", flags.Scheduler.CheckDependencies)
31 kwargs.setdefault(
"CheckOutputUsage", flags.Scheduler.CheckOutputUsage)
32 kwargs.setdefault(
"ShowDataDependencies", flags.Scheduler.ShowDataDeps)
33 kwargs.setdefault(
"ShowDataFlow", flags.Scheduler.ShowDataFlow)
34 kwargs.setdefault(
"ShowControlFlow", flags.Scheduler.ShowControlFlow)
35 kwargs.setdefault(
"VerboseSubSlots", flags.Scheduler.EnableVerboseViews)
36 kwargs.setdefault(
"ThreadPoolSize", flags.Concurrency.NumThreads)
37 kwargs.setdefault(
"DataDepsGraphFile", flags.Scheduler.DataDepsGraphFile)
38 kwargs.setdefault(
"DataDepsGraphAlgPattern", flags.Scheduler.DataDepsGraphAlgPattern)
39 kwargs.setdefault(
"DataDepsGraphObjectPattern", flags.Scheduler.DataDepsGraphObjectPattern)
40 kwargs.setdefault(
"NumOffloadThreads", flags.Concurrency.NumOffloadThreads)
42 cfg = ComponentAccumulator()
43 scheduler = CompFactory.AvalancheSchedulerSvc(**kwargs)
44 cfg.addService(scheduler, primary=
True)
46 from SGComps.SGInputLoaderConfig
import SGInputLoaderCfg
50 inputloader_ca = SGInputLoaderCfg(flags, FailIfNoProxy=flags.Input.FailOnUnknownCollections)
51 cfg.merge(inputloader_ca, sequenceName=
"AthAlgSeq")
55 if flags.Scheduler.AutoLoadUnmetDependencies:
56 scheduler.DataLoaderAlg = inputloader_ca.getPrimary().getName()
69 cfg = ComponentAccumulator()
70 elmgr = CompFactory.AthenaEventLoopMgr(EventPrintoutInterval = flags.Exec.EventPrintoutInterval)
71 if flags.Input.OverrideRunNumber:
72 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
73 elmgr.EvtIdModifierSvc = cfg.getPrimaryAndMerge( EvtIdModifierSvcCfg(flags) )
75 if flags.Common.isOverlay:
76 if not flags.Overlay.DataOverlay:
77 elmgr.RequireInputAttributeList =
True
78 elmgr.UseSecondaryEventNumber =
True
80 cfg.addService( elmgr )
86 """Sets up an MPIHive EventLoopMgr along with it's dependencies"""
87 from SQLiteDBSvc.SQLiteDBSvcConfig
import SQLiteDBSvcCfg
88 cfg = ComponentAccumulator()
89 nConcurrentEvents = flags.Concurrency.NumConcurrentEvents
90 nThreads = flags.Concurrency.NumThreads
92 hivesvc = CompFactory.SG.HiveMgrSvc(
"EventDataSvc", NSlots=nConcurrentEvents)
93 cfg.addService(hivesvc)
95 arp = CompFactory.AlgResourcePool(
96 TopAlg=[
"AthMasterSeq"]
100 scheduler = cfg.getPrimaryAndMerge(
107 flags, name=
"LogDBSvc", dbPath=
"file:mpilog.db?nolock=1"
110 cfg.addService(CompFactory.MPIClusterSvc(
"MPIClusterSvc", LogDatabaseSvc=
"SQLiteDBSvc/LogDBSvc"))
111 elmgr = CompFactory.MPIHiveEventLoopMgr(
112 MPIClusterSvc=
"MPIClusterSvc",
113 WhiteboardSvc=
"EventDataSvc",
114 SchedulerSvc=scheduler.getName(),
115 FirstEventIndex=flags.Exec.SkipEvents,
118 from AthenaServices.OutputStreamSequencerSvcConfig
import (
119 OutputStreamSequencerSvcCfg,
123 OutputStreamSequencerSvcCfg(
124 flags, incidentName=
"BeginInputFile", reportingOn=
False, replaceRangeMode=
True
127 if flags.Input.OverrideRunNumber:
128 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
130 elmgr.EvtIdModifierSvc = cfg.getPrimaryAndMerge(EvtIdModifierSvcCfg(flags)).name
132 if flags.Common.isOverlay
and not flags.Overlay.DataOverlay:
133 elmgr.RequireInputAttributeList =
True
134 elmgr.UseSecondaryEventNumber =
True
136 cfg.addService(elmgr)
141 cfg = ComponentAccumulator()
142 hivesvc = CompFactory.SG.HiveMgrSvc(
"EventDataSvc",
143 NSlots = flags.Concurrency.NumConcurrentEvents)
144 cfg.addService( hivesvc )
146 arp = CompFactory.AlgResourcePool(TopAlg = [
"AthMasterSeq"])
147 cfg.addService( arp )
151 elmgr = CompFactory.AthenaHiveEventLoopMgr(
152 WhiteboardSvc =
"EventDataSvc",
153 SchedulerSvc = scheduler.getName(),
154 EventPrintoutInterval = flags.Exec.EventPrintoutInterval)
156 if flags.Input.OverrideRunNumber:
157 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
158 elmgr.EvtIdModifierSvc = cfg.getPrimaryAndMerge(EvtIdModifierSvcCfg(flags))
160 if flags.Common.isOverlay
and not flags.Overlay.DataOverlay:
161 elmgr.RequireInputAttributeList =
True
162 elmgr.UseSecondaryEventNumber =
True
164 cfg.addService( elmgr )
184 cfg = ComponentAccumulator()
186 hivesvc = CompFactory.SG.HiveMgrSvc(
"EventDataSvc",
187 NSlots = flags.Concurrency.NumConcurrentEvents)
188 cfg.addService( hivesvc )
190 arp = CompFactory.AlgResourcePool(TopAlg = [
"AthMasterSeq"])
191 cfg.addService( arp )
195 elmgr = CompFactory.AthenaMtesEventLoopMgr(
196 WhiteboardSvc =
"EventDataSvc",
197 SchedulerSvc = scheduler.getName(),
198 EventRangeChannel = channel,
199 EventPrintoutInterval = flags.Exec.EventPrintoutInterval)
201 if flags.Input.OverrideRunNumber:
202 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
203 elmgr.EvtIdModifierSvc = cfg.getPrimaryAndMerge(EvtIdModifierSvcCfg(flags))
205 if flags.Common.isOverlay
and not flags.Overlay.DataOverlay:
206 elmgr.RequireInputAttributeList =
True
207 elmgr.UseSecondaryEventNumber =
True
210 from AthenaServices.OutputStreamSequencerSvcConfig
import OutputStreamSequencerSvcCfg
211 cfg.merge(OutputStreamSequencerSvcCfg(flags,
212 incidentName=
"NextEventRange",
215 cfg.addService( elmgr )
221 cfg = ComponentAccumulator()
222 msgsvc = CompFactory.MessageSvc()
223 msgsvc.OutputLevel = flags.Exec.OutputLevel
224 msgsvc.Format =
"% F%{:d}W%C%7W%R%T %0W%M".format(flags.Common.MsgSourceLength)
225 msgsvc.enableSuppression = flags.Common.MsgSuppression
226 if flags.Common.ShowMsgStats:
227 msgsvc.showStats =
True
229 msgsvc.statLevel = WARNING
231 from AthenaConfiguration.Enums
import ProductionStep
232 if flags.Common.ProductionStep
not in [ProductionStep.Default, ProductionStep.Reconstruction, ProductionStep.Derivation]:
233 msgsvc.Format =
"% F%18W%S%7W%R%T %0W%M"
234 if flags.Concurrency.NumThreads>0:
235 msgsvc.Format =
"% F%{:d}W%C%6W%R%e%s%8W%R%T %0W%M".format(flags.Common.MsgSourceLength)
236 if flags.Exec.VerboseMessageComponents:
237 msgsvc.verboseLimit=0
238 if flags.Exec.DebugMessageComponents:
240 if flags.Exec.InfoMessageComponents:
242 if flags.Exec.WarningMessageComponents:
243 msgsvc.warningLimit=0
244 if flags.Exec.ErrorMessageComponents:
247 cfg.addService(msgsvc)
252 """Add the standard sequences to cfg"""
255 AthSequencer = CompFactory.AthSequencer
256 cfg.addSequence(
AthSequencer(
'AthAlgEvtSeq', Sequential=
True, StopOverride=
True), parentName=
'AthMasterSeq')
257 cfg.addSequence(
AthSequencer(
'AthOutSeq', StopOverride=
True), parentName=
'AthMasterSeq')
259 cfg.addSequence(
AthSequencer(
'AthBeginSeq', Sequential=
True), parentName=
'AthAlgEvtSeq')
260 cfg.addSequence(
AthSequencer(
'AthAllAlgSeq', StopOverride=
True), parentName=
'AthAlgEvtSeq')
262 athAlgSeq =
AthSequencer(
'AthAlgSeq', IgnoreFilterPassed=
True, StopOverride=
True, ProcessDynamicDataDependencies=
True, ExtraDataForDynamicConsumers=[])
263 athCondSeq =
AthSequencer(
'AthCondSeq',StopOverride=
True)
265 if flags.Concurrency.NumThreads==0:
267 cfg.addSequence(athCondSeq, parentName=
'AthAllAlgSeq')
268 cfg.addSequence(athAlgSeq, parentName=
'AthAllAlgSeq')
274 cfg.addSequence(athAlgSeq, parentName=
'AthAllAlgSeq')
275 cfg.addSequence(athCondSeq, parentName=
'AthAllAlgSeq')
277 cfg.addSequence(
AthSequencer(
'AthEndSeq', Sequential=
True), parentName=
'AthAlgEvtSeq')
280 AthIncFirerAlg = CompFactory.AthIncFirerAlg
281 IncidentProcAlg = CompFactory.IncidentProcAlg
283 previousPerfmonDomain = cfg.getCurrentPerfmonDomain()
284 cfg.flagPerfmonDomain(
'Incidents')
286 cfg.addEventAlgo(
AthIncFirerAlg(
"BeginIncFiringAlg", FireSerial=
False, Incidents=[
'BeginEvent']),
287 sequenceName=
'AthBeginSeq')
289 cfg.addEventAlgo(IncidentProcAlg(
'IncidentProcAlg1'),
290 sequenceName=
'AthBeginSeq')
292 cfg.addEventAlgo(
AthIncFirerAlg(
'EndIncFiringAlg', FireSerial=
False, Incidents=[
'EndEvent']),
293 sequenceName=
"AthEndSeq")
295 cfg.addEventAlgo(IncidentProcAlg(
'IncidentProcAlg2'),
296 sequenceName=
"AthEndSeq")
299 cfg.addEventAlgo(
AthIncFirerAlg(
'EndAlgorithmsFiringAlg', FireSerial=
False, Incidents=[
'EndAlgorithms']),
300 sequenceName=
"AthMasterSeq")
302 cfg.addEventAlgo(IncidentProcAlg(
'IncidentProcAlg3'),
303 sequenceName=
"AthMasterSeq")
305 cfg.flagPerfmonDomain(previousPerfmonDomain)
309 from GeneratorConfig.Sequences
import EvgenSequence, EvgenSequenceFactory
310 cfg.addSequence(EvgenSequenceFactory(EvgenSequence.Main), parentName=
"AthAlgSeq")
311 cfg.addSequence(EvgenSequenceFactory(EvgenSequence.Generator), parentName=EvgenSequence.Main.value)
312 cfg.addSequence(EvgenSequenceFactory(EvgenSequence.Fix), parentName=EvgenSequence.Main.value)
313 cfg.addSequence(EvgenSequenceFactory(EvgenSequence.PreFilter), parentName=EvgenSequence.Main.value)
314 cfg.addSequence(EvgenSequenceFactory(EvgenSequence.Test), parentName=EvgenSequence.Main.value)
315 cfg.addSequence(EvgenSequenceFactory(EvgenSequence.Filter), parentName=EvgenSequence.Main.value)
316 cfg.addSequence(EvgenSequenceFactory(EvgenSequence.Post), parentName=EvgenSequence.Main.value)
321 from AthenaCommon.Logging
import log
322 log.setLevel(flags.Exec.OutputLevel)
324 if flags.Exec.Interactive ==
"run":
325 LoopMgr=
"PyAthenaEventLoopMgr"
326 log.info(
"Interactive mode, switching to %s", LoopMgr)
331 msg =
"ERRONEOUS CONFIGURATION FOR MPI:\n"
333 if flags.Concurrency.NumThreads < 1:
334 msg = f
"{msg} - Concurrency.NumThreads = {flags.Concurrency.NumThreads}, must be >= 1\n"
336 if flags.Concurrency.NumProcs > 0:
337 msg = f
"{msg} - Concurrency.NumProcs = {flags.Concurrency.NumProcs}, must be 0\n"
342 if flags.Concurrency.NumThreads > 0:
343 if flags.Concurrency.NumConcurrentEvents==0:
344 raise Exception(
"Requested Concurrency.NumThreads>0 and Concurrency.NumConcurrentEvents==0, "
345 "which will not process events!")
346 if flags.Exec.MTEventService:
347 LoopMgr =
"AthenaMtesEventLoopMgr"
349 LoopMgr =
"MPIHiveEventLoopMgr"
351 LoopMgr =
"AthenaHiveEventLoopMgr"
353 if flags.Concurrency.NumProcs > 0:
354 LoopMgr =
"AthMpEvtLoopMgr"
363 cfg.addService(CompFactory.ClassIDSvc(CLIDDBFiles = [
'clid.db',
'Gaudi_clid.db']))
365 cfg.addService(CompFactory.AlgContextSvc(BypassIncidents=
True))
366 cfg.addAuditor(CompFactory.AlgContextAuditor())
368 cfg.addService(CompFactory.StoreGateSvc(Dump=flags.Debug.DumpEvtStore))
369 cfg.addService(CompFactory.StoreGateSvc(
"DetectorStore",Dump=flags.Debug.DumpDetStore))
370 cfg.addService(CompFactory.StoreGateSvc(
"HistoryStore"))
371 cfg.addService(CompFactory.StoreGateSvc(
"ConditionStore",Dump=flags.Debug.DumpCondStore))
375 from AthenaConfiguration.FPEAndCoreDumpConfig
import FPEAndCoreDumpCfg
376 cfg.merge(FPEAndCoreDumpCfg(flags))
381 cfg.addService(CompFactory.ExceptionSvc(Catch=
"NONE"))
387 cfg.addService(CompFactory.AthEnvironmentSvc(), create=
True)
390 cfg.setAppProperty(
'AuditAlgorithms',
True)
391 cfg.setAppProperty(
'InitializationLoopCheck',
False)
392 cfg.setAppProperty(
'EvtMax', flags.Exec.MaxEvents)
393 if flags.Exec.OutputLevel > INFO:
395 cfg.setAppProperty(
'AppName',
'')
396 cfg.setAppProperty(
'OutputLevel', flags.Exec.OutputLevel)
398 if flags.Exec.DebugStage !=
"":
399 cfg.setDebugStage(flags.Exec.DebugStage)
401 cfg.interactive=flags.Exec.Interactive
403 if flags.Concurrency.NumProcs > 0:
407 if flags.Exec.EventTimeOut > 0:
408 timeoutAlg = CompFactory.TimeoutAlg(
409 Timeout = flags.Exec.EventTimeOut,
411 DumpSchedulerState =
False)
412 cfg.addEventAlgo(timeoutAlg, sequenceName=
'AthBeginSeq')
415 if flags.Concurrency.NumThreads > 0:
416 if flags.Exec.MTEventService:
423 cfg.addAuditor( CompFactory.SGCommitAuditor() )
424 elif LoopMgr ==
'AthenaEventLoopMgr':
428 if flags.PerfMon.doFastMonMT
or flags.PerfMon.doFullMonMT:
429 from PerfMonComps.PerfMonCompsConfig
import PerfMonMTSvcCfg
430 cfg.merge(PerfMonMTSvcCfg(flags))
432 if flags.PerfMon.doGPerfProf:
433 from PerfMonGPerfTools.GPT_ProfilerServiceConfig
import GPT_ProfilerServiceCfg
434 cfg.merge(GPT_ProfilerServiceCfg(flags))
436 if len(flags.PerfMon.Valgrind.ProfiledAlgs)>0:
437 from Valkyrie.ValkyrieConfig
import ValgrindServiceCfg
438 cfg.merge(ValgrindServiceCfg(flags))
addEvgenSequences(flags, cfg)
MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
OutputUsageIgnoreCfg(flags, algorithm)
addMainSequences(flags, cfg)
MainEvgenServicesCfg(flags, LoopMgr="AthenaEventLoopMgr", withSequences=True)
AthenaMtesEventLoopMgrCfg(flags, mtEs=False, channel='')
JobOptionsDumpCfg(flags, fileName="JobOptsConfig.txt")
MainServicesMiniCfg(flags, loopMgr='AthenaEventLoopMgr', masterSequence='AthAlgSeq')
AvalancheSchedulerSvcCfg(flags, **kwargs)