2 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
3 from AthenaConfiguration.ComponentFactory
import CompFactory
8 """Mininmal basic config, just good enough for HelloWorld and alike"""
11 TimeOut=flags.Exec.EventTimeOut))
13 cfg.setAppProperty(
'TopAlg',[
'AthSequencer/'+masterSequence])
14 cfg.setAppProperty(
'MessageSvcType',
'MessageSvc')
15 cfg.setAppProperty(
'EventLoop', loopMgr)
16 cfg.setAppProperty(
'ExtSvcCreates',
'False')
17 cfg.setAppProperty(
'JobOptionsSvcType',
'JobOptionsSvc')
18 cfg.setAppProperty(
'JobOptionsType',
'NONE')
19 cfg.setAppProperty(
'JobOptionsPostAction',
'')
20 cfg.setAppProperty(
'JobOptionsPreAction',
'')
21 cfg.setAppProperty(
'PrintAlgsSequence', flags.Exec.PrintAlgsSequence)
26 kwargs.setdefault(
"CheckDependencies", flags.Scheduler.CheckDependencies)
27 kwargs.setdefault(
"CheckOutputUsage", flags.Scheduler.CheckOutputUsage)
28 kwargs.setdefault(
"ShowDataDependencies", flags.Scheduler.ShowDataDeps)
29 kwargs.setdefault(
"ShowDataFlow", flags.Scheduler.ShowDataFlow)
30 kwargs.setdefault(
"ShowControlFlow", flags.Scheduler.ShowControlFlow)
31 kwargs.setdefault(
"VerboseSubSlots", flags.Scheduler.EnableVerboseViews)
32 kwargs.setdefault(
"ThreadPoolSize", flags.Concurrency.NumThreads)
33 kwargs.setdefault(
"DataDepsGraphFile", flags.Scheduler.DataDepsGraphFile)
34 kwargs.setdefault(
"DataDepsGraphAlgPattern", flags.Scheduler.DataDepsGraphAlgPattern)
35 kwargs.setdefault(
"DataDepsGraphObjectPattern", flags.Scheduler.DataDepsGraphObjectPattern)
36 kwargs.setdefault(
"NumOffloadThreads", flags.Concurrency.NumOffloadThreads)
39 scheduler = CompFactory.AvalancheSchedulerSvc(**kwargs)
40 cfg.addService(scheduler, primary=
True)
42 from SGComps.SGInputLoaderConfig
import SGInputLoaderCfg
46 inputloader_ca =
SGInputLoaderCfg(flags, FailIfNoProxy=flags.Input.FailOnUnknownCollections)
47 cfg.merge(inputloader_ca, sequenceName=
"AthAlgSeq")
51 if flags.Scheduler.AutoLoadUnmetDependencies:
52 scheduler.DataLoaderAlg = inputloader_ca.getPrimary().
getName()
59 if flags.Concurrency.NumThreads > 0
and flags.Scheduler.CheckOutputUsage:
66 elmgr = CompFactory.AthenaEventLoopMgr(EventPrintoutInterval = flags.Exec.EventPrintoutInterval)
67 if flags.Input.OverrideRunNumber:
68 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
71 if flags.Common.isOverlay:
72 if not flags.Overlay.DataOverlay:
73 elmgr.RequireInputAttributeList =
True
74 elmgr.UseSecondaryEventNumber =
True
76 cfg.addService( elmgr )
83 hivesvc = CompFactory.SG.HiveMgrSvc(
"EventDataSvc",
84 NSlots = flags.Concurrency.NumConcurrentEvents)
85 cfg.addService( hivesvc )
87 arp = CompFactory.AlgResourcePool(TopAlg = [
"AthMasterSeq"])
92 elmgr = CompFactory.AthenaHiveEventLoopMgr(
93 WhiteboardSvc =
"EventDataSvc",
94 SchedulerSvc = scheduler.getName(),
95 EventPrintoutInterval = flags.Exec.EventPrintoutInterval)
97 if flags.Input.OverrideRunNumber:
98 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
101 if flags.Common.isOverlay
and not flags.Overlay.DataOverlay:
102 elmgr.RequireInputAttributeList =
True
103 elmgr.UseSecondaryEventNumber =
True
105 cfg.addService( elmgr )
111 if flags.Common.isOverlay
and not flags.Overlay.DataOverlay:
112 elmgr = CompFactory.AthenaEventLoopMgr(EventPrintoutInterval = flags.Exec.EventPrintoutInterval)
113 elmgr.RequireInputAttributeList =
True
114 elmgr.UseSecondaryEventNumber =
True
115 cfg.addService( elmgr )
117 from AthenaMP.AthenaMPConfig
import AthenaMPCfg
127 hivesvc = CompFactory.SG.HiveMgrSvc(
"EventDataSvc",
128 NSlots = flags.Concurrency.NumConcurrentEvents)
129 cfg.addService( hivesvc )
131 arp = CompFactory.AlgResourcePool(TopAlg = [
"AthMasterSeq"])
132 cfg.addService( arp )
136 elmgr = CompFactory.AthenaMtesEventLoopMgr(
137 WhiteboardSvc =
"EventDataSvc",
138 SchedulerSvc = scheduler.getName(),
139 EventRangeChannel = channel,
140 EventPrintoutInterval = flags.Exec.EventPrintoutInterval)
142 if flags.Input.OverrideRunNumber:
143 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
146 if flags.Common.isOverlay
and not flags.Overlay.DataOverlay:
147 elmgr.RequireInputAttributeList =
True
148 elmgr.UseSecondaryEventNumber =
True
151 from AthenaServices.OutputStreamSequencerSvcConfig
import OutputStreamSequencerSvcCfg
153 incidentName=
"NextEventRange",
156 cfg.addService( elmgr )
163 msgsvc = CompFactory.MessageSvc()
164 msgsvc.OutputLevel = flags.Exec.OutputLevel
165 msgsvc.Format =
"% F%{:d}W%C%7W%R%T %0W%M".
format(flags.Common.MsgSourceLength)
166 msgsvc.enableSuppression = flags.Common.MsgSuppression
167 if flags.Common.ShowMsgStats:
168 msgsvc.showStats =
True
170 msgsvc.statLevel = WARNING
172 from AthenaConfiguration.Enums
import ProductionStep
173 if flags.Common.ProductionStep
not in [ProductionStep.Default, ProductionStep.Reconstruction, ProductionStep.Derivation]:
174 msgsvc.Format =
"% F%18W%S%7W%R%T %0W%M"
175 if flags.Concurrency.NumThreads>0:
176 msgsvc.Format =
"% F%{:d}W%C%6W%R%e%s%8W%R%T %0W%M".
format(flags.Common.MsgSourceLength)
177 if flags.Exec.VerboseMessageComponents:
178 msgsvc.verboseLimit=0
179 if flags.Exec.DebugMessageComponents:
181 if flags.Exec.InfoMessageComponents:
183 if flags.Exec.WarningMessageComponents:
184 msgsvc.warningLimit=0
185 if flags.Exec.ErrorMessageComponents:
188 cfg.addService(msgsvc)
193 """Add the standard sequences to cfg"""
196 AthSequencer = CompFactory.AthSequencer
197 cfg.addSequence(
AthSequencer(
'AthAlgEvtSeq', Sequential=
True, StopOverride=
True), parentName=
'AthMasterSeq')
198 cfg.addSequence(
AthSequencer(
'AthOutSeq', StopOverride=
True), parentName=
'AthMasterSeq')
200 cfg.addSequence(
AthSequencer(
'AthBeginSeq', Sequential=
True), parentName=
'AthAlgEvtSeq')
201 cfg.addSequence(
AthSequencer(
'AthAllAlgSeq', StopOverride=
True), parentName=
'AthAlgEvtSeq')
203 athAlgSeq =
AthSequencer(
'AthAlgSeq', IgnoreFilterPassed=
True, StopOverride=
True, ProcessDynamicDataDependencies=
True, ExtraDataForDynamicConsumers=[])
204 athCondSeq =
AthSequencer(
'AthCondSeq',StopOverride=
True)
206 if flags.Concurrency.NumThreads==0:
208 cfg.addSequence(athCondSeq, parentName=
'AthAllAlgSeq')
209 cfg.addSequence(athAlgSeq, parentName=
'AthAllAlgSeq')
215 cfg.addSequence(athAlgSeq, parentName=
'AthAllAlgSeq')
216 cfg.addSequence(athCondSeq, parentName=
'AthAllAlgSeq')
218 cfg.addSequence(
AthSequencer(
'AthEndSeq', Sequential=
True), parentName=
'AthAlgEvtSeq')
221 AthIncFirerAlg = CompFactory.AthIncFirerAlg
222 IncidentProcAlg = CompFactory.IncidentProcAlg
224 previousPerfmonDomain = cfg.getCurrentPerfmonDomain()
225 cfg.flagPerfmonDomain(
'Incidents')
227 cfg.addEventAlgo(
AthIncFirerAlg(
"BeginIncFiringAlg", FireSerial=
False, Incidents=[
'BeginEvent']),
228 sequenceName=
'AthBeginSeq')
230 cfg.addEventAlgo(IncidentProcAlg(
'IncidentProcAlg1'),
231 sequenceName=
'AthBeginSeq')
233 cfg.addEventAlgo(
AthIncFirerAlg(
'EndIncFiringAlg', FireSerial=
False, Incidents=[
'EndEvent']),
234 sequenceName=
"AthEndSeq")
236 cfg.addEventAlgo(IncidentProcAlg(
'IncidentProcAlg2'),
237 sequenceName=
"AthEndSeq")
240 cfg.addEventAlgo(
AthIncFirerAlg(
'EndAlgorithmsFiringAlg', FireSerial=
False, Incidents=[
'EndAlgorithms']),
241 sequenceName=
"AthMasterSeq")
243 cfg.addEventAlgo(IncidentProcAlg(
'IncidentProcAlg3'),
244 sequenceName=
"AthMasterSeq")
246 cfg.flagPerfmonDomain(previousPerfmonDomain)
250 from GeneratorConfig.Sequences
import EvgenSequence, EvgenSequenceFactory
262 from AthenaCommon.Logging
import log
263 log.setLevel(flags.Exec.OutputLevel)
265 if flags.Exec.Interactive ==
"run":
266 LoopMgr=
"PyAthenaEventLoopMgr"
267 log.info(
"Interactive mode, switching to %s", LoopMgr)
270 if flags.Concurrency.NumThreads > 0:
271 if flags.Concurrency.NumConcurrentEvents==0:
272 raise Exception(
"Requested Concurrency.NumThreads>0 and Concurrency.NumConcurrentEvents==0, "
273 "which will not process events!")
274 if flags.Exec.MTEventService:
275 LoopMgr =
"AthenaMtesEventLoopMgr"
277 LoopMgr =
"AthenaHiveEventLoopMgr"
279 if flags.Concurrency.NumProcs > 0:
280 LoopMgr =
"AthMpEvtLoopMgr"
289 cfg.addService(CompFactory.ClassIDSvc(CLIDDBFiles = [
'clid.db',
'Gaudi_clid.db']))
291 cfg.addService(CompFactory.AlgContextSvc(BypassIncidents=
True))
292 cfg.addAuditor(CompFactory.AlgContextAuditor())
294 cfg.addService(CompFactory.StoreGateSvc(Dump=flags.Debug.DumpEvtStore))
295 cfg.addService(CompFactory.StoreGateSvc(
"DetectorStore",Dump=flags.Debug.DumpDetStore))
296 cfg.addService(CompFactory.StoreGateSvc(
"HistoryStore"))
297 cfg.addService(CompFactory.StoreGateSvc(
"ConditionStore",Dump=flags.Debug.DumpCondStore))
301 from AthenaConfiguration.FPEAndCoreDumpConfig
import FPEAndCoreDumpCfg
307 cfg.addService(CompFactory.ExceptionSvc(Catch=
"NONE"))
310 cfg.setAppProperty(
'AuditAlgorithms',
True)
311 cfg.setAppProperty(
'InitializationLoopCheck',
False)
312 cfg.setAppProperty(
'EvtMax', flags.Exec.MaxEvents)
313 if flags.Exec.OutputLevel > INFO:
315 cfg.setAppProperty(
'AppName',
'')
316 cfg.setAppProperty(
'OutputLevel', flags.Exec.OutputLevel)
318 if flags.Exec.DebugStage !=
"":
319 cfg.setDebugStage(flags.Exec.DebugStage)
321 cfg.interactive=flags.Exec.Interactive
323 if flags.Concurrency.NumProcs > 0:
327 if flags.Concurrency.NumThreads > 0:
328 if flags.Exec.MTEventService:
333 cfg.addAuditor( CompFactory.SGCommitAuditor() )
334 elif LoopMgr ==
'AthenaEventLoopMgr':
338 if flags.PerfMon.doFastMonMT
or flags.PerfMon.doFullMonMT:
339 from PerfMonComps.PerfMonCompsConfig
import PerfMonMTSvcCfg
342 if flags.PerfMon.doGPerfProf:
343 from PerfMonGPerfTools.GPT_ProfilerServiceConfig
import GPT_ProfilerServiceCfg
346 if len(flags.PerfMon.Valgrind.ProfiledAlgs)>0:
347 from Valkyrie.ValkyrieConfig
import ValgrindServiceCfg
354 """ComponentAccumulator-based equivalent of:
355 import AthenaCommon.AtlasUnixGeneratorJob
357 NB Must have set flags.Input.RunNumbers and
358 flags.Input.TimeStamps before calling to avoid
359 attempted auto-configuration from an input file.
362 from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
371 if __name__==
"__main__":
372 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
375 flags.Input.RunNumbers = [284500]
376 flags.Input.TimeStamps = [1]
378 except ModuleNotFoundError: