ATLAS Offline Software
ProfileEventLoop_preInclude.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2 
3 # $Id: ProfileEventLoop_preInclude.py 496380 2012-04-18 12:28:09Z ritsch $
4 #
5 # This jobO fragment can be pre-included in Reco_trf.py jobs to profile
6 # just the event loop of those jobs with GPT.
7 #
8 
9 # First off, let's disable PerfMon. It doesn't mix well with GPT.
10 include( "PerfMonGPerfTools/DisablePerfMon_jobOFragment.py" ) # noqa: F821
11 
12 # Set up the profiler service:
13 from AthenaCommon.AppMgr import ServiceMgr
14 from PerfMonGPerfTools.PerfMonGPerfToolsConf import GPT__ProfilerService
15 ServiceMgr += GPT__ProfilerService( "ProfilerService" )
16 ServiceMgr.ProfilerService.ControlledProfiling = False
17 # By default the event loop profiling only starts after 10 events
18 # have already been processed:
19 ServiceMgr.ProfilerService.InitEvent = 10
20 ServiceMgr.ProfilerService.ProfileFileName = "gpt-execute.profile"
21 
22 # Set up the profiler service as the first service to be created:
23 theApp.CreateSvc.insert( 0, "GPT::ProfilerService/ProfilerService" ) # noqa: F821
24 
25 # Print a message with what happened:
26 from AthenaCommon.Logging import logging
27 log = logging.getLogger( "ProfileEventLoop_preInclude" )
28 log.info( "The job's event loop will get CPU profiling" )
python.Include.include
include
Definition: Include.py:318