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(
104 cfg.merge(SQLiteDBSvcCfg(flags, name=
"LogDBSvc", dbPath=
"mpilog.db"))
105 cfg.addService(CompFactory.MPIClusterSvc(
"MPIClusterSvc", LogDatabaseSvc=
"SQLiteDBSvc/LogDBSvc"))
106 elmgr = CompFactory.MPIHiveEventLoopMgr(
107 MPIClusterSvc=
"MPIClusterSvc",
108 WhiteboardSvc=
"EventDataSvc",
109 SchedulerSvc=scheduler.getName(),
110 FirstEventIndex=flags.Exec.SkipEvents,
113 from AthenaServices.OutputStreamSequencerSvcConfig
import (
114 OutputStreamSequencerSvcCfg,
118 OutputStreamSequencerSvcCfg(
119 flags, incidentName=
"BeginInputFile", reportingOn=
False, replaceRangeMode=
True
122 if flags.Input.OverrideRunNumber:
123 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
125 elmgr.EvtIdModifierSvc = cfg.getPrimaryAndMerge(EvtIdModifierSvcCfg(flags)).name
127 if flags.Common.isOverlay
and not flags.Overlay.DataOverlay:
128 elmgr.RequireInputAttributeList =
True
129 elmgr.UseSecondaryEventNumber =
True
131 cfg.addService(elmgr)
136 cfg = ComponentAccumulator()
137 hivesvc = CompFactory.SG.HiveMgrSvc(
"EventDataSvc",
138 NSlots = flags.Concurrency.NumConcurrentEvents)
139 cfg.addService( hivesvc )
141 arp = CompFactory.AlgResourcePool(TopAlg = [
"AthMasterSeq"])
142 cfg.addService( arp )
146 elmgr = CompFactory.AthenaHiveEventLoopMgr(
147 WhiteboardSvc =
"EventDataSvc",
148 SchedulerSvc = scheduler.getName(),
149 EventPrintoutInterval = flags.Exec.EventPrintoutInterval)
151 if flags.Input.OverrideRunNumber:
152 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
153 elmgr.EvtIdModifierSvc = cfg.getPrimaryAndMerge(EvtIdModifierSvcCfg(flags))
155 if flags.Common.isOverlay
and not flags.Overlay.DataOverlay:
156 elmgr.RequireInputAttributeList =
True
157 elmgr.UseSecondaryEventNumber =
True
159 cfg.addService( elmgr )
164 cfg = ComponentAccumulator()
165 if flags.Common.isOverlay
and not flags.Overlay.DataOverlay:
166 elmgr = CompFactory.AthenaEventLoopMgr(EventPrintoutInterval = flags.Exec.EventPrintoutInterval)
167 elmgr.RequireInputAttributeList =
True
168 elmgr.UseSecondaryEventNumber =
True
169 cfg.addService( elmgr )
171 from AthenaMP.AthenaMPConfig
import AthenaMPCfg
172 mploop = AthenaMPCfg(flags)
179 cfg = ComponentAccumulator()
181 hivesvc = CompFactory.SG.HiveMgrSvc(
"EventDataSvc",
182 NSlots = flags.Concurrency.NumConcurrentEvents)
183 cfg.addService( hivesvc )
185 arp = CompFactory.AlgResourcePool(TopAlg = [
"AthMasterSeq"])
186 cfg.addService( arp )
190 elmgr = CompFactory.AthenaMtesEventLoopMgr(
191 WhiteboardSvc =
"EventDataSvc",
192 SchedulerSvc = scheduler.getName(),
193 EventRangeChannel = channel,
194 EventPrintoutInterval = flags.Exec.EventPrintoutInterval)
196 if flags.Input.OverrideRunNumber:
197 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
198 elmgr.EvtIdModifierSvc = cfg.getPrimaryAndMerge(EvtIdModifierSvcCfg(flags))
200 if flags.Common.isOverlay
and not flags.Overlay.DataOverlay:
201 elmgr.RequireInputAttributeList =
True
202 elmgr.UseSecondaryEventNumber =
True
205 from AthenaServices.OutputStreamSequencerSvcConfig
import OutputStreamSequencerSvcCfg
206 cfg.merge(OutputStreamSequencerSvcCfg(flags,
207 incidentName=
"NextEventRange",
210 cfg.addService( elmgr )
216 cfg = ComponentAccumulator()
217 msgsvc = CompFactory.MessageSvc()
218 msgsvc.OutputLevel = flags.Exec.OutputLevel
219 msgsvc.Format =
"% F%{:d}W%C%7W%R%T %0W%M".format(flags.Common.MsgSourceLength)
220 msgsvc.enableSuppression = flags.Common.MsgSuppression
221 if flags.Common.ShowMsgStats:
222 msgsvc.showStats =
True
224 msgsvc.statLevel = WARNING
226 from AthenaConfiguration.Enums
import ProductionStep
227 if flags.Common.ProductionStep
not in [ProductionStep.Default, ProductionStep.Reconstruction, ProductionStep.Derivation]:
228 msgsvc.Format =
"% F%18W%S%7W%R%T %0W%M"
229 if flags.Concurrency.NumThreads>0:
230 msgsvc.Format =
"% F%{:d}W%C%6W%R%e%s%8W%R%T %0W%M".format(flags.Common.MsgSourceLength)
231 if flags.Exec.VerboseMessageComponents:
232 msgsvc.verboseLimit=0
233 if flags.Exec.DebugMessageComponents:
235 if flags.Exec.InfoMessageComponents:
237 if flags.Exec.WarningMessageComponents:
238 msgsvc.warningLimit=0
239 if flags.Exec.ErrorMessageComponents:
242 cfg.addService(msgsvc)
247 """Add the standard sequences to cfg"""
250 AthSequencer = CompFactory.AthSequencer
251 cfg.addSequence(
AthSequencer(
'AthAlgEvtSeq', Sequential=
True, StopOverride=
True), parentName=
'AthMasterSeq')
252 cfg.addSequence(
AthSequencer(
'AthOutSeq', StopOverride=
True), parentName=
'AthMasterSeq')
254 cfg.addSequence(
AthSequencer(
'AthBeginSeq', Sequential=
True), parentName=
'AthAlgEvtSeq')
255 cfg.addSequence(
AthSequencer(
'AthAllAlgSeq', StopOverride=
True), parentName=
'AthAlgEvtSeq')
257 athAlgSeq =
AthSequencer(
'AthAlgSeq', IgnoreFilterPassed=
True, StopOverride=
True, ProcessDynamicDataDependencies=
True, ExtraDataForDynamicConsumers=[])
258 athCondSeq =
AthSequencer(
'AthCondSeq',StopOverride=
True)
260 if flags.Concurrency.NumThreads==0:
262 cfg.addSequence(athCondSeq, parentName=
'AthAllAlgSeq')
263 cfg.addSequence(athAlgSeq, parentName=
'AthAllAlgSeq')
269 cfg.addSequence(athAlgSeq, parentName=
'AthAllAlgSeq')
270 cfg.addSequence(athCondSeq, parentName=
'AthAllAlgSeq')
272 cfg.addSequence(
AthSequencer(
'AthEndSeq', Sequential=
True), parentName=
'AthAlgEvtSeq')
275 AthIncFirerAlg = CompFactory.AthIncFirerAlg
276 IncidentProcAlg = CompFactory.IncidentProcAlg
278 previousPerfmonDomain = cfg.getCurrentPerfmonDomain()
279 cfg.flagPerfmonDomain(
'Incidents')
281 cfg.addEventAlgo(
AthIncFirerAlg(
"BeginIncFiringAlg", FireSerial=
False, Incidents=[
'BeginEvent']),
282 sequenceName=
'AthBeginSeq')
284 cfg.addEventAlgo(IncidentProcAlg(
'IncidentProcAlg1'),
285 sequenceName=
'AthBeginSeq')
287 cfg.addEventAlgo(
AthIncFirerAlg(
'EndIncFiringAlg', FireSerial=
False, Incidents=[
'EndEvent']),
288 sequenceName=
"AthEndSeq")
290 cfg.addEventAlgo(IncidentProcAlg(
'IncidentProcAlg2'),
291 sequenceName=
"AthEndSeq")
294 cfg.addEventAlgo(
AthIncFirerAlg(
'EndAlgorithmsFiringAlg', FireSerial=
False, Incidents=[
'EndAlgorithms']),
295 sequenceName=
"AthMasterSeq")
297 cfg.addEventAlgo(IncidentProcAlg(
'IncidentProcAlg3'),
298 sequenceName=
"AthMasterSeq")
300 cfg.flagPerfmonDomain(previousPerfmonDomain)
304 from GeneratorConfig.Sequences
import EvgenSequence, EvgenSequenceFactory
305 cfg.addSequence(EvgenSequenceFactory(EvgenSequence.Main), parentName=
"AthAlgSeq")
306 cfg.addSequence(EvgenSequenceFactory(EvgenSequence.Generator), parentName=EvgenSequence.Main.value)
307 cfg.addSequence(EvgenSequenceFactory(EvgenSequence.Fix), parentName=EvgenSequence.Main.value)
308 cfg.addSequence(EvgenSequenceFactory(EvgenSequence.PreFilter), parentName=EvgenSequence.Main.value)
309 cfg.addSequence(EvgenSequenceFactory(EvgenSequence.Test), parentName=EvgenSequence.Main.value)
310 cfg.addSequence(EvgenSequenceFactory(EvgenSequence.Filter), parentName=EvgenSequence.Main.value)
311 cfg.addSequence(EvgenSequenceFactory(EvgenSequence.Post), parentName=EvgenSequence.Main.value)
316 from AthenaCommon.Logging
import log
317 log.setLevel(flags.Exec.OutputLevel)
319 if flags.Exec.Interactive ==
"run":
320 LoopMgr=
"PyAthenaEventLoopMgr"
321 log.info(
"Interactive mode, switching to %s", LoopMgr)
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"
331 LoopMgr =
"MPIHiveEventLoopMgr"
333 LoopMgr =
"AthenaHiveEventLoopMgr"
335 if flags.Concurrency.NumProcs > 0:
336 LoopMgr =
"AthMpEvtLoopMgr"
345 cfg.addService(CompFactory.ClassIDSvc(CLIDDBFiles = [
'clid.db',
'Gaudi_clid.db']))
347 cfg.addService(CompFactory.AlgContextSvc(BypassIncidents=
True))
348 cfg.addAuditor(CompFactory.AlgContextAuditor())
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))
357 from AthenaConfiguration.FPEAndCoreDumpConfig
import FPEAndCoreDumpCfg
358 cfg.merge(FPEAndCoreDumpCfg(flags))
363 cfg.addService(CompFactory.ExceptionSvc(Catch=
"NONE"))
366 cfg.setAppProperty(
'AuditAlgorithms',
True)
367 cfg.setAppProperty(
'InitializationLoopCheck',
False)
368 cfg.setAppProperty(
'EvtMax', flags.Exec.MaxEvents)
369 if flags.Exec.OutputLevel > INFO:
371 cfg.setAppProperty(
'AppName',
'')
372 cfg.setAppProperty(
'OutputLevel', flags.Exec.OutputLevel)
374 if flags.Exec.DebugStage !=
"":
375 cfg.setDebugStage(flags.Exec.DebugStage)
377 cfg.interactive=flags.Exec.Interactive
379 if flags.Concurrency.NumProcs > 0:
383 if flags.Exec.EventTimeOut > 0:
384 timeoutAlg = CompFactory.TimeoutAlg(
385 Timeout = flags.Exec.EventTimeOut,
387 DumpSchedulerState =
False)
388 cfg.addEventAlgo(timeoutAlg, sequenceName=
'AthBeginSeq')
391 if flags.Concurrency.NumThreads > 0:
392 if flags.Exec.MTEventService:
399 cfg.addAuditor( CompFactory.SGCommitAuditor() )
400 elif LoopMgr ==
'AthenaEventLoopMgr':
404 if flags.PerfMon.doFastMonMT
or flags.PerfMon.doFullMonMT:
405 from PerfMonComps.PerfMonCompsConfig
import PerfMonMTSvcCfg
406 cfg.merge(PerfMonMTSvcCfg(flags))
408 if flags.PerfMon.doGPerfProf:
409 from PerfMonGPerfTools.GPT_ProfilerServiceConfig
import GPT_ProfilerServiceCfg
410 cfg.merge(GPT_ProfilerServiceCfg(flags))
412 if len(flags.PerfMon.Valgrind.ProfiledAlgs)>0:
413 from Valkyrie.ValkyrieConfig
import ValgrindServiceCfg
414 cfg.merge(ValgrindServiceCfg(flags))
addEvgenSequences(flags, cfg)
MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
OutputUsageIgnoreCfg(flags, algorithm)
AthenaHiveEventLoopMgrCfg(flags)
addMainSequences(flags, cfg)
MainEvgenServicesCfg(flags, LoopMgr="AthenaEventLoopMgr", withSequences=True)
AthenaMtesEventLoopMgrCfg(flags, mtEs=False, channel='')
AthenaEventLoopMgrCfg(flags)
MPIHiveEventLoopMgrCfg(flags)
AthenaMpEventLoopMgrCfg(flags)
JobOptionsDumpCfg(flags, fileName="JobOptsConfig.txt")
MainServicesMiniCfg(flags, loopMgr='AthenaEventLoopMgr', masterSequence='AthAlgSeq')
AvalancheSchedulerSvcCfg(flags, **kwargs)