2 import AthenaCommon.Include
as AthCIncMod
4 AthCIncMod.marker =
' -#-'
8 from AthenaCommon.Interactive
import configureInteractivePrompt
10 del configureInteractivePrompt
13 from AthenaCommon.Debugging
import hookDebugger, allowPtrace
27 from AthenaCommon
import CfgMgr
28 from AthenaCommon.AppMgr
import ( athAlgSeq, theApp, ToolSvc, theAuditorSvc,
29 ServiceMgr, ServiceMgr
as svcMgr )
30 from AthenaCommon.Logging
import log
35 theApp.EventLoop =
"PyAthenaEventLoopMgr"
38 theApp.setOutputLevel( globals()[opts.loglevel] )
42 if not "POOL_OUTMSG_LEVEL" in os.environ:
43 os.environ[
"POOL_OUTMSG_LEVEL" ] =
str(globals()[opts.loglevel])
46 import AthenaCommon.AtlasUnixStandardJob
48 from PyUtils.Helpers
import ROOT6Setup
62 ROOT.gROOT.SetBatch(
not opts.interactive)
71 from AthenaCommon.Include
import IncludeError
78 from AthenaCommon.ResourceLimits
import SetMaxLimits
81 del sys.modules[
'AthenaCommon.ResourceLimits' ]
88 atexit.register( theApp.exit )
93 _msg.info(
'executing CLI (-c) command: "%s"' % opts.command )
96 if DbgStage.value ==
"conf":
100 AthCIncMod.marker = AthCIncMod.__marker__
104 from Hephaestus.Auditor
import HephaestusAuditor
105 theApp.AuditAlgorithms =
True
106 svcMgr.AuditorSvc += HephaestusAuditor(
107 mode = opts.memchk_mode, auditOn = opts.do_leak_chk )
111 from AthenaCommon.ConcurrencyFlags
import jobproperties
as jps
112 if opts.nprocs
and (opts.nprocs >= 1
or opts.nprocs==-1):
113 jps.ConcurrencyFlags.NumProcs = opts.nprocs
114 _msg.info (
"configuring AthenaMP with [%s] sub-workers",
115 jps.ConcurrencyFlags.NumProcs())
117 if (opts.debug_worker
is True) :
118 jps.ConcurrencyFlags.DebugWorkers =
True
119 _msg.info (
" Workers will pause after fork until SIGUSR1 signal received")
121 if (opts.threads
or opts.concurrent_events) :
123 if (opts.threads
is None and opts.concurrent_events
is not None) :
125 jps.ConcurrencyFlags.NumThreads = opts.concurrent_events
126 jps.ConcurrencyFlags.NumConcurrentEvents = opts.concurrent_events
127 elif (opts.threads
is not None and opts.concurrent_events
is None) :
129 jps.ConcurrencyFlags.NumThreads = opts.threads
130 jps.ConcurrencyFlags.NumConcurrentEvents = opts.threads
133 jps.ConcurrencyFlags.NumThreads = opts.threads
134 jps.ConcurrencyFlags.NumConcurrentEvents = opts.concurrent_events
137 if (jps.ConcurrencyFlags.NumProcs() > 0) :
138 _msg.info (
"configuring hybrid AthenaMP/AthenaMT with [%s] concurrent threads and [%s] concurrent events per AthenaMP worker", jps.ConcurrencyFlags.NumThreads, jps.ConcurrencyFlags.NumConcurrentEvents)
139 elif (jps.ConcurrencyFlags.NumProcs() == 0) :
140 _msg.info (
"configuring AthenaHive with [%s] concurrent threads and [%s] concurrent events", jps.ConcurrencyFlags.NumThreads(), jps.ConcurrencyFlags.NumConcurrentEvents())
143 _msg.error (
"ConcurrencyFlags.NumProcs() cannot == -1 !!")
146 import AthenaCommon.AtlasThreadedJob