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
58 from AthenaCommon.Include
import IncludeError
65 from AthenaCommon.ResourceLimits
import SetMaxLimits
68 del sys.modules[
'AthenaCommon.ResourceLimits' ]
75 atexit.register( theApp.exit )
80 _msg.info(
'executing CLI (-c) command: "%s"' % opts.command )
83 if DbgStage.value ==
"conf":
87 AthCIncMod.marker = AthCIncMod.__marker__
91 from Hephaestus.Auditor
import HephaestusAuditor
92 theApp.AuditAlgorithms =
True
93 svcMgr.AuditorSvc += HephaestusAuditor(
94 mode = opts.memchk_mode, auditOn = opts.do_leak_chk )
98 from AthenaCommon.ConcurrencyFlags
import jobproperties
as jps
99 if opts.nprocs
and (opts.nprocs >= 1
or opts.nprocs==-1):
100 jps.ConcurrencyFlags.NumProcs = opts.nprocs
101 _msg.info (
"configuring AthenaMP with [%s] sub-workers",
102 jps.ConcurrencyFlags.NumProcs())
104 if (opts.debug_worker
is True) :
105 jps.ConcurrencyFlags.DebugWorkers =
True
106 _msg.info (
" Workers will pause after fork until SIGUSR1 signal received")
108 if (opts.threads
or opts.concurrent_events) :
110 if (opts.threads
is None and opts.concurrent_events
is not None) :
112 jps.ConcurrencyFlags.NumThreads = opts.concurrent_events
113 jps.ConcurrencyFlags.NumConcurrentEvents = opts.concurrent_events
114 elif (opts.threads
is not None and opts.concurrent_events
is None) :
116 jps.ConcurrencyFlags.NumThreads = opts.threads
117 jps.ConcurrencyFlags.NumConcurrentEvents = opts.threads
120 jps.ConcurrencyFlags.NumThreads = opts.threads
121 jps.ConcurrencyFlags.NumConcurrentEvents = opts.concurrent_events
124 if (jps.ConcurrencyFlags.NumProcs() > 0) :
125 _msg.info (
"configuring hybrid AthenaMP/AthenaMT with [%s] concurrent threads and [%s] concurrent events per AthenaMP worker", jps.ConcurrencyFlags.NumThreads, jps.ConcurrencyFlags.NumConcurrentEvents)
126 elif (jps.ConcurrencyFlags.NumProcs() == 0) :
127 _msg.info (
"configuring AthenaHive with [%s] concurrent threads and [%s] concurrent events", jps.ConcurrencyFlags.NumThreads(), jps.ConcurrencyFlags.NumConcurrentEvents())
130 _msg.error (
"ConcurrencyFlags.NumProcs() cannot == -1 !!")
133 import AthenaCommon.AtlasThreadedJob