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
28 from AthenaCommon
import CfgMgr
29 from AthenaCommon.AppMgr
import theApp
35 theApp.EventLoop =
"PyAthenaEventLoopMgr"
38 from AthenaCommon.AppMgr
import ToolSvc, ServiceMgr, theAuditorSvc
39 theApp.setOutputLevel( globals()[opts.loglevel] )
43 if not "POOL_OUTMSG_LEVEL" in os.environ:
44 os.environ[
"POOL_OUTMSG_LEVEL" ] =
str(globals()[opts.loglevel])
47 include(
"AthenaCommon/Atlas.UnixStandardJob.py" )
48 include.block(
"AthenaCommon/Atlas.UnixStandardJob.py" )
50 from PyUtils.Helpers
import ROOT6Setup
60 from AthenaCommon.Include
import IncludeError
67 from AthenaCommon.ResourceLimits
import SetMaxLimits
70 del sys.modules[
'AthenaCommon.ResourceLimits' ]
77 atexit.register( theApp.exit )
82 _msg.info(
'executing CLI (-c) command: "%s"' % opts.command )
85 if DbgStage.value ==
"conf":
89 AthCIncMod.marker = AthCIncMod.__marker__
93 from Hephaestus.Auditor
import HephaestusAuditor
94 theApp.AuditAlgorithms =
True
95 svcMgr.AuditorSvc += HephaestusAuditor(
96 mode = opts.memchk_mode, auditOn = opts.do_leak_chk )
100 from AthenaCommon.ConcurrencyFlags
import jobproperties
as jps
101 if opts.nprocs
and (opts.nprocs >= 1
or opts.nprocs==-1):
102 jps.ConcurrencyFlags.NumProcs = opts.nprocs
103 _msg.info (
"configuring AthenaMP with [%s] sub-workers",
104 jps.ConcurrencyFlags.NumProcs())
106 if (opts.debug_worker
is True) :
107 jps.ConcurrencyFlags.DebugWorkers =
True
108 _msg.info (
" Workers will pause after fork until SIGUSR1 signal received")
110 if (opts.threads
or opts.concurrent_events) :
112 if (opts.threads
is None and opts.concurrent_events
is not None) :
114 jps.ConcurrencyFlags.NumThreads = opts.concurrent_events
115 jps.ConcurrencyFlags.NumConcurrentEvents = opts.concurrent_events
116 elif (opts.threads
is not None and opts.concurrent_events
is None) :
118 jps.ConcurrencyFlags.NumThreads = opts.threads
119 jps.ConcurrencyFlags.NumConcurrentEvents = opts.threads
122 jps.ConcurrencyFlags.NumThreads = opts.threads
123 jps.ConcurrencyFlags.NumConcurrentEvents = opts.concurrent_events
126 if (jps.ConcurrencyFlags.NumProcs() > 0) :
127 _msg.info (
"configuring hybrid AthenaMP/AthenaMT with [%s] concurrent threads and [%s] concurrent events per AthenaMP worker", jps.ConcurrencyFlags.NumThreads, jps.ConcurrencyFlags.NumConcurrentEvents)
128 elif (jps.ConcurrencyFlags.NumProcs() == 0) :
129 _msg.info (
"configuring AthenaHive with [%s] concurrent threads and [%s] concurrent events", jps.ConcurrencyFlags.NumThreads(), jps.ConcurrencyFlags.NumConcurrentEvents())
132 _msg.error (
"ConcurrencyFlags.NumProcs() cannot == -1 !!")
135 import AthenaCommon.AtlasThreadedJob