ATLAS Offline Software
MTJobOptCfg.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2 
3 # Job options configuration file for PerfMonMTSvc
4 
5 from PerfMonComps.PerfMonCompsConf import PerfMonMTSvc as _PerfMonMTSvc
6 
7 class PerfMonMTSvc ( _PerfMonMTSvc ):
8 
9  def __init__(self, name = "PerfMonMTSvc", **kwargs):
10 
11  kwargs['name'] = name
12  super( PerfMonMTSvc, self ).__init__( **kwargs )
13 
14  return
15 
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  # Be the very first service to be initialized
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 
66  pass # class PerfMonMTSvc
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
python.MTJobOptCfg.PerfMonMTSvc.setDefaults
def setDefaults(cls, handle)
Definition: MTJobOptCfg.py:16
python.MTJobOptCfg.PerfMonMTSvc.__init__
def __init__(self, name="PerfMonMTSvc", **kwargs)
Definition: MTJobOptCfg.py:9
python.MTJobOptCfg.PerfMonMTSvc
Definition: MTJobOptCfg.py:7