Skip to content
Snippets Groups Projects

PerfMonComps: Updates to begin/end event handling in PerfMonSvc

Merged Alaettin Serhan Mete requested to merge amete/athena:master-perfmon-20200925 into master
3 files
+ 41
12
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -5,7+5,7 @@
@@ -5,7+5,7 @@
# @author: Sebastien Binet <binet@cern.ch>
# @author: Sebastien Binet <binet@cern.ch>
## import the automatically generated Configurables
## import the automatically generated Configurables
from __future__ import print_function
from __future__ import print_function
from PerfMonComps.PerfMonCompsConf import PerfMonSvc as _PerfMonSvc
from PerfMonComps.PerfMonCompsConf import PerfMonSvc as _PerfMonSvc
import six
import six
@@ -30,7+30,7 @@
@@ -30,7+30,7 @@
from AthenaCommon.ConcurrencyFlags import jobproperties as jp
from AthenaCommon.ConcurrencyFlags import jobproperties as jp
if jp.ConcurrencyFlags.NumThreads() > 1:
if jp.ConcurrencyFlags.NumThreads() > 1:
print(" >> PerfMonSvc should NOT be used in MT>1 jobs, self removing...")
print(" >> PerfMonSvc should NOT be used in MT>1 jobs, self removing...")
if hasattr(svcMgr, 'PerfMonSvc'):
if hasattr(svcMgr, 'PerfMonSvc'):
del svcMgr.PerfMonSvc
del svcMgr.PerfMonSvc
return
return
@@ -45,7+45,7 @@
@@ -45,7+45,7 @@
if not isinstance(handle, PerfMonSvc):
if not isinstance(handle, PerfMonSvc):
return
return
from AthenaCommon import CfgMgr
## get a handle on the application manager and attach the auditors
## get a handle on the application manager
from AthenaCommon.AppMgr import theApp
from AthenaCommon.AppMgr import theApp
if not jobproperties.PerfMonFlags.doFastMon() or jobproperties.PerfMonFlags.doSemiDetailedMonitoring():
theApp.AuditAlgorithms = True
theApp.AuditAlgorithms = True
theApp.AuditTools = True
theApp.AuditTools = True
theApp.AuditServices = True
theApp.AuditServices = True
 
## For MT=1 jobs use IncidentProcAlgs to trigger begin/end event
 
if jp.ConcurrencyFlags.NumThreads() == 1:
 
handle.compBeginEvent = "IncidentProcAlg1"
 
handle.compEndEvent = "IncidentProcAlg2"
## get output levels
## get output levels
import AthenaCommon.Constants as Lvl
import AthenaCommon.Constants as Lvl
@@ -59,7 +62,7 @@ class PerfMonSvc( _PerfMonSvc ):
@@ -59,7 +62,7 @@ class PerfMonSvc( _PerfMonSvc ):
## make sure the application manager explicitly creates the service
## make sure the application manager explicitly creates the service
if hasattr(handle, "getFullJobOptName") :
if hasattr(handle, "getFullJobOptName") :
handleName = handle.getFullJobOptName()
handleName = handle.getFullJobOptName()
if not handleName in theApp.CreateSvc:
if handleName not in theApp.CreateSvc:
# we want to be the very first service to be initialized
# we want to be the very first service to be initialized
# so we can monitor what happens during initialize
# so we can monitor what happens during initialize
theApp.CreateSvc = [ handleName ] + theApp.CreateSvc
theApp.CreateSvc = [ handleName ] + theApp.CreateSvc
@@ -99,7 +102,7 @@ class PerfMonSvc( _PerfMonSvc ):
@@ -99,7 +102,7 @@ class PerfMonSvc( _PerfMonSvc ):
if isinstance( v, ( ConfigurableAlgorithm,
if isinstance( v, ( ConfigurableAlgorithm,
ConfigurableAlgTool,
ConfigurableAlgTool,
ConfigurableService ) ) \
ConfigurableService ) ) \
and not k in ('PerfMonSvc',
and k not in ('PerfMonSvc',
'AthenaEventLoopMgr',):
'AthenaEventLoopMgr',):
componentNames.append (v.getJobOptName())
componentNames.append (v.getJobOptName())
pass
pass
@@ -115,7 +118,8 @@ class PerfMonSvc( _PerfMonSvc ):
@@ -115,7 +118,8 @@ class PerfMonSvc( _PerfMonSvc ):
not jobproperties.PerfMonFlags.doFastMon()) :
not jobproperties.PerfMonFlags.doFastMon()) :
## make sure the AthenaPoolCnvSvc is correctly configured
## make sure the AthenaPoolCnvSvc is correctly configured
try: svcMgr.AthenaPoolCnvSvc.UseDetailChronoStat = True
try:
 
svcMgr.AthenaPoolCnvSvc.UseDetailChronoStat = True
except AttributeError:
except AttributeError:
# ok... maybe not a 'writeAthenaPool' job...
# ok... maybe not a 'writeAthenaPool' job...
pass
pass
@@ -129,7 +133,8 @@ class PerfMonSvc( _PerfMonSvc ):
@@ -129,7 +133,8 @@ class PerfMonSvc( _PerfMonSvc ):
if 'Streams' in Configurable.configurables:
if 'Streams' in Configurable.configurables:
outStreams = Configurable.configurables['Streams']
outStreams = Configurable.configurables['Streams']
for o in outStreams:
for o in outStreams:
if not hasattr(o, 'ItemList'): continue
if not hasattr(o, 'ItemList'):
 
continue
ioContainers += [ i for i in o.ItemList
ioContainers += [ i for i in o.ItemList
if not i.endswith("#*") ]
if not i.endswith("#*") ]
pass
pass
@@ -146,7+151,7 @@
@@ -146,7+151,7 @@
except AttributeError:
except AttributeError:
for k,v in keystore[l].items():
for k,v in keystore[l].items():
ioContainers += [ "%s#%s" % (k,c) for c in v ]
ioContainers += [ "%s#%s" % (k,c) for c in v ]
pass
pass
## collect everything
## collect everything
handle.IoContainers = ioContainers
handle.IoContainers = ioContainers
pass
pass
Loading