2import AthenaCommon.Include
as AthCIncMod
4 AthCIncMod.marker =
' -#-'
8 from AthenaCommon.Interactive
import configureInteractivePrompt
9 configureInteractivePrompt()
10 del configureInteractivePrompt
13from AthenaCommon.Debugging
import hookDebugger, allowPtrace
27from AthenaCommon
import CfgMgr
28from AthenaCommon.AppMgr
import ( athAlgSeq, theApp, ToolSvc, theAuditorSvc,
29 ServiceMgr, ServiceMgr
as svcMgr )
30from AthenaCommon.Logging
import log
35 theApp.EventLoop =
"PyAthenaEventLoopMgr"
38theApp.setOutputLevel( globals()[opts.loglevel] )
42if not "POOL_OUTMSG_LEVEL" in os.environ:
43 os.environ[
"POOL_OUTMSG_LEVEL" ] = str(globals()[opts.loglevel])
46import AthenaCommon.AtlasUnixStandardJob
48from PyUtils.Helpers
import ROOTSetup
49ROOTSetup(batch=
not opts.interactive)
62ROOT.gROOT.SetBatch(
not opts.interactive)
71from AthenaCommon.Include
import IncludeError
73 include(
"$HOME/.athenarc" )
78from AthenaCommon.ResourceLimits
import SetMaxLimits
81del sys.modules[
'AthenaCommon.ResourceLimits' ]
88 atexit.register( theApp.exit )
93 _msg.info(
'executing CLI (-c) command: "%s"' % opts.command )
96if DbgStage.value ==
"conf":
100 AthCIncMod.marker = AthCIncMod.__marker__
105from AthenaCommon.ConcurrencyFlags
import jobproperties
as jps
106if opts.nprocs
and (opts.nprocs >= 1
or opts.nprocs==-1):
109 _msg.error(
"Cannot run AthenaMP with MPI")
111 jps.ConcurrencyFlags.NumProcs = opts.nprocs
112 _msg.info (
"configuring AthenaMP with [%s] sub-workers",
113 jps.ConcurrencyFlags.NumProcs())
115 if (opts.debug_worker
is True) :
116 jps.ConcurrencyFlags.DebugWorkers =
True
117 _msg.info (
" Workers will pause after fork until SIGUSR1 signal received")
119if (opts.threads
or opts.concurrent_events) :
121 if (opts.threads
is None and opts.concurrent_events
is not None) :
123 jps.ConcurrencyFlags.NumThreads = opts.concurrent_events
124 jps.ConcurrencyFlags.NumConcurrentEvents = opts.concurrent_events
125 elif (opts.threads
is not None and opts.concurrent_events
is None) :
127 jps.ConcurrencyFlags.NumThreads = opts.threads
128 jps.ConcurrencyFlags.NumConcurrentEvents = opts.threads
131 jps.ConcurrencyFlags.NumThreads = opts.threads
132 jps.ConcurrencyFlags.NumConcurrentEvents = opts.concurrent_events
135 if (jps.ConcurrencyFlags.NumProcs() > 0) :
136 _msg.info (
"configuring hybrid AthenaMP/AthenaMT with [%s] concurrent threads and [%s] concurrent events per AthenaMP worker", jps.ConcurrencyFlags.NumThreads, jps.ConcurrencyFlags.NumConcurrentEvents)
137 elif (jps.ConcurrencyFlags.NumProcs() == 0) :
138 _msg.info (
"configuring AthenaHive with [%s] concurrent threads and [%s] concurrent events", jps.ConcurrencyFlags.NumThreads(), jps.ConcurrencyFlags.NumConcurrentEvents())
141 _msg.error (
"ConcurrencyFlags.NumProcs() cannot == -1 !!")
144 import AthenaCommon.AtlasThreadedJob