16 def setDefaults(cls, handle):
17
18
19 from PerfMonComps.PerfMonFlags import jobproperties
20
21
22 if not jobproperties.PerfMonFlags.doMonitoringMT():
23 return
24
25
26 if not isinstance(handle, PerfMonMTSvc):
27 return
28
29
30 from AthenaCommon.AppMgr import theApp
31 theApp.AuditAlgorithms = True
32 theApp.AuditTools = True
33 theApp.AuditServices = True
34
35 from AthenaCommon.AppMgr import ServiceMgr as svcMgr
36
37 if hasattr(handle, "getFullJobOptName") :
38 handleName = handle.getFullJobOptName()
39 if handleName not in theApp.CreateSvc:
40
41 theApp.CreateSvc = [ handleName ] + theApp.CreateSvc
42
43
44 handle.jsonFileName = jobproperties.PerfMonFlags.OutputJSON()
45
46
47 import os,psutil
48 handle.wallTimeOffset = psutil.Process(os.getpid()).create_time() * 1000
49
50
51 from AthenaCommon.ConcurrencyFlags import jobproperties as jp
52 handle.numberOfThreads =
max(1,jp.ConcurrencyFlags.NumThreads())
53 handle.numberOfSlots =
max(1,jp.ConcurrencyFlags.NumConcurrentEvents())
54
55
56 if not hasattr(svcMgr, 'AuditorSvc'):
57 from GaudiCommonSvc.GaudiCommonSvcConf import AuditorSvc
58 svcMgr += AuditorSvc()
59
60
61 if jobproperties.PerfMonFlags.doFullMonMT():
62 handle.doComponentLevelMonitoring = True
63
64 return
65