ATLAS Offline Software
Loading...
Searching...
No Matches
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.
10include( "PerfMonGPerfTools/DisablePerfMon_jobOFragment.py" ) # noqa: F821
11
12# Set up the profiler service:
13from AthenaCommon.AppMgr import ServiceMgr
14from PerfMonGPerfTools.PerfMonGPerfToolsConf import GPT__ProfilerService
15ServiceMgr += GPT__ProfilerService( "ProfilerService" )
16ServiceMgr.ProfilerService.ControlledProfiling = False
17# By default the event loop profiling only starts after 10 events
18# have already been processed:
19ServiceMgr.ProfilerService.InitEvent = 10
20ServiceMgr.ProfilerService.ProfileFileName = "gpt-execute.profile"
21
22# Set up the profiler service as the first service to be created:
23theApp.CreateSvc.insert( 0, "GPT::ProfilerService/ProfilerService" ) # noqa: F821
24
25# Print a message with what happened:
26from AthenaCommon.Logging import logging
27log = logging.getLogger( "ProfileEventLoop_preInclude" )
28log.info( "The job's event loop will get CPU profiling" )