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)
22 if flags.Debug.NameAuditor:
23 cfg.addAuditor(CompFactory.NameAuditor())
28 kwargs.setdefault(
"CheckDependencies", flags.Scheduler.CheckDependencies)
29 kwargs.setdefault(
"CheckOutputUsage", flags.Scheduler.CheckOutputUsage)
30 kwargs.setdefault(
"ShowDataDependencies", flags.Scheduler.ShowDataDeps)
31 kwargs.setdefault(
"ShowDataFlow", flags.Scheduler.ShowDataFlow)
32 kwargs.setdefault(
"ShowControlFlow", flags.Scheduler.ShowControlFlow)
33 kwargs.setdefault(
"VerboseSubSlots", flags.Scheduler.EnableVerboseViews)
34 kwargs.setdefault(
"ThreadPoolSize", flags.Concurrency.NumThreads)
35 kwargs.setdefault(
"DataDepsGraphFile", flags.Scheduler.DataDepsGraphFile)
36 kwargs.setdefault(
"DataDepsGraphAlgPattern", flags.Scheduler.DataDepsGraphAlgPattern)
37 kwargs.setdefault(
"DataDepsGraphObjectPattern", flags.Scheduler.DataDepsGraphObjectPattern)
38 kwargs.setdefault(
"NumOffloadThreads", flags.Concurrency.NumOffloadThreads)
41 scheduler = CompFactory.AvalancheSchedulerSvc(**kwargs)
42 cfg.addService(scheduler, primary=
True)
44 from SGComps.SGInputLoaderConfig
import SGInputLoaderCfg
48 inputloader_ca =
SGInputLoaderCfg(flags, FailIfNoProxy=flags.Input.FailOnUnknownCollections)
49 cfg.merge(inputloader_ca, sequenceName=
"AthAlgSeq")
53 if flags.Scheduler.AutoLoadUnmetDependencies:
54 scheduler.DataLoaderAlg = inputloader_ca.getPrimary().
getName()
61 if flags.Concurrency.NumThreads > 0
and flags.Scheduler.CheckOutputUsage:
68 elmgr = CompFactory.AthenaEventLoopMgr(EventPrintoutInterval = flags.Exec.EventPrintoutInterval)
69 if flags.Input.OverrideRunNumber:
70 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
73 if flags.Common.isOverlay:
74 if not flags.Overlay.DataOverlay:
75 elmgr.RequireInputAttributeList =
True
76 elmgr.UseSecondaryEventNumber =
True
78 cfg.addService( elmgr )
84 """Sets up an MPIHive EventLoopMgr along with it's dependencies"""
85 from SQLiteDBSvc.SQLiteDBSvcConfig
import SQLiteDBSvcCfg
87 nConcurrentEvents = flags.Concurrency.NumConcurrentEvents
88 nThreads = flags.Concurrency.NumThreads
90 hivesvc = CompFactory.SG.HiveMgrSvc(
"EventDataSvc", NSlots=nConcurrentEvents)
91 cfg.addService(hivesvc)
93 arp = CompFactory.AlgResourcePool(
94 TopAlg=[
"AthMasterSeq"]
98 scheduler = cfg.getPrimaryAndMerge(
102 cfg.merge(
SQLiteDBSvcCfg(flags, name=
"LogDBSvc", dbPath=
"mpilog.db"))
103 cfg.addService(CompFactory.MPIClusterSvc(
"ClusterSvc", LogDatabaseSvc=
"LogDBSvc"))
104 elmgr = CompFactory.MPIHiveEventLoopMgr(
105 MPIClusterSvc=
"ClusterSvc",
106 WhiteboardSvc=
"EventDataSvc",
107 SchedulerSvc=scheduler.getName(),
108 FirstEventIndex=flags.Exec.SkipEvents,
111 from AthenaServices.OutputStreamSequencerSvcConfig
import (
112 OutputStreamSequencerSvcCfg,
117 flags, incidentName=
"BeginInputFile", reportingOn=
False, replaceRangeMode=
True
120 if flags.Input.OverrideRunNumber:
121 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
125 if flags.Common.isOverlay
and not flags.Overlay.DataOverlay:
126 elmgr.RequireInputAttributeList =
True
127 elmgr.UseSecondaryEventNumber =
True
129 cfg.addService(elmgr)
135 hivesvc = CompFactory.SG.HiveMgrSvc(
"EventDataSvc",
136 NSlots = flags.Concurrency.NumConcurrentEvents)
137 cfg.addService( hivesvc )
139 arp = CompFactory.AlgResourcePool(TopAlg = [
"AthMasterSeq"])
140 cfg.addService( arp )
144 elmgr = CompFactory.AthenaHiveEventLoopMgr(
145 WhiteboardSvc =
"EventDataSvc",
146 SchedulerSvc = scheduler.getName(),
147 EventPrintoutInterval = flags.Exec.EventPrintoutInterval)
149 if flags.Input.OverrideRunNumber:
150 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
153 if flags.Common.isOverlay
and not flags.Overlay.DataOverlay:
154 elmgr.RequireInputAttributeList =
True
155 elmgr.UseSecondaryEventNumber =
True
157 cfg.addService( elmgr )
163 if flags.Common.isOverlay
and not flags.Overlay.DataOverlay:
164 elmgr = CompFactory.AthenaEventLoopMgr(EventPrintoutInterval = flags.Exec.EventPrintoutInterval)
165 elmgr.RequireInputAttributeList =
True
166 elmgr.UseSecondaryEventNumber =
True
167 cfg.addService( elmgr )
169 from AthenaMP.AthenaMPConfig
import AthenaMPCfg
179 hivesvc = CompFactory.SG.HiveMgrSvc(
"EventDataSvc",
180 NSlots = flags.Concurrency.NumConcurrentEvents)
181 cfg.addService( hivesvc )
183 arp = CompFactory.AlgResourcePool(TopAlg = [
"AthMasterSeq"])
184 cfg.addService( arp )
188 elmgr = CompFactory.AthenaMtesEventLoopMgr(
189 WhiteboardSvc =
"EventDataSvc",
190 SchedulerSvc = scheduler.getName(),
191 EventRangeChannel = channel,
192 EventPrintoutInterval = flags.Exec.EventPrintoutInterval)
194 if flags.Input.OverrideRunNumber:
195 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
198 if flags.Common.isOverlay
and not flags.Overlay.DataOverlay:
199 elmgr.RequireInputAttributeList =
True
200 elmgr.UseSecondaryEventNumber =
True
203 from AthenaServices.OutputStreamSequencerSvcConfig
import OutputStreamSequencerSvcCfg
205 incidentName=
"NextEventRange",
208 cfg.addService( elmgr )
215 msgsvc = CompFactory.MessageSvc()
216 msgsvc.OutputLevel = flags.Exec.OutputLevel
217 msgsvc.Format =
"% F%{:d}W%C%7W%R%T %0W%M".
format(flags.Common.MsgSourceLength)
218 msgsvc.enableSuppression = flags.Common.MsgSuppression
219 if flags.Common.ShowMsgStats:
220 msgsvc.showStats =
True
222 msgsvc.statLevel = WARNING
224 from AthenaConfiguration.Enums
import ProductionStep
225 if flags.Common.ProductionStep
not in [ProductionStep.Default, ProductionStep.Reconstruction, ProductionStep.Derivation]:
226 msgsvc.Format =
"% F%18W%S%7W%R%T %0W%M"
227 if flags.Concurrency.NumThreads>0:
228 msgsvc.Format =
"% F%{:d}W%C%6W%R%e%s%8W%R%T %0W%M".
format(flags.Common.MsgSourceLength)
229 if flags.Exec.VerboseMessageComponents:
230 msgsvc.verboseLimit=0
231 if flags.Exec.DebugMessageComponents:
233 if flags.Exec.InfoMessageComponents:
235 if flags.Exec.WarningMessageComponents:
236 msgsvc.warningLimit=0
237 if flags.Exec.ErrorMessageComponents:
240 cfg.addService(msgsvc)
245 """Add the standard sequences to cfg"""
248 AthSequencer = CompFactory.AthSequencer
249 cfg.addSequence(
AthSequencer(
'AthAlgEvtSeq', Sequential=
True, StopOverride=
True), parentName=
'AthMasterSeq')
250 cfg.addSequence(
AthSequencer(
'AthOutSeq', StopOverride=
True), parentName=
'AthMasterSeq')
252 cfg.addSequence(
AthSequencer(
'AthBeginSeq', Sequential=
True), parentName=
'AthAlgEvtSeq')
253 cfg.addSequence(
AthSequencer(
'AthAllAlgSeq', StopOverride=
True), parentName=
'AthAlgEvtSeq')
255 athAlgSeq =
AthSequencer(
'AthAlgSeq', IgnoreFilterPassed=
True, StopOverride=
True, ProcessDynamicDataDependencies=
True, ExtraDataForDynamicConsumers=[])
256 athCondSeq =
AthSequencer(
'AthCondSeq',StopOverride=
True)
258 if flags.Concurrency.NumThreads==0:
260 cfg.addSequence(athCondSeq, parentName=
'AthAllAlgSeq')
261 cfg.addSequence(athAlgSeq, parentName=
'AthAllAlgSeq')
267 cfg.addSequence(athAlgSeq, parentName=
'AthAllAlgSeq')
268 cfg.addSequence(athCondSeq, parentName=
'AthAllAlgSeq')
270 cfg.addSequence(
AthSequencer(
'AthEndSeq', Sequential=
True), parentName=
'AthAlgEvtSeq')
273 AthIncFirerAlg = CompFactory.AthIncFirerAlg
274 IncidentProcAlg = CompFactory.IncidentProcAlg
276 previousPerfmonDomain = cfg.getCurrentPerfmonDomain()
277 cfg.flagPerfmonDomain(
'Incidents')
279 cfg.addEventAlgo(
AthIncFirerAlg(
"BeginIncFiringAlg", FireSerial=
False, Incidents=[
'BeginEvent']),
280 sequenceName=
'AthBeginSeq')
282 cfg.addEventAlgo(IncidentProcAlg(
'IncidentProcAlg1'),
283 sequenceName=
'AthBeginSeq')
285 cfg.addEventAlgo(
AthIncFirerAlg(
'EndIncFiringAlg', FireSerial=
False, Incidents=[
'EndEvent']),
286 sequenceName=
"AthEndSeq")
288 cfg.addEventAlgo(IncidentProcAlg(
'IncidentProcAlg2'),
289 sequenceName=
"AthEndSeq")
292 cfg.addEventAlgo(
AthIncFirerAlg(
'EndAlgorithmsFiringAlg', FireSerial=
False, Incidents=[
'EndAlgorithms']),
293 sequenceName=
"AthMasterSeq")
295 cfg.addEventAlgo(IncidentProcAlg(
'IncidentProcAlg3'),
296 sequenceName=
"AthMasterSeq")
298 cfg.flagPerfmonDomain(previousPerfmonDomain)
302 from GeneratorConfig.Sequences
import EvgenSequence, EvgenSequenceFactory
314 from AthenaCommon.Logging
import log
315 log.setLevel(flags.Exec.OutputLevel)
317 if flags.Exec.Interactive ==
"run":
318 LoopMgr=
"PyAthenaEventLoopMgr"
319 log.info(
"Interactive mode, switching to %s", LoopMgr)
322 if flags.Concurrency.NumThreads > 0:
323 if flags.Concurrency.NumConcurrentEvents==0:
324 raise Exception(
"Requested Concurrency.NumThreads>0 and Concurrency.NumConcurrentEvents==0, "
325 "which will not process events!")
326 if flags.Exec.MTEventService:
327 LoopMgr =
"AthenaMtesEventLoopMgr"
329 LoopMgr =
"MPIHiveEventLoopMgr"
331 LoopMgr =
"AthenaHiveEventLoopMgr"
333 if flags.Concurrency.NumProcs > 0:
334 LoopMgr =
"AthMpEvtLoopMgr"
343 cfg.addService(CompFactory.ClassIDSvc(CLIDDBFiles = [
'clid.db',
'Gaudi_clid.db']))
345 cfg.addService(CompFactory.AlgContextSvc(BypassIncidents=
True))
346 cfg.addAuditor(CompFactory.AlgContextAuditor())
348 cfg.addService(CompFactory.StoreGateSvc(Dump=flags.Debug.DumpEvtStore))
349 cfg.addService(CompFactory.StoreGateSvc(
"DetectorStore",Dump=flags.Debug.DumpDetStore))
350 cfg.addService(CompFactory.StoreGateSvc(
"HistoryStore"))
351 cfg.addService(CompFactory.StoreGateSvc(
"ConditionStore",Dump=flags.Debug.DumpCondStore))
355 from AthenaConfiguration.FPEAndCoreDumpConfig
import FPEAndCoreDumpCfg
361 cfg.addService(CompFactory.ExceptionSvc(Catch=
"NONE"))
364 cfg.setAppProperty(
'AuditAlgorithms',
True)
365 cfg.setAppProperty(
'InitializationLoopCheck',
False)
366 cfg.setAppProperty(
'EvtMax', flags.Exec.MaxEvents)
367 if flags.Exec.OutputLevel > INFO:
369 cfg.setAppProperty(
'AppName',
'')
370 cfg.setAppProperty(
'OutputLevel', flags.Exec.OutputLevel)
372 if flags.Exec.DebugStage !=
"":
373 cfg.setDebugStage(flags.Exec.DebugStage)
375 cfg.interactive=flags.Exec.Interactive
377 if flags.Concurrency.NumProcs > 0:
381 if flags.Concurrency.NumThreads > 0:
382 if flags.Exec.MTEventService:
389 cfg.addAuditor( CompFactory.SGCommitAuditor() )
390 elif LoopMgr ==
'AthenaEventLoopMgr':
394 if flags.PerfMon.doFastMonMT
or flags.PerfMon.doFullMonMT:
395 from PerfMonComps.PerfMonCompsConfig
import PerfMonMTSvcCfg
398 if flags.PerfMon.doGPerfProf:
399 from PerfMonGPerfTools.GPT_ProfilerServiceConfig
import GPT_ProfilerServiceCfg
402 if len(flags.PerfMon.Valgrind.ProfiledAlgs)>0:
403 from Valkyrie.ValkyrieConfig
import ValgrindServiceCfg
410 """ComponentAccumulator-based equivalent of:
411 import AthenaCommon.AtlasUnixGeneratorJob
413 NB Must have set flags.Input.RunNumbers and
414 flags.Input.TimeStamps before calling to avoid
415 attempted auto-configuration from an input file.
418 from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
428 """Job options service configuration - mainly to dump the config."""
430 acc.addService(CompFactory.JobOptionsSvc(DUMPFILE=fileName))
434 if __name__==
"__main__":
435 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
438 flags.Input.RunNumbers = [284500]
439 flags.Input.TimeStamps = [1]
441 except ModuleNotFoundError: