Exemple #1
0
def monitoringTools(steering):
    log = logging.getLogger("monitoringTools" )
    LBNdepth=4
    if 'EF' in steering.name():
        LBNdepth = 6
    def assign_prop_value(a):
        try:
            a.LBNHistoryDepth = LBNdepth
        except:
            return False
        return True

    #try:
    #    Set = set
    #except NameError:
    #    from sets import Set
    setOfEnabled = set(TriggerFlags.enableMonitoring()) # this is set of enabled monitoring targets

    log.info("requested targets: "+str(setOfEnabled)+" pruning other tools")
    # prune subalgorithms
    for alg in steering.getChildren():
        tokeep = [ x for x in alg.AthenaMonTools if len(set(x.target()) & setOfEnabled) != 0 ]
        log.debug( "will keep "+str( [ x.getFullName() for x in tokeep ]) )
        toscratch = list(set(alg.AthenaMonTools)-set(tokeep))        
        log.debug( "will scratch "+str( [ x.getFullName() for x in toscratch ]) )
        del toscratch        
        
        [ assign_prop_value(x) for x in tokeep ]
        alg.AthenaMonTools = tokeep
        
        if "Time" in TriggerFlags.enableMonitoring() or "TimeTree" in TriggerFlags.enableMonitoring():
            alg.doTiming=True            

        if "Log" in  TriggerFlags.enableMonitoring():
            alg.OutputLevel=getHLTOutputLevel()


    # prune steering monitoring tools
    steering.pruneSteeringMonTools(TriggerFlags.enableMonitoring())
    [ assign_prop_value(x) for x in steering.MonTools  ]

    from AthenaCommon.AppMgr import ServiceMgr
    # Enable performance monitoring
    if 'PerfMon' in TriggerFlags.enableMonitoring():
        from PerfMonComps.JobOptCfg import PerfMonSvc
        jobproperties.PerfMonFlags.doMonitoring = True
        ServiceMgr += PerfMonSvc()

    log.debug("Setting up offline THistSvc")
    if not hasattr(ServiceMgr, 'THistSvc'):        
        from GaudiSvc.GaudiSvcConf import THistSvc
        ServiceMgr += THistSvc()
    if hasattr(ServiceMgr.THistSvc, "Output"): # this is offline THistSvc fo which we want to setup files
        setTHistSvcOutput(ServiceMgr.THistSvc.Output)
Exemple #2
0
    def _do_action(self):
        # install the service
        from AthenaCommon.AppMgr import ServiceMgr as svcMgr
        if not hasattr(svcMgr, 'PerfMonSvc'):
            import AthenaCommon.Constants as Lvl
            from PerfMonComps.JobOptCfg import PerfMonSvc
            svcMgr += PerfMonSvc("PerfMonSvc", OutputLevel=Lvl.INFO)
            pass

        ## activate persistency monitoring too
        jobproperties.PerfMonFlags.doPersistencyMonitoring = True
        #jobproperties.PerfMonFlags.doMallocMonitoring = True
        jobproperties.PerfMonFlags.doDsoMonitoring = True
        #svcMgr.PerfMonSvc.MonLvl = 1

        return
MessageSvc.Format = "% F%40W%S%7W%R%T %0W%M"

import glob

#Get the name of the job set by RTT extracted from xml file
#The file userJobId_log is created  before athena running
files = glob.glob('./*_log')
script = [f for f in files if f.find('script') > -1]
log = list(set(files) - set(script))
jobname = 'not set'
if len(log) == 1:
    jobname = log[0].replace('_log', '').replace('./', '')

print 'BEGIN_RTTINFO = ' + jobname
import os
com = "echo \"BEGIN_RTTINFO = " + jobname + "\">&MYRTTINFOS.txt"
os.system(com)

from PerfMonComps.PerfMonFlags import jobproperties
jobproperties.PerfMonFlags.doMonitoring = True

from PerfMonComps.JobOptCfg import PerfMonSvc
svcMgr += PerfMonSvc()

jobproperties.PerfMonFlags.doDetailedMonitoring = True

import os
os.system('get_files perfmon.py')

ByteStreamInputSvc = svcMgr.ByteStreamInputSvc
svcMgr.MessageSvc.statLevel=WARNING
svcMgr.MessageSvc.enableSuppression = True
#--------------------------------------------------------------  
## switch on LSFTimeKeeperSvc 
#---------------------------------------------------------------------------  
if MuonDQAFlags.doTimeLimit:
   include ("LSFTimeKeeper/LSFTimeKeeperOptions.py")
   LSFTimeKeeperSvc= Service("LSFTimeKeeperSvc")
   LSFTimeKeeperSvc.OutputLevel=DEBUG
