ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
PerformanceMonitoring
PerfMonGPerfTools
python
GPT_ProfilerServiceConfig.py
Go to the documentation of this file.
1
"""GPerfTools profiler config
2
3
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
4
"""
5
6
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
7
from
AthenaConfiguration.ComponentFactory
import
CompFactory
8
9
10
def
GPT_ProfilerServiceCfg
(flags, **kwargs):
11
"""Configure GPerfTools CPU profiler"""
12
13
ProfilerService = CompFactory.GPT.ProfilerService
14
kwargs.setdefault("ProfileFileName", "gpt-execute.profile")
15
kwargs.setdefault("InitEvent", 1)
16
17
acc = ComponentAccumulator()
18
acc.addService(ProfilerService(**kwargs), create=True)
19
acc.setAppProperty("AuditAlgorithms", True)
20
acc.setAppProperty("AuditTools", True)
21
acc.setAppProperty("AuditServices", True)
22
return acc
23
24
25
#Brief example of running profiler
26
if __name__ == "__main__":
27
from AthenaConfiguration.MainServicesConfig import MainServicesCfg
28
from AthExHelloWorld.HelloWorldConfig import HelloWorldCfg
29
from AthenaConfiguration.AllConfigFlags import initConfigFlags
30
flags = initConfigFlags()
31
flags.Exec.MaxEvents = 10
32
cfg = MainServicesCfg(flags)
33
cfg.merge(HelloWorldCfg(flags))
34
cfg.merge(GPT_ProfilerServiceCfg(flags))
35
cfg.run()
GPT_ProfilerServiceConfig.GPT_ProfilerServiceCfg
GPT_ProfilerServiceCfg(flags, **kwargs)
Definition
GPT_ProfilerServiceConfig.py:10
Generated on
for ATLAS Offline Software by
1.17.0