CMS 3D CMS Logo

FastTimer.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 def addService(process, multirun=False):
4  # remove any instance of the FastTimerService
5  if 'FastTimerService' in process.__dict__:
6  del process.FastTimerService
7 
8  # instrument the menu with the FastTimerService
9  process.load("HLTrigger.Timer.FastTimerService_cfi")
10 
11  # print a text summary at the end of the job
12  process.FastTimerService.printEventSummary = False
13  process.FastTimerService.printRunSummary = False
14  process.FastTimerService.printJobSummary = True
15 
16  # enable DQM plots
17  process.FastTimerService.enableDQM = True
18 
19  # enable per-path DQM plots (starting with CMSSW 9.2.3-patch2)
20  process.FastTimerService.enableDQMbyPath = True
21 
22  # enable per-module DQM plots
23  process.FastTimerService.enableDQMbyModule = True
24 
25  # enable DQM plots vs lumisection
26  process.FastTimerService.enableDQMbyLumiSection = True
27  process.FastTimerService.dqmLumiSectionsRange = 2500 # lumisections (23.31 s)
28 
29  # set the time resolution of the DQM plots
30  process.FastTimerService.dqmTimeRange = 1000. # ms
31  process.FastTimerService.dqmTimeResolution = 5. # ms
32  process.FastTimerService.dqmPathTimeRange = 100. # ms
33  process.FastTimerService.dqmPathTimeResolution = 0.5 # ms
34  process.FastTimerService.dqmModuleTimeRange = 40. # ms
35  process.FastTimerService.dqmModuleTimeResolution = 0.2 # ms
36 
37  # set the base DQM folder for the plots
38  process.FastTimerService.dqmPath = "HLT/TimerService"
39  process.FastTimerService.enableDQMbyProcesses = False
40 
41  if multirun:
42  # disable the per-lumisection plots
43  process.FastTimerService.enableDQMbyLumiSection = False
44 
45  return process
46 
47 def addOutput(process):
48  # save the DQM plots in the DQMIO format
49  process.dqmOutput = cms.OutputModule("DQMRootOutputModule",
50  fileName = cms.untracked.string("DQM.root")
51  )
52  process.FastTimerOutput = cms.EndPath(process.dqmOutput)
53  process.schedule.append(process.FastTimerOutput)
54 
55  return process
56 
57 def addPrint(process):
58  # enable text dump
59  if not hasattr(process,'MessageLogger'):
60  process.load('FWCore.MessageService.MessageLogger_cfi')
61  process.MessageLogger.cerr.FastReport = cms.untracked.PSet( limit = cms.untracked.int32( 10000000 ) )
62  return process
63 
64 def addHarvest(process):
65  # DQMStore service
66  if not hasattr(process,'DQMStore'):
67  process.load('DQMServices.Core.DQMStore_cfi')
68 
69  # FastTimerService client
70  process.load('HLTrigger.Timer.fastTimerServiceClient_cfi')
71  process.fastTimerServiceClient.dqmPath = "HLT/TimerService"
72 
73  # DQM file saver
74  process.load('DQMServices.Components.DQMFileSaver_cfi')
75  process.dqmSaver.workflow = "/HLT/FastTimerService/All"
76 
77  process.DQMFileSaverOutput = cms.EndPath(process.fastTimerServiceClient + process.dqmSaver)
78  process.schedule.append(process.DQMFileSaverOutput)
79 
80  return process
81 
82 # customise functions for cmsDriver
83 
85  process = addService(process)
86  process = addOutput(process)
87  return process
88 
90  process = addService(process)
91  process = addHarvest(process)
92  return process
93 
95  process = addService(process,True)
96  process = addOutput(process)
97  return process
98 
100  process = addService(process)
101  process = addPrint(process)
102  return process
103 
FastTimer.customise_timer_service
def customise_timer_service(process)
Definition: FastTimer.py:84
FastTimer.addPrint
def addPrint(process)
Definition: FastTimer.py:57
FastTimer.customise_timer_service_singlejob
def customise_timer_service_singlejob(process)
Definition: FastTimer.py:89
FastTimer.addService
def addService(process, multirun=False)
Definition: FastTimer.py:3
FastTimer.customise_timer_service_multirun
def customise_timer_service_multirun(process)
Definition: FastTimer.py:94
FastTimer.addHarvest
def addHarvest(process)
Definition: FastTimer.py:64
FastTimer.customise_timer_service_print
def customise_timer_service_print(process)
Definition: FastTimer.py:99
FastTimer.addOutput
def addOutput(process)
Definition: FastTimer.py:47