#--------------------------------------------------------------  
# Load Performance monitoring Service
# -------------------------------------------------------------
if MuonDQAFlags.doMuonDQAPerfMonitoring:
    from PerfMonComps.PerfMonFlags import jobproperties
    jobproperties.PerfMonFlags.doMonitoring = True
    jobproperties.PerfMonFlags.doPersistencyMonitoring = True
    jobproperties.PerfMonFlags.OutputFile = "muonsegmmon.perfmon.pmon.gz"
    from PerfMonComps.JobOptCfg import PerfMonSvc
    svcMgr += PerfMonSvc( "PerfMonSvc", OutputLevel = INFO )
 
#--------------------------------------------------------------
# Dump configuration to file
#--------------------------------------------------------------
import os
if MuonDQAFlags.doDumpFile:
   f = open("MuonSegmMonitoring_config.txt",'w')
   f.write( str(ServiceMgr) + os.linesep )
   f.write( str(ToolSvc) + os.linesep )
   f.write( str(topSequence) + os.linesep )
   f.close()
if not 'doMonitoring' in dir():
    doMonitoring = True
    pass
from PerfMonComps.PerfMonFlags import jobproperties

jobproperties.PerfMonFlags.doMonitoring = doMonitoring
jobproperties.PerfMonFlags.doPersistencyMonitoring = True

###############################
# Load perf service
###############################
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from PerfMonComps.JobOptCfg import PerfMonSvc

svcMgr += PerfMonSvc("PerfMonSvc", OutputLevel=VERBOSE)

#--------------------------------------------------------------
# General Application Configuration options
#--------------------------------------------------------------
import AthenaCommon.AtlasUnixGeneratorJob

from AthenaCommon.Constants import VERBOSE, DEBUG, INFO, WARNING, ERROR
from AthenaCommon.AlgSequence import AlgSequence

topSequence = AlgSequence()

#--------------------------------------------------------------
# Event related parameters
#--------------------------------------------------------------
if not 'EVTMAX' in dir():
Exemple #6
0
# @file: PerfMonComps/PerfMonSvc_jobOptions.py
# @author: Sebastien Binet
# $Id: PerfMonSvc_jobOptions.py,v 1.3 2007-08-01 20:58:52 binet Exp $

###############################
# Load PerfMonSvc
###############################
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
if not hasattr(svcMgr, 'PerfMonSvc'):
    from PerfMonComps.JobOptCfg import PerfMonSvc
    svcMgr += PerfMonSvc( "PerfMonSvc" )
    pass
            
# uncomment the following to activate PerfMonSvc:
## from PerfMonComps.PerfMonFlags import jobproperties
## jobproperties.PerfMonFlags.doMonitoring = True

Exemple #7
0
###############################
# Load perf service
###############################
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from PerfMonComps.JobOptCfg import PerfMonSvc
svcMgr += PerfMonSvc(
    "PerfMonSvc",
    OutputLevel=INFO,
    IoContainers=[
        "EventInfo#McEventInfo", "McEventCollection#TruthEvent",
        "DetailedTrackTruthCollection#DetailedTrackTruth",
        "InDet::PixelClusterContainer#PixelClusters",
        "InDet::SCT_ClusterContainer#SCT_Clusters",
        "InDet::TRT_DriftCircleContainer#TRT_DriftCircles",
        "Rec::TrackParticleContainer#TrackParticleCandidate",
        "TrackParticleTruthVector#TrackParticleTruthCollection",
        "Trk::PRD_MultiTruthCollection#PRD_MultiTruthPixel",
        "Trk::PRD_MultiTruthCollection#PRD_MultiTruthSCT",
        "Trk::PRD_MultiTruthCollection#PRD_MultiTruthTRT",
        "Trk::SegmentCollection#TRTSegments",
        "Trk::TrackCollection#ExtendedTracks",
        "Trk::TrackTruthCollection#TrackTruthCollection",
        "Trk::VxContainer#VxPrimaryCandidate"
    ])

################################################################
# Steer InDetRec job
#--------------------------------------------------------------
# Control
#--------------------------------------------------------------
Exemple #8
0
from PerfMonComps.PerfMonFlags import jobproperties

jobproperties.PerfMonFlags.doMonitoring = doMonitoring
jobproperties.PerfMonFlags.doPersistencyMonitoring = True
jobproperties.PerfMonFlags.doDetailedMonitoring = True

###############################
# Load perf service
###############################
from AthenaCommon.AppMgr import ServiceMgr as svcMgr
from PerfMonComps.JobOptCfg import PerfMonSvc

svcMgr += PerfMonSvc("PerfMonSvc",
                     OutputLevel=INFO,
                     IoContainers=[
                         "EventInfo#McEventInfo", "AthExParticles#Particles",
                         "AthExDecay#TwoBodyDecay",
                         "AthExElephantino#PinkElephantino"
                     ])

#--------------------------------------------------------------
# General Application Configuration options
#--------------------------------------------------------------
import AthenaCommon.AtlasUnixGeneratorJob

from AthenaCommon.Constants import VERBOSE, DEBUG, INFO, WARNING, ERROR
from AthenaCommon.AlgSequence import AlgSequence

topSequence = AlgSequence()

#--------------------------------------------------------------