2 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
3 from AthenaConfiguration.ComponentFactory
import CompFactory
8 """Mininmal basic config, just good enough for HelloWorld and alike"""
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())
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 )
82 """Sets up an MPIHive EventLoopMgr along with it's dependencies"""
83 from SQLiteDBSvc.SQLiteDBSvcConfig
import SQLiteDBSvcCfg
85 nConcurrentEvents = flags.Concurrency.NumConcurrentEvents
86 nThreads = flags.Concurrency.NumThreads
88 hivesvc = CompFactory.SG.HiveMgrSvc(
"EventDataSvc", NSlots=nConcurrentEvents)
89 cfg.addService(hivesvc)
91 arp = CompFactory.AlgResourcePool(
92 TopAlg=[
"AthMasterSeq"]
96 scheduler = cfg.getPrimaryAndMerge(
100 cfg.merge(
SQLiteDBSvcCfg(flags, name=
"LogDBSvc", dbPath=
"mpilog.db"))
101 cfg.addService(CompFactory.MPIClusterSvc(
"MPIClusterSvc", LogDatabaseSvc=
"SQLiteDBSvc/LogDBSvc"))
102 elmgr = CompFactory.MPIHiveEventLoopMgr(
103 MPIClusterSvc=
"MPIClusterSvc",
104 WhiteboardSvc=
"EventDataSvc",
105 SchedulerSvc=scheduler.getName(),
106 FirstEventIndex=flags.Exec.SkipEvents,
109 from AthenaServices.OutputStreamSequencerSvcConfig
import (
110 OutputStreamSequencerSvcCfg,
115 flags, incidentName=
"BeginInputFile", reportingOn=
False, replaceRangeMode=
True
118 if flags.Input.OverrideRunNumber:
119 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
123 if flags.Common.isOverlay
and not flags.Overlay.DataOverlay:
124 elmgr.RequireInputAttributeList =
True
125 elmgr.UseSecondaryEventNumber =
True
127 cfg.addService(elmgr)
133 hivesvc = CompFactory.SG.HiveMgrSvc(
"EventDataSvc",
134 NSlots = flags.Concurrency.NumConcurrentEvents)
135 cfg.addService( hivesvc )
137 arp = CompFactory.AlgResourcePool(TopAlg = [
"AthMasterSeq"])
138 cfg.addService( arp )
142 elmgr = CompFactory.AthenaHiveEventLoopMgr(
143 WhiteboardSvc =
"EventDataSvc",
144 SchedulerSvc = scheduler.getName(),
145 EventPrintoutInterval = flags.Exec.EventPrintoutInterval)
147 if flags.Input.OverrideRunNumber:
148 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
151 if flags.Common.isOverlay
and not flags.Overlay.DataOverlay:
152 elmgr.RequireInputAttributeList =
True
153 elmgr.UseSecondaryEventNumber =
True
155 cfg.addService( elmgr )
161 if flags.Common.isOverlay
and not flags.Overlay.DataOverlay:
162 elmgr = CompFactory.AthenaEventLoopMgr(EventPrintoutInterval = flags.Exec.EventPrintoutInterval)
163 elmgr.RequireInputAttributeList =
True
164 elmgr.UseSecondaryEventNumber =
True
165 cfg.addService( elmgr )
167 from AthenaMP.AthenaMPConfig
import AthenaMPCfg
177 hivesvc = CompFactory.SG.HiveMgrSvc(
"EventDataSvc",
178 NSlots = flags.Concurrency.NumConcurrentEvents)
179 cfg.addService( hivesvc )
181 arp = CompFactory.AlgResourcePool(TopAlg = [
"AthMasterSeq"])
182 cfg.addService( arp )
186 elmgr = CompFactory.AthenaMtesEventLoopMgr(
187 WhiteboardSvc =
"EventDataSvc",
188 SchedulerSvc = scheduler.getName(),
189 EventRangeChannel = channel,
190 EventPrintoutInterval = flags.Exec.EventPrintoutInterval)
192 if flags.Input.OverrideRunNumber:
193 from AthenaKernel.EventIdOverrideConfig
import EvtIdModifierSvcCfg
196 if flags.Common.isOverlay
and not flags.Overlay.DataOverlay:
197 elmgr.RequireInputAttributeList =
True
198 elmgr.UseSecondaryEventNumber =
True
201 from AthenaServices.OutputStreamSequencerSvcConfig
import OutputStreamSequencerSvcCfg
203 incidentName=
"NextEventRange",
206 cfg.addService( elmgr )
213 msgsvc = CompFactory.MessageSvc()
214 msgsvc.OutputLevel = flags.Exec.OutputLevel
215 msgsvc.Format =
"% F%{:d}W%C%7W%R%T %0W%M".
format(flags.Common.MsgSourceLength)
216 msgsvc.enableSuppression = flags.Common.MsgSuppression
217 if flags.Common.ShowMsgStats:
218 msgsvc.showStats =
True
220 msgsvc.statLevel = WARNING
222 from AthenaConfiguration.Enums
import ProductionStep
223 if flags.Common.ProductionStep
not in [ProductionStep.Default, ProductionStep.Reconstruction, ProductionStep.Derivation]:
224 msgsvc.Format =
"% F%18W%S%7W%R%T %0W%M"
225 if flags.Concurrency.NumThreads>0:
226 msgsvc.Format =
"% F%{:d}W%C%6W%R%e%s%8W%R%T %0W%M".
format(flags.Common.MsgSourceLength)
227 if flags.Exec.VerboseMessageComponents:
228 msgsvc.verboseLimit=0
229 if flags.Exec.DebugMessageComponents:
231 if flags.Exec.InfoMessageComponents:
233 if flags.Exec.WarningMessageComponents:
234 msgsvc.warningLimit=0
235 if flags.Exec.ErrorMessageComponents:
238 cfg.addService(msgsvc)
243 """Add the standard sequences to cfg"""
246 AthSequencer = CompFactory.AthSequencer
247 cfg.addSequence(
AthSequencer(
'AthAlgEvtSeq', Sequential=
True, StopOverride=
True), parentName=
'AthMasterSeq')
248 cfg.addSequence(
AthSequencer(
'AthOutSeq', StopOverride=
True), parentName=
'AthMasterSeq')
250 cfg.addSequence(
AthSequencer(
'AthBeginSeq', Sequential=
True), parentName=
'AthAlgEvtSeq')
251 cfg.addSequence(
AthSequencer(
'AthAllAlgSeq', StopOverride=
True), parentName=
'AthAlgEvtSeq')
253 athAlgSeq =
AthSequencer(
'AthAlgSeq', IgnoreFilterPassed=
True, StopOverride=
True, ProcessDynamicDataDependencies=
True, ExtraDataForDynamicConsumers=[])
254 athCondSeq =
AthSequencer(
'AthCondSeq',StopOverride=
True)
256 if flags.Concurrency.NumThreads==0:
258 cfg.addSequence(athCondSeq, parentName=
'AthAllAlgSeq')
259 cfg.addSequence(athAlgSeq, parentName=
'AthAllAlgSeq')
265 cfg.addSequence(athAlgSeq, parentName=
'AthAllAlgSeq')
266 cfg.addSequence(athCondSeq, parentName=
'AthAllAlgSeq')
268 cfg.addSequence(
AthSequencer(
'AthEndSeq', Sequential=
True), parentName=
'AthAlgEvtSeq')
271 AthIncFirerAlg = CompFactory.AthIncFirerAlg
272 IncidentProcAlg = CompFactory.IncidentProcAlg
274 previousPerfmonDomain = cfg.getCurrentPerfmonDomain()
275 cfg.flagPerfmonDomain(
'Incidents')
277 cfg.addEventAlgo(
AthIncFirerAlg(
"BeginIncFiringAlg", FireSerial=
False, Incidents=[
'BeginEvent']),
278 sequenceName=
'AthBeginSeq')
280 cfg.addEventAlgo(IncidentProcAlg(
'IncidentProcAlg1'),
281 sequenceName=
'AthBeginSeq')
283 cfg.addEventAlgo(
AthIncFirerAlg(
'EndIncFiringAlg', FireSerial=
False, Incidents=[
'EndEvent']),
284 sequenceName=
"AthEndSeq")
286 cfg.addEventAlgo(IncidentProcAlg(
'IncidentProcAlg2'),
287 sequenceName=
"AthEndSeq")
290 cfg.addEventAlgo(
AthIncFirerAlg(
'EndAlgorithmsFiringAlg', FireSerial=
False, Incidents=[
'EndAlgorithms']),
291 sequenceName=
"AthMasterSeq")
293 cfg.addEventAlgo(IncidentProcAlg(
'IncidentProcAlg3'),
294 sequenceName=
"AthMasterSeq")
296 cfg.flagPerfmonDomain(previousPerfmonDomain)
300 from GeneratorConfig.Sequences
import EvgenSequence, EvgenSequenceFactory
302 cfg.addSequence(
EvgenSequenceFactory(EvgenSequence.Generator), parentName=EvgenSequence.Main.value)
304 cfg.addSequence(
EvgenSequenceFactory(EvgenSequence.PreFilter), parentName=EvgenSequence.Main.value)
306 cfg.addSequence(
EvgenSequenceFactory(EvgenSequence.Filter), parentName=EvgenSequence.Main.value)
312 from AthenaCommon.Logging
import log
313 log.setLevel(flags.Exec.OutputLevel)
315 if flags.Exec.Interactive ==
"run":
316 LoopMgr=
"PyAthenaEventLoopMgr"
317 log.info(
"Interactive mode, switching to %s", LoopMgr)
320 if flags.Concurrency.NumThreads > 0:
321 if flags.Concurrency.NumConcurrentEvents==0:
322 raise Exception(
"Requested Concurrency.NumThreads>0 and Concurrency.NumConcurrentEvents==0, "
323 "which will not process events!")
324 if flags.Exec.MTEventService:
325 LoopMgr =
"AthenaMtesEventLoopMgr"
327 LoopMgr =
"MPIHiveEventLoopMgr"
329 LoopMgr =
"AthenaHiveEventLoopMgr"
331 if flags.Concurrency.NumProcs > 0:
332 LoopMgr =
"AthMpEvtLoopMgr"
341 cfg.addService(CompFactory.ClassIDSvc(CLIDDBFiles = [
'clid.db',
'Gaudi_clid.db']))
343 cfg.addService(CompFactory.AlgContextSvc(BypassIncidents=
True))
344 cfg.addAuditor(CompFactory.AlgContextAuditor())
346 cfg.addService(CompFactory.StoreGateSvc(Dump=flags.Debug.DumpEvtStore))
347 cfg.addService(CompFactory.StoreGateSvc(
"DetectorStore",Dump=flags.Debug.DumpDetStore))
348 cfg.addService(CompFactory.StoreGateSvc(
"HistoryStore"))
349 cfg.addService(CompFactory.StoreGateSvc(
"ConditionStore",Dump=flags.Debug.DumpCondStore))
353 from AthenaConfiguration.FPEAndCoreDumpConfig
import FPEAndCoreDumpCfg
359 cfg.addService(CompFactory.ExceptionSvc(Catch=
"NONE"))
362 cfg.setAppProperty(
'AuditAlgorithms',
True)
363 cfg.setAppProperty(
'InitializationLoopCheck',
False)
364 cfg.setAppProperty(
'EvtMax', flags.Exec.MaxEvents)
365 if flags.Exec.OutputLevel > INFO:
367 cfg.setAppProperty(
'AppName',
'')
368 cfg.setAppProperty(
'OutputLevel', flags.Exec.OutputLevel)
370 if flags.Exec.DebugStage !=
"":
371 cfg.setDebugStage(flags.Exec.DebugStage)
373 cfg.interactive=flags.Exec.Interactive
375 if flags.Concurrency.NumProcs > 0:
379 if flags.Exec.EventTimeOut > 0:
380 timeoutAlg = CompFactory.TimeoutAlg(
381 Timeout = flags.Exec.EventTimeOut,
383 DumpSchedulerState =
False)
384 cfg.addEventAlgo(timeoutAlg, sequenceName=
'AthBeginSeq')
387 if flags.Concurrency.NumThreads > 0:
388 if flags.Exec.MTEventService:
395 cfg.addAuditor( CompFactory.SGCommitAuditor() )
396 elif LoopMgr ==
'AthenaEventLoopMgr':
400 if flags.PerfMon.doFastMonMT
or flags.PerfMon.doFullMonMT:
401 from PerfMonComps.PerfMonCompsConfig
import PerfMonMTSvcCfg
404 if flags.PerfMon.doGPerfProf:
405 from PerfMonGPerfTools.GPT_ProfilerServiceConfig
import GPT_ProfilerServiceCfg
408 if len(flags.PerfMon.Valgrind.ProfiledAlgs)>0:
409 from Valkyrie.ValkyrieConfig
import ValgrindServiceCfg
416 """ComponentAccumulator-based equivalent of:
417 import AthenaCommon.AtlasUnixGeneratorJob
419 NB Must have set flags.Input.RunNumbers and
420 flags.Input.TimeStamps before calling to avoid
421 attempted auto-configuration from an input file.
424 if not flags.Input.Files:
425 from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
435 """Job options service configuration - mainly to dump the config."""
437 acc.addService(CompFactory.JobOptionsSvc(DUMPFILE=fileName))
441 if __name__==
"__main__":
442 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
445 flags.Input.RunNumbers = [284500]
446 flags.Input.TimeStamps = [1]
448 except ModuleNotFoundError: