CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FastTimerService.cc
Go to the documentation of this file.
1 // FIXME
2 // we are by-passing the ME's when filling the plots, so we might need to call the ME's update() by hand
3 
4 
5 // C++ headers
6 #include <cmath>
7 #include <limits>
8 #include <iostream>
9 #include <iomanip>
10 #include <string>
11 #include <sstream>
12 #include <unordered_set>
13 #include <unordered_map>
14 
15 // boost headers
16 #include <boost/format.hpp>
17 
18 // CMSSW headers
35 
36 
37 // file-static methods to fill a vector of strings with "(dup.) (...)" entries
38 static
39 void fill_dups(std::vector<std::string> & dups, unsigned int size) {
40  dups.reserve(size);
41  for (unsigned int i = dups.size(); i < size; ++i)
42  dups.push_back( (boost::format("(dup.) (%d)") % i).str() );
43 }
44 
45 
47  // configuration
48  // FIXME - reimplement support for cpu time vs. real time
49  m_use_realtime( config.getUntrackedParameter<bool>( "useRealTimeClock" ) ),
50  m_enable_timing_paths( config.getUntrackedParameter<bool>( "enableTimingPaths" ) ),
51  m_enable_timing_modules( config.getUntrackedParameter<bool>( "enableTimingModules" ) ),
52  m_enable_timing_exclusive( config.getUntrackedParameter<bool>( "enableTimingExclusive" ) ),
53  m_enable_timing_summary( config.getUntrackedParameter<bool>( "enableTimingSummary" ) ),
54  m_skip_first_path( config.getUntrackedParameter<bool>( "skipFirstPath" ) ),
55  // dqm configuration
56  m_enable_dqm( config.getUntrackedParameter<bool>( "enableDQM" ) ),
57  m_enable_dqm_bypath_active( config.getUntrackedParameter<bool>( "enableDQMbyPathActive" ) ),
58  m_enable_dqm_bypath_total( config.getUntrackedParameter<bool>( "enableDQMbyPathTotal" ) ),
59  m_enable_dqm_bypath_overhead( config.getUntrackedParameter<bool>( "enableDQMbyPathOverhead" ) ),
60  m_enable_dqm_bypath_details( config.getUntrackedParameter<bool>( "enableDQMbyPathDetails" ) ),
61  m_enable_dqm_bypath_counters( config.getUntrackedParameter<bool>( "enableDQMbyPathCounters" ) ),
62  m_enable_dqm_bypath_exclusive( config.getUntrackedParameter<bool>( "enableDQMbyPathExclusive" ) ),
63  m_enable_dqm_bymodule( config.getUntrackedParameter<bool>( "enableDQMbyModule" ) ),
64  m_enable_dqm_bymoduletype( config.getUntrackedParameter<bool>( "enableDQMbyModuleType" ) ),
65  m_enable_dqm_summary( config.getUntrackedParameter<bool>( "enableDQMSummary" ) ),
66  m_enable_dqm_byls( config.getUntrackedParameter<bool>( "enableDQMbyLumiSection" ) ),
67  m_enable_dqm_bynproc( config.getUntrackedParameter<bool>( "enableDQMbyProcesses" ) ),
68  // job configuration
69  m_concurrent_runs( 0 ),
70  m_concurrent_streams( 0 ),
71  m_concurrent_threads( 0 ),
72  m_module_id( edm::ModuleDescription::invalidID() ),
73  m_dqm_eventtime_range( config.getUntrackedParameter<double>( "dqmTimeRange" ) ), // ms
74  m_dqm_eventtime_resolution( config.getUntrackedParameter<double>( "dqmTimeResolution" ) ), // ms
75  m_dqm_pathtime_range( config.getUntrackedParameter<double>( "dqmPathTimeRange" ) ), // ms
76  m_dqm_pathtime_resolution( config.getUntrackedParameter<double>( "dqmPathTimeResolution" ) ), // ms
77  m_dqm_moduletime_range( config.getUntrackedParameter<double>( "dqmModuleTimeRange" ) ), // ms
78  m_dqm_moduletime_resolution( config.getUntrackedParameter<double>( "dqmModuleTimeResolution" ) ), // ms
79  m_dqm_path( config.getUntrackedParameter<std::string>("dqmPath" ) ),
80  // description of the process(es)
81  m_process(),
82  // description of the luminosity axes
83  m_dqm_luminosity(),
84  // DQM - these are initialized at preStreamBeginRun(), to make sure the DQM service has been loaded
85  m_stream(),
86  // summary data
87  m_run_summary(),
88  m_job_summary(),
89  m_run_summary_perprocess(),
90  m_job_summary_perprocess()
91 {
92  // enable timers if required by DQM plots
100 
109 
112 
113 
122  registry.watchPostEndJob( this, & FastTimerService::postEndJob );
126  registry.watchPreEvent( this, & FastTimerService::preEvent );
127  registry.watchPostEvent( this, & FastTimerService::postEvent );
128  // watch per-path events
131  // watch per-module events if enabled
137  }
138 
139  // if requested, reserve plots for timing vs. lumisection
140  // there is no need to store the id, as it wil always be 0
141  if (m_enable_dqm_byls)
142  reserveLuminosityPlots("ls", "lumisection", "lumisection", config.getUntrackedParameter<uint32_t>("dqmLumiSectionsRange"), 1.);
143 
144 }
145 
147 {
148 }
149 
150 // reserve plots for timing vs. luminosity
151 unsigned int FastTimerService::reserveLuminosityPlots(std::string const & name, std::string const & title, std::string const & label, double range, double resolution)
152 {
153  // FIXME check that this is only called before any preStreamBeginRun
154  // FIXME check that this is not called with the same "name" twice
155  m_dqm_luminosity.push_back(LuminosityDescription(name, title, label, range, resolution));
156 
157  // resize the luminosity per event buffer
158  for (auto & stream: m_stream)
159  stream.luminosity.resize(m_dqm_luminosity.size(), 0);
160 
161  return m_dqm_luminosity.size() - 1;
162 }
163 
165 {
166  // FIXME check that this is only called before any preStreamBeginRun
167  // FIXME check that this is not called with the same "name" twice
168  m_dqm_luminosity.push_back(LuminosityDescription(name, title, label, range, resolution));
169 
170  // resize the luminosity per event buffer
171  for (auto & stream: m_stream)
172  stream.luminosity.resize(m_dqm_luminosity.size(), 0);
173 
174  return m_dqm_luminosity.size() - 1;
175 }
176 
177 // set the event luminosity
178 void FastTimerService::setLuminosity(unsigned int stream_id, unsigned int luminosity_id, double value)
179 {
180  // FIXME check that the luminosity id is valid ?
181  m_stream[stream_id].luminosity[luminosity_id] = value;
182 }
183 
185 {
186  unsigned int pid = processID(gc.processContext());
187  unsigned int rid = gc.runIndex();
188 
190 
191  // cache the names of the first and last path and endpath
192  if (m_process.size() <= pid)
193  m_process.resize(pid+1);
194  m_process[pid].name = gc.processContext()->processName();
195  if (m_skip_first_path and pid == 0) {
196  // skip the first path
197  if (tns.getTrigPaths().size() > 1) {
198  m_process[pid].first_path = tns.getTrigPaths().at(1);
199  m_process[pid].last_path = tns.getTrigPaths().back();
200  }
201  } else {
202  if (not tns.getTrigPaths().empty()) {
203  m_process[pid].first_path = tns.getTrigPaths().front();
204  m_process[pid].last_path = tns.getTrigPaths().back();
205  }
206  }
207  if (not tns.getEndPaths().empty()) {
208  m_process[pid].first_endpath = tns.getEndPaths().front();
209  m_process[pid].last_endpath = tns.getEndPaths().back();
210  }
211 
212  uint32_t size_p = tns.getTrigPaths().size();
213  uint32_t size_e = tns.getEndPaths().size();
214  uint32_t size = size_p + size_e;
215  // resize the path maps
216  for (auto & stream: m_stream)
217  if (stream.paths.size() <= pid)
218  stream.paths.resize(pid+1);
219  for (uint32_t i = 0; i < size_p; ++i) {
220  std::string const & label = tns.getTrigPath(i);
221  for (auto & stream: m_stream)
222  stream.paths[pid][label].index = i;
223  }
224  for (uint32_t i = 0; i < size_e; ++i) {
225  std::string const & label = tns.getEndPath(i);
226  for (auto & stream: m_stream)
227  stream.paths[pid][label].index = size_p + i;
228  }
229  for (auto & stream: m_stream) {
230  // resize the stream buffers to account the number of subprocesses
231  if (stream.timing_perprocess.size() <= pid)
232  stream.timing_perprocess.resize(pid+1);
233  stream.timing_perprocess[pid].paths_interpaths.assign(size + 1, 0.);
234  // resize the stream plots to account the number of subprocesses
235  if (stream.dqm_perprocess.size() <= pid)
236  stream.dqm_perprocess.resize(pid+1);
237  if (stream.dqm_perprocess_byluminosity.size() <= pid)
238  stream.dqm_perprocess_byluminosity.resize(pid+1);
239  if (stream.dqm_paths.size() <= pid)
240  stream.dqm_paths.resize(pid+1);
241  }
242  for (auto & summary: m_run_summary_perprocess) {
243  if (summary.size() <= pid)
244  summary.resize(pid+1);
245  summary[pid].paths_interpaths.assign(size + 1, 0);
246  }
247  if (m_job_summary_perprocess.size() <= pid)
248  m_job_summary_perprocess.resize(pid+1);
249  m_job_summary_perprocess[pid].paths_interpaths.assign(size + 1, 0.);
250 
251  // reset the run summaries
252  if (pid == 0)
253  m_run_summary[rid].reset();
254  m_run_summary_perprocess[rid][pid].reset();
255 
256  // associate to each path all the modules it contains
257  for (uint32_t i = 0; i < tns.getTrigPaths().size(); ++i)
258  fillPathMap( pid, tns.getTrigPath(i), tns.getTrigPathModules(i) );
259  for (uint32_t i = 0; i < tns.getEndPaths().size(); ++i)
260  fillPathMap( pid, tns.getEndPath(i), tns.getEndPathModules(i) );
261 }
262 
264 {
266  unsigned int pid = processID(sc.processContext());
267  unsigned int sid = sc.streamID().value();
268  auto & stream = m_stream[sid];
269 
270  if (not m_enable_dqm)
271  return;
272 
273  if (not edm::Service<DQMStore>().isAvailable()) {
274  // the DQMStore is not available, disable all DQM plots
275  m_enable_dqm = false;
276  return;
277  }
278 
280  uint32_t size_p = tns.getTrigPaths().size();
281  uint32_t size_e = tns.getEndPaths().size();
282  uint32_t size = size_p + size_e;
283 
284  int eventbins = (int) std::ceil(m_dqm_eventtime_range / m_dqm_eventtime_resolution);
285  int pathbins = (int) std::ceil(m_dqm_pathtime_range / m_dqm_pathtime_resolution);
286  int modulebins = (int) std::ceil(m_dqm_moduletime_range / m_dqm_moduletime_resolution);
287 
288  // define a callback that can book the histograms
289  auto bookTransactionCallback = [&, this] (DQMStore::IBooker & booker) {
290 
291  // event summary plots
292  if (m_enable_dqm_summary) {
293  // whole event
294  if (pid == 0) {
295  booker.setCurrentFolder(m_dqm_path);
296  stream.dqm.presource = booker.book1D("presource", "Pre-Source processing time", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
297  stream.dqm.presource ->StatOverflows(true);
298  stream.dqm.presource ->SetXTitle("processing time [ms]");
299  stream.dqm.source = booker.book1D("source", "Source processing time", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
300  stream.dqm.source ->StatOverflows(true);
301  stream.dqm.source ->SetXTitle("processing time [ms]");
302  stream.dqm.preevent = booker.book1D("preevent", "Pre-Event processing time", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
303  stream.dqm.preevent ->StatOverflows(true);
304  stream.dqm.preevent ->SetXTitle("processing time [ms]");
305  stream.dqm.event = booker.book1D("event", "Event processing time", eventbins, 0., m_dqm_eventtime_range)->getTH1F();
306  stream.dqm.event ->StatOverflows(true);
307  stream.dqm.event ->SetXTitle("processing time [ms]");
308  }
309 
310  // per subprocess
311  booker.setCurrentFolder(m_dqm_path + "/process " + process_name);
312  stream.dqm_perprocess[pid].preevent = booker.book1D("preevent", "Pre-Event processing time", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
313  stream.dqm_perprocess[pid].preevent ->StatOverflows(true);
314  stream.dqm_perprocess[pid].preevent ->SetXTitle("processing time [ms]");
315  stream.dqm_perprocess[pid].event = booker.book1D("event", "Event processing time", eventbins, 0., m_dqm_eventtime_range)->getTH1F();
316  stream.dqm_perprocess[pid].event ->StatOverflows(true);
317  stream.dqm_perprocess[pid].event ->SetXTitle("processing time [ms]");
318  stream.dqm_perprocess[pid].all_paths = booker.book1D("all_paths", "Paths processing time", eventbins, 0., m_dqm_eventtime_range)->getTH1F();
319  stream.dqm_perprocess[pid].all_paths ->StatOverflows(true);
320  stream.dqm_perprocess[pid].all_paths ->SetXTitle("processing time [ms]");
321  stream.dqm_perprocess[pid].all_endpaths = booker.book1D("all_endpaths", "EndPaths processing time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
322  stream.dqm_perprocess[pid].all_endpaths ->StatOverflows(true);
323  stream.dqm_perprocess[pid].all_endpaths ->SetXTitle("processing time [ms]");
324  stream.dqm_perprocess[pid].interpaths = booker.book1D("interpaths", "Time spent between paths", pathbins, 0., m_dqm_eventtime_range)->getTH1F();
325  stream.dqm_perprocess[pid].interpaths ->StatOverflows(true);
326  stream.dqm_perprocess[pid].interpaths ->SetXTitle("processing time [ms]");
327  }
328 
329  // plots by path
330  if (m_enable_timing_paths) {
331  booker.setCurrentFolder(m_dqm_path + "/process " + process_name);
332  stream.dqm_paths[pid].active_time = booker.bookProfile("paths_active_time", "Additional time spent in each path", size, -0.5, size-0.5, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
333  stream.dqm_paths[pid].active_time ->StatOverflows(true);
334  stream.dqm_paths[pid].active_time ->SetYTitle("processing time [ms]");
335  stream.dqm_paths[pid].total_time = booker.bookProfile("paths_total_time", "Total time spent in each path", size, -0.5, size-0.5, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
336  stream.dqm_paths[pid].total_time ->StatOverflows(true);
337  stream.dqm_paths[pid].total_time ->SetYTitle("processing time [ms]");
338  stream.dqm_paths[pid].exclusive_time = booker.bookProfile("paths_exclusive_time", "Exclusive time spent in each path", size, -0.5, size-0.5, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
339  stream.dqm_paths[pid].exclusive_time ->StatOverflows(true);
340  stream.dqm_paths[pid].exclusive_time ->SetYTitle("processing time [ms]");
341  stream.dqm_paths[pid].interpaths = booker.bookProfile("paths_interpaths", "Time spent between each path", size+1, -0.5, size+0.5, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
342  stream.dqm_paths[pid].interpaths ->StatOverflows(true);
343  stream.dqm_paths[pid].interpaths ->SetYTitle("processing time [ms]");
344 
345  for (uint32_t i = 0; i < size_p; ++i) {
346  std::string const & label = tns.getTrigPath(i);
347  stream.dqm_paths[pid].active_time ->GetXaxis()->SetBinLabel(i + 1, label.c_str());
348  stream.dqm_paths[pid].total_time ->GetXaxis()->SetBinLabel(i + 1, label.c_str());
349  stream.dqm_paths[pid].exclusive_time ->GetXaxis()->SetBinLabel(i + 1, label.c_str());
350  stream.dqm_paths[pid].interpaths ->GetXaxis()->SetBinLabel(i + 1, label.c_str());
351  }
352  for (uint32_t i = 0; i < size_e; ++i) {
353  std::string const & label = tns.getEndPath(i);
354  stream.dqm_paths[pid].active_time ->GetXaxis()->SetBinLabel(i + size_p + 1, label.c_str());
355  stream.dqm_paths[pid].total_time ->GetXaxis()->SetBinLabel(i + size_p + 1, label.c_str());
356  stream.dqm_paths[pid].exclusive_time ->GetXaxis()->SetBinLabel(i + size_p + 1, label.c_str());
357  stream.dqm_paths[pid].interpaths ->GetXaxis()->SetBinLabel(i + size_p + 1, label.c_str());
358  }
359  }
360 
361  // plots vs. instantaneous luminosity
362  if (not m_dqm_luminosity.empty()) {
363  if (pid == 0) {
364  // resize the plots vs. luminosity
365  stream.dqm_byluminosity.resize(m_dqm_luminosity.size());
366 
367  // whole event
368  booker.setCurrentFolder(m_dqm_path);
369  for (unsigned int i = 0; i < m_dqm_luminosity.size(); ++i) {
370  auto & plots = stream.dqm_byluminosity[i];
371  int lumibins = (int) std::ceil(m_dqm_luminosity[i].range / m_dqm_luminosity[i].resolution);
372  plots.presource = booker.bookProfile("presource_by" + m_dqm_luminosity[i].name, "Pre-Source processing time vs. " + m_dqm_luminosity[i].title, lumibins, 0., m_dqm_luminosity[i].range, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
373  plots.presource ->StatOverflows(true);
374  plots.presource ->SetXTitle(m_dqm_luminosity[i].label.c_str());
375  plots.presource ->SetYTitle("processing time [ms]");
376  plots.source = booker.bookProfile("source_by" + m_dqm_luminosity[i].name, "Source processing time vs. " + m_dqm_luminosity[i].title, lumibins, 0., m_dqm_luminosity[i].range, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
377  plots.source ->StatOverflows(true);
378  plots.source ->SetXTitle(m_dqm_luminosity[i].label.c_str());
379  plots.source ->SetYTitle("processing time [ms]");
380  plots.preevent = booker.bookProfile("preevent_by" + m_dqm_luminosity[i].name, "Pre-Event processing time vs. " + m_dqm_luminosity[i].title, lumibins, 0., m_dqm_luminosity[i].range, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
381  plots.preevent ->StatOverflows(true);
382  plots.preevent ->SetXTitle(m_dqm_luminosity[i].label.c_str());
383  plots.preevent ->SetYTitle("processing time [ms]");
384  plots.event = booker.bookProfile("event_by" + m_dqm_luminosity[i].name, "Event processing time vs. " + m_dqm_luminosity[i].title, lumibins, 0., m_dqm_luminosity[i].range, eventbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
385  plots.event ->StatOverflows(true);
386  plots.event ->SetXTitle(m_dqm_luminosity[i].label.c_str());
387  plots.event ->SetYTitle("processing time [ms]");
388  }
389  }
390 
391  // resize the plots vs. luminosity
392  stream.dqm_perprocess_byluminosity[pid].resize(m_dqm_luminosity.size());
393 
394  // per subprocess
395  booker.setCurrentFolder(m_dqm_path + "/process " + process_name);
396  for (unsigned int i = 0; i < m_dqm_luminosity.size(); ++i) {
397  auto & plots = stream.dqm_perprocess_byluminosity[pid][i];
398  int lumibins = (int) std::ceil(m_dqm_luminosity[i].range / m_dqm_luminosity[i].resolution);
399  plots.preevent = booker.bookProfile("preevent_by" + m_dqm_luminosity[i].name, "Pre-Event processing time vs. " + m_dqm_luminosity[i].title, lumibins, 0., m_dqm_luminosity[i].range, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
400  plots.preevent ->StatOverflows(true);
401  plots.preevent ->SetXTitle(m_dqm_luminosity[i].label.c_str());
402  plots.preevent ->SetYTitle("processing time [ms]");
403  plots.event = booker.bookProfile("event_by" + m_dqm_luminosity[i].name, "Event processing time vs. " + m_dqm_luminosity[i].title, lumibins, 0., m_dqm_luminosity[i].range, eventbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
404  plots.event ->StatOverflows(true);
405  plots.event ->SetXTitle(m_dqm_luminosity[i].label.c_str());
406  plots.event ->SetYTitle("processing time [ms]");
407  plots.all_paths = booker.bookProfile("all_paths_by" + m_dqm_luminosity[i].name, "Paths processing time vs. " + m_dqm_luminosity[i].title, lumibins, 0., m_dqm_luminosity[i].range, eventbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
408  plots.all_paths ->StatOverflows(true);
409  plots.all_paths ->SetXTitle(m_dqm_luminosity[i].label.c_str());
410  plots.all_paths ->SetYTitle("processing time [ms]");
411  plots.all_endpaths = booker.bookProfile("all_endpaths_by" + m_dqm_luminosity[i].name, "EndPaths processing time vs. " + m_dqm_luminosity[i].title, lumibins, 0., m_dqm_luminosity[i].range, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
412  plots.all_endpaths ->StatOverflows(true);
413  plots.all_endpaths ->SetXTitle(m_dqm_luminosity[i].label.c_str());
414  plots.all_endpaths ->SetYTitle("processing time [ms]");
415  plots.interpaths = booker.bookProfile("interpaths_by" + m_dqm_luminosity[i].name, "Time spent between paths vs. " + m_dqm_luminosity[i].title, lumibins, 0., m_dqm_luminosity[i].range, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
416  plots.interpaths ->StatOverflows(true);
417  plots.interpaths ->SetXTitle(m_dqm_luminosity[i].label.c_str());
418  plots.interpaths ->SetYTitle("processing time [ms]");
419  }
420  }
421 
422  // per-path and per-module accounting
423  if (m_enable_timing_paths) {
424  booker.setCurrentFolder(m_dqm_path + "/process " + process_name + "/Paths");
425  for (auto & keyval: stream.paths[pid]) {
426  std::string const & pathname = keyval.first;
427  PathInfo & pathinfo = keyval.second;
428 
430  pathinfo.dqm_active = booker.book1D(pathname + "_active", pathname + " active time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
431  pathinfo.dqm_active ->StatOverflows(true);
432  pathinfo.dqm_active ->SetXTitle("processing time [ms]");
433  }
434 
436  pathinfo.dqm_total = booker.book1D(pathname + "_total", pathname + " total time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
437  pathinfo.dqm_total ->StatOverflows(true);
438  pathinfo.dqm_total ->SetXTitle("processing time [ms]");
439  }
440 
442  pathinfo.dqm_premodules = booker.book1D(pathname + "_premodules", pathname + " pre-modules overhead", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
443  pathinfo.dqm_premodules ->StatOverflows(true);
444  pathinfo.dqm_premodules ->SetXTitle("processing time [ms]");
445  pathinfo.dqm_intermodules = booker.book1D(pathname + "_intermodules", pathname + " inter-modules overhead", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
446  pathinfo.dqm_intermodules ->StatOverflows(true);
447  pathinfo.dqm_intermodules ->SetXTitle("processing time [ms]");
448  pathinfo.dqm_postmodules = booker.book1D(pathname + "_postmodules", pathname + " post-modules overhead", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
449  pathinfo.dqm_postmodules ->StatOverflows(true);
450  pathinfo.dqm_postmodules ->SetXTitle("processing time [ms]");
451  pathinfo.dqm_overhead = booker.book1D(pathname + "_overhead", pathname + " overhead time", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
452  pathinfo.dqm_overhead ->StatOverflows(true);
453  pathinfo.dqm_overhead ->SetXTitle("processing time [ms]");
454  }
455 
457  // book histograms for modules-in-paths statistics
458 
459  // find histograms X-axis labels
460  uint32_t id;
461  std::vector<std::string> const & modules = ((id = tns.findTrigPath(pathname)) != tns.getTrigPaths().size()) ? tns.getTrigPathModules(id) :
462  ((id = tns.findEndPath(pathname)) != tns.getEndPaths().size()) ? tns.getEndPathModules(id) :
463  std::vector<std::string>();
464 
465  static std::vector<std::string> dup;
466  if (modules.size() > dup.size())
467  fill_dups(dup, modules.size());
468 
469  std::vector<const char *> labels(modules.size(), nullptr);
470  for (uint32_t i = 0; i < modules.size(); ++i)
471  labels[i] = (pathinfo.modules[i]) ? modules[i].c_str() : dup[i].c_str();
472 
473  // book counter histograms
474  if (m_enable_dqm_bypath_counters) {
475  pathinfo.dqm_module_counter = booker.book1D(pathname + "_module_counter", pathname + " module counter", modules.size(), -0.5, modules.size() - 0.5)->getTH1F();
476  // find module labels
477  for (uint32_t i = 0; i < modules.size(); ++i) {
478  pathinfo.dqm_module_counter->GetXaxis()->SetBinLabel( i+1, labels[i] );
479  }
480  }
481  // book detailed timing histograms
483  pathinfo.dqm_module_active = booker.book1D(pathname + "_module_active", pathname + " module active", modules.size(), -0.5, modules.size() - 0.5)->getTH1F();
484  pathinfo.dqm_module_active ->SetYTitle("cumulative processing time [ms]");
485  pathinfo.dqm_module_total = booker.book1D(pathname + "_module_total", pathname + " module total", modules.size(), -0.5, modules.size() - 0.5)->getTH1F();
486  pathinfo.dqm_module_total ->SetYTitle("cumulative processing time [ms]");
487  // find module labels
488  for (uint32_t i = 0; i < modules.size(); ++i) {
489  pathinfo.dqm_module_active ->GetXaxis()->SetBinLabel( i+1, labels[i] );
490  pathinfo.dqm_module_total ->GetXaxis()->SetBinLabel( i+1, labels[i] );
491  }
492  }
493  }
494 
495  // book exclusive path time histograms
497  pathinfo.dqm_exclusive = booker.book1D(pathname + "_exclusive", pathname + " exclusive time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
498  pathinfo.dqm_exclusive ->StatOverflows(true);
499  pathinfo.dqm_exclusive ->SetXTitle("processing time [ms]");
500  }
501 
502  }
503  }
504 
505  if (m_enable_dqm_bymodule) {
506  booker.setCurrentFolder(m_dqm_path + "/Modules");
507  for (auto & keyval: stream.modules) {
508  std::string const & label = keyval.first;
509  ModuleInfo & module = keyval.second;
510  module.dqm_active = booker.book1D(label, label, modulebins, 0., m_dqm_moduletime_range)->getTH1F();
511  module.dqm_active->StatOverflows(true);
512  module.dqm_active->SetXTitle("processing time [ms]");
513  }
514  }
515 
517  booker.setCurrentFolder(m_dqm_path + "/ModuleTypes");
518  for (auto & keyval: stream.moduletypes) {
519  std::string const & label = keyval.first;
520  ModuleInfo & module = keyval.second;
521  module.dqm_active = booker.book1D(label, label, modulebins, 0., m_dqm_moduletime_range)->getTH1F();
522  module.dqm_active->StatOverflows(true);
523  module.dqm_active->SetXTitle("processing time [ms]");
524  }
525  }
526 
527  };
528 
529  // book MonitorElement's for this stream
530  edm::Service<DQMStore>()->bookTransaction(bookTransactionCallback, sc.eventID().run(), sid, m_module_id);
531 }
532 
533 
534 void
536 {
540 
542  m_dqm_path += (boost::format("/Running %d processes") % m_concurrent_threads).str();
543 
547 
548  // assign a pseudo module id to the FastTimerService
550  for (auto & stream: m_stream) {
551  stream.fast_modules.resize( m_module_id, nullptr);
552  stream.fast_moduletypes.resize(m_module_id, nullptr);
553  }
554 
555  // resize the luminosity per event buffer
556  for (auto & stream: m_stream)
557  stream.luminosity.resize(m_dqm_luminosity.size(), 0);
558 }
559 
560 
561 void
563  unsigned int sid = sc.streamID().value();
564  auto & stream = m_stream[sid];
565  stream.timer_last_transition = FastTimer::Clock::now();
566 }
567 
568 void
570 {
571  unsigned int sid = sc.streamID().value();
572  auto & stream = m_stream[sid];
573 
574  if (m_enable_dqm) {
575  DQMStore * store = edm::Service<DQMStore>().operator->();
576  assert(store);
578  }
579 
580  stream.reset();
581  stream.timer_last_transition = FastTimer::Clock::now();
582 }
583 
584 void
586  unsigned int sid = sc.streamID().value();
587  auto & stream = m_stream[sid];
588  stream.timer_last_transition = FastTimer::Clock::now();
589 }
590 
591 void
593  unsigned int sid = sc.streamID().value();
594  auto & stream = m_stream[sid];
595  stream.timer_last_transition = FastTimer::Clock::now();
596 }
597 
598 void
600 {
602  unsigned int pid = processID(gc.processContext());
603  unsigned int rid = gc.runIndex();
604  unsigned int run = gc.luminosityBlockID().run();
605  const std::string label = (boost::format("run %d") % run).str();
606 
608 
609  if (pid+1 == m_process.size())
610  printSummary(m_run_summary[rid], label);
611  }
612 }
613 
614 void
616 {
618  const std::string label = "the whole job";
619  for (unsigned int pid = 0; pid < m_process.size(); ++pid)
621 
622  printSummary(m_job_summary, label);
623  }
624 }
625 
626 void
628 {
629  // print a timing summary for the run or job, for each subprocess
630  std::ostringstream out;
631  out << std::fixed << std::setprecision(6);
632  out << "FastReport for " << label << ", process " << process << '\n';
633  //out << "FastReport " << (m_use_realtime ? "(real time) " : "(CPU time) ") << '\n';
634  out << "FastReport " << std::right << std::setw(10) << summary.preevent / (double) total.count << " Pre-Event" << '\n';
635  out << "FastReport " << std::right << std::setw(10) << summary.event / (double) total.count << " Event" << '\n';
636  out << "FastReport " << std::right << std::setw(10) << summary.all_paths / (double) total.count << " all Paths" << '\n';
637  out << "FastReport " << std::right << std::setw(10) << summary.all_endpaths / (double) total.count << " all EndPaths" << '\n';
638  out << "FastReport " << std::right << std::setw(10) << summary.interpaths / (double) total.count << " between paths" << '\n';
639  edm::LogVerbatim("FastReport") << out.str();
640 }
641 
642 void
644 {
645  // print a timing summary for the run or job
646  //edm::service::TriggerNamesService & tns = * edm::Service<edm::service::TriggerNamesService>();
647 
648  std::ostringstream out;
649  out << std::fixed << std::setprecision(6);
650  out << "FastReport for " << label << ", over all subprocesses" << '\n';
651  //out << "FastReport " << (m_use_realtime ? "(real time) " : "(CPU time) ") << '\n';
652  out << "FastReport " << std::right << std::setw(10) << summary.presource / (double) summary.count << " Pre-Source" << '\n';
653  out << "FastReport " << std::right << std::setw(10) << summary.source / (double) summary.count << " Source" << '\n';
654  out << "FastReport " << std::right << std::setw(10) << summary.preevent / (double) summary.count << " Pre-Event" << '\n';
655  out << "FastReport " << std::right << std::setw(10) << summary.event / (double) summary.count << " Event" << '\n';
656  edm::LogVerbatim("FastReport") << out.str();
657 }
658 
659 /*
660  if (m_enable_timing_modules) {
661  double modules_total = 0.;
662  for (auto & keyval: m_stream.modules)
663  modules_total += keyval.second.summary_active;
664  out << "FastReport " << std::right << std::setw(10) << modules_total / (double) summary.count << " all Modules" << '\n';
665  }
666  out << '\n';
667  if (m_enable_timing_paths and not m_enable_timing_modules) {
668  //out << "FastReport " << (m_use_realtime ? "(real time) " : "(CPU time) ") << " Active Path" << '\n';
669  for (auto const & name: tns.getTrigPaths())
670  out << "FastReport "
671  << std::right << std::setw(10) << m_stream.paths[pid][name].summary_active / (double) summary.count << " "
672  << name << '\n';
673  out << '\n';
674  //out << "FastReport " << (m_use_realtime ? "(real time) " : "(CPU time) ") << " Active EndPath" << '\n';
675  for (auto const & name: tns.getEndPaths())
676  out << "FastReport "
677  << std::right << std::setw(10) << m_stream.paths[pid][name].summary_active / (double) summary.count << " "
678  << name << '\n';
679  } else if (m_enable_timing_paths and m_enable_timing_modules) {
680  //out << "FastReport " << (m_use_realtime ? "(real time) " : "(CPU time) ") << " Active Pre- Inter- Post-mods Overhead Total Path" << '\n';
681  for (auto const & name: tns.getTrigPaths()) {
682  out << "FastReport "
683  << std::right << std::setw(10) << m_stream.paths[pid][name].summary_active / (double) summary.count << " "
684  << std::right << std::setw(10) << m_stream.paths[pid][name].summary_premodules / (double) summary.count << " "
685  << std::right << std::setw(10) << m_stream.paths[pid][name].summary_intermodules / (double) summary.count << " "
686  << std::right << std::setw(10) << m_stream.paths[pid][name].summary_postmodules / (double) summary.count << " "
687  << std::right << std::setw(10) << m_stream.paths[pid][name].summary_overhead / (double) summary.count << " "
688  << std::right << std::setw(10) << m_stream.paths[pid][name].summary_total / (double) summary.count << " "
689  << name << '\n';
690  }
691  out << '\n';
692  //out << "FastReport " << (m_use_realtime ? "(real time) " : "(CPU time) ") << " Active Pre- Inter- Post-mods Overhead Total EndPath" << '\n';
693  for (auto const & name: tns.getEndPaths()) {
694  out << "FastReport "
695  << std::right << std::setw(10) << m_stream.paths[pid][name].summary_active / (double) summary.count << " "
696  << std::right << std::setw(10) << m_stream.paths[pid][name].summary_premodules / (double) summary.count << " "
697  << std::right << std::setw(10) << m_stream.paths[pid][name].summary_intermodules / (double) summary.count << " "
698  << std::right << std::setw(10) << m_stream.paths[pid][name].summary_postmodules / (double) summary.count << " "
699  << std::right << std::setw(10) << m_stream.paths[pid][name].summary_overhead / (double) summary.count << " "
700  << std::right << std::setw(10) << m_stream.paths[pid][name].summary_total / (double) summary.count << " "
701  << name << '\n';
702  }
703  }
704  out << '\n';
705  if (m_enable_timing_modules) {
706  //out << "FastReport " << (m_use_realtime ? "(real time) " : "(CPU time) ") << " Active Module" << '\n';
707  for (auto & keyval: m_stream.modules) {
708  std::string const & label = keyval.first;
709  ModuleInfo const & module = keyval.second;
710  out << "FastReport " << std::right << std::setw(10) << module.summary_active / (double) summary.count << " " << label << '\n';
711  }
712  //out << "FastReport " << (m_use_realtime ? "(real time) " : "(CPU time) ") << " Active Module" << '\n';
713  out << '\n';
714  //out << "FastReport " << (m_use_realtime ? "(real time) " : "(CPU time) ") << " Active Module" << '\n';
715  for (auto & keyval: m_stream.moduletypes) {
716  std::string const & label = keyval.first;
717  ModuleInfo const & module = keyval.second;
718  out << "FastReport " << std::right << std::setw(10) << module.summary_active / (double) summary.count << " " << label << '\n';
719  }
720  //out << "FastReport " << (m_use_realtime ? "(real time) " : "(CPU time) ") << " Active Module" << '\n';
721  }
722 */
723 
725  // allocate a counter for each module and module type
726  for (auto & stream: m_stream) {
727  if (module.id() >= stream.fast_modules.size())
728  stream.fast_modules.resize(module.id() + 1, nullptr);
729  if (module.id() >= stream.fast_moduletypes.size())
730  stream.fast_moduletypes.resize(module.id() + 1, nullptr);
731 
732  stream.fast_modules[module.id()] = & stream.modules[module.moduleLabel()];;
733  stream.fast_moduletypes[module.id()] = & stream.moduletypes[module.moduleName()];
734  }
735 }
736 
738  unsigned int pid = processID(sc.processContext());
739  unsigned int sid = sc.streamID().value();
740  auto & stream = m_stream[sid];
741 
742  // new event, reset the per-event counter
743  stream.timer_event.start();
744 
745  // account the time spent between the last transition and the beginning of the event
746  stream.timing_perprocess[pid].preevent = delta(stream.timer_last_transition, stream.timer_event.getStartTime());
747 
748  // clear the event counters
749  stream.timing_perprocess[pid].event = 0;
750  stream.timing_perprocess[pid].all_paths = 0;
751  stream.timing_perprocess[pid].all_endpaths = 0;
752  stream.timing_perprocess[pid].interpaths = 0;
753  stream.timing_perprocess[pid].paths_interpaths.assign(stream.paths[pid].size() + 1, 0);
754  for (auto & keyval : stream.paths[pid]) {
755  keyval.second.timer.reset();
756  keyval.second.time_active = 0.;
757  keyval.second.time_exclusive = 0.;
758  keyval.second.time_premodules = 0.;
759  keyval.second.time_intermodules = 0.;
760  keyval.second.time_postmodules = 0.;
761  keyval.second.time_total = 0.;
762  }
763 
764  // copy the start event timestamp as the end of the previous path
765  // used by the inter-path overhead measurement
766  stream.timer_last_path = stream.timer_event.getStartTime();
767 
768  // if requested, set the lumisection for timing vs. lumisection plots
769  if (m_enable_dqm_byls and pid == 0)
770  setLuminosity(sid, 0, sc.eventID().luminosityBlock());
771 }
772 
774  unsigned int pid = processID(sc.processContext());
775  unsigned int sid = sc.streamID();
776  unsigned int rid = sc.runIndex();
777  auto & stream = m_stream[sid];
778 
779  // stop the per-event timer, and account event time
780  stream.timer_event.stop();
781  stream.timer_last_transition = stream.timer_event.getStopTime();
782  stream.timing_perprocess[pid].event = stream.timer_event.seconds();
783 
784  // the last part of inter-path overhead is the time between the end of the last (end)path and the end of the event processing
785  double interpaths = delta(stream.timer_last_path, stream.timer_event.getStopTime());
786  stream.timing_perprocess[pid].interpaths += interpaths;
787  stream.timing_perprocess[pid].paths_interpaths.back() = interpaths;
788 
789  {
790  // prevent different threads from updating the summary information at the same time
791  std::lock_guard<std::mutex> lock_summary(m_summary_mutex);
792 
793  // keep track of the total number of events and add this event's time to the per-run and per-job summary
794  m_run_summary_perprocess[rid][pid] += stream.timing_perprocess[pid];
795  m_job_summary_perprocess[pid] += stream.timing_perprocess[pid];
796 
797  // account the whole event timing details
798  if (pid+1 == m_process.size()) {
799  stream.timing.count = 1;
800  stream.timing.preevent = stream.timing_perprocess[0].preevent;
801  stream.timing.event = stream.timing_perprocess[0].event;
802  for (unsigned int i = 1; i < m_process.size(); ++i) {
803  stream.timing.event += stream.timing_perprocess[i].preevent;
804  stream.timing.event += stream.timing_perprocess[i].event;
805  }
806  m_run_summary[rid] += stream.timing;
807  m_job_summary += stream.timing;
808  }
809  }
810 
811  // elaborate "exclusive" modules
813  for (auto & keyval: stream.paths[pid]) {
814  PathInfo & pathinfo = keyval.second;
815  pathinfo.time_exclusive = pathinfo.time_overhead;
816 
817  for (uint32_t i = 0; i < pathinfo.last_run; ++i) {
818  ModuleInfo * module = pathinfo.modules[i];
819  if (module == 0)
820  // this is a module occurring more than once in the same path, skip it after the first occurrence
821  continue;
822  if ((module->run_in_path == & pathinfo) and (module->counter == 1))
823  pathinfo.time_exclusive += module->time_active;
824  }
825  }
826  }
827 
828  // fill the information per module type
829  // note: this is done here because during event processing two theads could try to update the same module type at the same time
830  // note: this is done only for the last subprocess, to avoid double conuting the modules' contributions
831  if ((m_enable_timing_modules) and (pid+1 == m_process.size())) {
832  for (unsigned int i = 0; i < stream.fast_modules.size(); ++i)
833  // check for null pointers - there is no guarantee that all module ids are valid and used
834  if (stream.fast_modules[i]) {
835  double active = stream.fast_modules[i]->time_active;
836  ModuleInfo & moduletype = * stream.fast_moduletypes[i];
837  moduletype.time_active += active;
838  moduletype.summary_active += active;
839  }
840  }
841 
842  // fill the DQM plots from the internal buffers
843  if (not m_enable_dqm)
844  return;
845 
846  // fill plots for per-event time by path
847  if (m_enable_timing_paths) {
848 
849  for (auto & keyval: stream.paths[pid]) {
850  PathInfo & pathinfo = keyval.second;
851 
852  stream.dqm_paths[pid].active_time->Fill(pathinfo.index, pathinfo.time_active * 1000.);
854  pathinfo.dqm_active->Fill(pathinfo.time_active * 1000.);
855 
856  stream.dqm_paths[pid].exclusive_time->Fill(pathinfo.index, pathinfo.time_exclusive * 1000.);
858  pathinfo.dqm_exclusive->Fill(pathinfo.time_exclusive * 1000.);
859 
860  stream.dqm_paths[pid].total_time->Fill(pathinfo.index, pathinfo.time_total * 1000.);
862  pathinfo.dqm_total->Fill(pathinfo.time_total * 1000.);
863 
864  // fill path overhead histograms
866  pathinfo.dqm_premodules ->Fill(pathinfo.time_premodules * 1000.);
867  pathinfo.dqm_intermodules->Fill(pathinfo.time_intermodules * 1000.);
868  pathinfo.dqm_postmodules ->Fill(pathinfo.time_postmodules * 1000.);
869  pathinfo.dqm_overhead ->Fill(pathinfo.time_overhead * 1000.);
870  }
871 
872  // fill detailed timing histograms
874  for (uint32_t i = 0; i < pathinfo.last_run; ++i) {
875  ModuleInfo * module = pathinfo.modules[i];
876  // skip duplicate modules
877  if (module == nullptr)
878  continue;
879  // fill the total time for all non-duplicate modules
880  pathinfo.dqm_module_total->Fill(i, module->time_active * 1000.);
881  // fill the active time only for module that have actually run in this path
882  if (module->run_in_path == & pathinfo)
883  pathinfo.dqm_module_active->Fill(i, module->time_active * 1000.);
884  }
885  }
886 
887  // fill path counter histograms
888  // - also for duplicate modules, to properly extract rejection information
889  // - fill the N+1th bin for paths accepting the event, so the FastTimerServiceClient can properly measure the last filter efficiency
891  for (uint32_t i = 0; i < pathinfo.last_run; ++i)
892  pathinfo.dqm_module_counter->Fill(i);
893  if (pathinfo.accept)
894  pathinfo.dqm_module_counter->Fill(pathinfo.modules.size());
895  }
896 
897  }
898  }
899 
900  // fill plots for per-event time by module
901  // note: this is done only for the last subprocess, to avoid filling the same plots multiple times
902  if ((m_enable_dqm_bymodule) and (pid+1 == m_process.size())) {
903  for (auto & keyval : stream.modules) {
904  ModuleInfo & module = keyval.second;
905  module.dqm_active->Fill(module.time_active * 1000.);
906  }
907  }
908 
909  // fill plots for per-event time by module type
910  // note: this is done only for the last subprocess, to avoid filling the same plots multiple times
911  if ((m_enable_dqm_bymoduletype) and (pid+1 == m_process.size())) {
912  for (auto & keyval : stream.moduletypes) {
913  ModuleInfo & module = keyval.second;
914  module.dqm_active->Fill(module.time_active * 1000.);
915  }
916  }
917 
918  // fill the interpath overhead plot
920  for (unsigned int i = 0; i <= stream.paths[pid].size(); ++i)
921  stream.dqm_paths[pid].interpaths->Fill(i, stream.timing_perprocess[pid].paths_interpaths[i] * 1000.);
922 
923  if (m_enable_dqm_summary) {
924  if (pid+1 == m_process.size())
925  stream.dqm.fill(stream.timing);
926  stream.dqm_perprocess[pid].fill(stream.timing_perprocess[pid]);
927  }
928 
929  if (not m_dqm_luminosity.empty()) {
930  if (pid+1 == m_process.size())
931  for (unsigned int i = 0; i < m_dqm_luminosity.size(); ++i)
932  stream.dqm_byluminosity[i].fill(stream.luminosity[i], stream.timing);
933  for (unsigned int i = 0; i < m_dqm_luminosity.size(); ++i)
934  stream.dqm_perprocess_byluminosity[pid][i].fill(stream.luminosity[i], stream.timing_perprocess[pid]);
935  }
936 
937 }
938 
940  auto & stream = m_stream[sid];
941 
942  // clear the event counters
943  stream.timing.reset();
944  stream.timer_source.start();
945 
946  // clear the event counters
947  // note: this is done here and not in preEvent to avoid clearing the counter before each subprocess
948  for (auto & keyval : stream.modules) {
949  keyval.second.timer.reset();
950  keyval.second.time_active = 0.;
951  keyval.second.run_in_path = nullptr;
952  keyval.second.counter = 0;
953  }
954  for (auto & keyval : stream.moduletypes) {
955  keyval.second.timer.reset();
956  keyval.second.time_active = 0.;
957  keyval.second.run_in_path = nullptr;
958  keyval.second.counter = 0;
959  }
960 
961  // account the time spent before the source
962  stream.timing.presource = delta(stream.timer_last_transition, stream.timer_source.getStartTime());
963 }
964 
966  auto & stream = m_stream[sid];
967  stream.timer_source.stop();
968  stream.timer_last_transition = stream.timer_source.getStopTime();
969 
970  // account the time spent in the source
971  stream.timing.source = stream.timer_source.seconds();
972 }
973 
974 
976  std::string const & path = pc.pathName();
977  unsigned int pid = processID(sc.processContext());
978  unsigned int sid = sc.streamID();
979  auto & stream = m_stream[sid];
980 
981  auto keyval = stream.paths[pid].find(path);
982  if (keyval != stream.paths[pid].end()) {
983  stream.current_path = & keyval->second;
984  } else {
985  // should never get here
986  stream.current_path = nullptr;
987  edm::LogError("FastTimerService") << "FastTimerService::prePathEvent: unexpected path " << path;
988  return;
989  }
990 
991  // prepare to measure the time spent between the beginning of the path and the execution of the first module
992  stream.current_path->first_module = nullptr;
993 
994  // time each (end)path
995  stream.current_path->timer.start();
996 
997  if (path == m_process[pid].first_path) {
998  // this is the first path, start the "all paths" counter
999  stream.timer_paths.setStartTime(stream.current_path->timer.getStartTime());
1000  } else if (path == m_process[pid].first_endpath) {
1001  // this is the first endpath, start the "all paths" counter
1002  stream.timer_endpaths.setStartTime(stream.current_path->timer.getStartTime());
1003  }
1004 
1005  // measure the inter-path overhead as the time elapsed since the end of preiovus path
1006  // (or the beginning of the event, if this is the first path - see preEvent)
1007  double interpaths = delta(stream.timer_last_path, stream.current_path->timer.getStartTime());
1008  stream.timing_perprocess[pid].interpaths += interpaths;
1009  stream.timing_perprocess[pid].paths_interpaths[stream.current_path->index] = interpaths;
1010 }
1011 
1012 
1014  std::string const & path = pc.pathName();
1015  unsigned int pid = processID(sc.processContext());
1016  unsigned int sid = sc.streamID().value();
1017  auto & stream = m_stream[sid];
1018 
1019  if (stream.current_path == nullptr) {
1020  edm::LogError("FastTimerService") << "FastTimerService::postPathEvent: unexpected path " << path;
1021  return;
1022  }
1023 
1024  // time each (end)path
1025  stream.current_path->timer.stop();
1026  stream.current_path->time_active = stream.current_path->timer.seconds();
1027  stream.timer_last_path = stream.current_path->timer.getStopTime();
1028 
1029  double active = stream.current_path->time_active;
1030 
1031  // if enabled, account each (end)path
1032  if (m_enable_timing_paths) {
1033 
1034  PathInfo & pathinfo = * stream.current_path;
1035  pathinfo.summary_active += active;
1036 
1037  // measure the time spent between the execution of the last module and the end of the path
1039  double pre = 0.; // time spent before the first active module
1040  double inter = 0.; // time spent between active modules
1041  double post = 0.; // time spent after the last active module
1042  double overhead = 0.; // time spent before, between, or after modules
1043  double current = 0.; // time spent in modules active in the current path
1044  double total = active; // total per-path time, including modules already run as part of other paths
1045 
1046  // implementation note:
1047  // "active" has already measured all the time spent in this path
1048  // "current" will be the sum of the time spent inside each module while running this path, so that
1049  // "overhead" will be active - current
1050  // "total" will be active + the sum of the time spent in non-active modules
1051 
1052  uint32_t last_run = 0; // index of the last module run in this path, plus one
1053  if (status.wasrun() and not pathinfo.modules.empty())
1054  last_run = status.index() + 1; // index of the last module run in this path, plus one
1055  for (uint32_t i = 0; i < last_run; ++i) {
1056  ModuleInfo * module = pathinfo.modules[i];
1057 
1058  if (module == 0)
1059  // this is a module occurring more than once in the same path, skip it after the first occurrence
1060  continue;
1061 
1062  ++module->counter;
1063  if (module->run_in_path == & pathinfo) {
1064  current += module->time_active;
1065  } else {
1066  total += module->time_active;
1067  }
1068 
1069  }
1070 
1071  if (stream.current_path->first_module == nullptr) {
1072  // no modules were active during this path, account all the time as overhead
1073  pre = 0.;
1074  inter = 0.;
1075  post = active;
1076  overhead = active;
1077  } else {
1078  // extract overhead information
1079  pre = delta(stream.current_path->timer.getStartTime(), stream.current_path->first_module->timer.getStartTime());
1080  post = delta(stream.current_module->timer.getStopTime(), stream.current_path->timer.getStopTime());
1081  inter = active - pre - current - post;
1082  // take care of numeric precision and rounding errors - the timer is less precise than nanosecond resolution
1083  if (std::abs(inter) < 1e-9)
1084  inter = 0.;
1085  overhead = active - current;
1086  // take care of numeric precision and rounding errors - the timer is less precise than nanosecond resolution
1087  if (std::abs(overhead) < 1e-9)
1088  overhead = 0.;
1089  }
1090 
1091  pathinfo.time_premodules = pre;
1092  pathinfo.time_intermodules = inter;
1093  pathinfo.time_postmodules = post;
1094  pathinfo.time_overhead = overhead;
1095  pathinfo.time_total = total;
1096  pathinfo.summary_premodules += pre;
1097  pathinfo.summary_intermodules += inter;
1098  pathinfo.summary_postmodules += post;
1099  pathinfo.summary_overhead += overhead;
1100  pathinfo.summary_total += total;
1101  pathinfo.last_run = last_run;
1102  pathinfo.accept = status.accept();
1103  }
1104  }
1105 
1106  if (path == m_process[pid].last_path) {
1107  // this is the last path, stop and account the "all paths" counter
1108  stream.timer_paths.setStopTime(stream.current_path->timer.getStopTime());
1109  stream.timing_perprocess[pid].all_paths = stream.timer_paths.seconds();
1110  } else if (path == m_process[pid].last_endpath) {
1111  // this is the last endpath, stop and account the "all endpaths" counter
1112  stream.timer_endpaths.setStopTime(stream.current_path->timer.getStopTime());
1113  stream.timing_perprocess[pid].all_endpaths = stream.timer_endpaths.seconds();
1114  }
1115 
1116 }
1117 
1119  // this is ever called only if m_enable_timing_modules = true
1120  assert(m_enable_timing_modules);
1121 
1122  if (mcc.moduleDescription() == nullptr) {
1123  edm::LogError("FastTimerService") << "FastTimerService::postModuleEventDelayedGet: invalid module";
1124  return;
1125  }
1126 
1127  edm::ModuleDescription const & md = * mcc.moduleDescription();
1128  unsigned int sid = sc.streamID().value();
1129  auto & stream = m_stream[sid];
1130 
1131  // time each module
1132  if (md.id() < stream.fast_modules.size()) {
1133  ModuleInfo & module = * stream.fast_modules[md.id()];
1134  module.run_in_path = stream.current_path;
1135  module.timer.start();
1136  stream.current_module = & module;
1137  // used to measure the time spent between the beginning of the path and the execution of the first module
1138  if (stream.current_path->first_module == nullptr)
1139  stream.current_path->first_module = & module;
1140  } else {
1141  // should never get here
1142  edm::LogError("FastTimerService") << "FastTimerService::preModuleEvent: unexpected module " << md.moduleLabel();
1143  }
1144 }
1145 
1147  // this is ever called only if m_enable_timing_modules = true
1148  assert(m_enable_timing_modules);
1149 
1150  if (mcc.moduleDescription() == nullptr) {
1151  edm::LogError("FastTimerService") << "FastTimerService::postModuleEventDelayedGet: invalid module";
1152  return;
1153  }
1154 
1155  edm::ModuleDescription const & md = * mcc.moduleDescription();
1156  unsigned int sid = sc.streamID().value();
1157  auto & stream = m_stream[sid];
1158 
1159  double active = 0.;
1160 
1161  // time and account each module
1162  if (md.id() < stream.fast_modules.size()) {
1163  ModuleInfo & module = * stream.fast_modules[md.id()];
1164  module.timer.stop();
1165  active = module.timer.seconds();
1166  module.time_active = active;
1167  module.summary_active += active;
1168  // plots are filled post event processing
1169  } else {
1170  // should never get here
1171  edm::LogError("FastTimerService") << "FastTimerService::postModuleEvent: unexpected module " << md.moduleLabel();
1172  }
1173 }
1174 
1176  // this is ever called only if m_enable_timing_modules = true
1177  assert(m_enable_timing_modules);
1178 
1179  if (mcc.moduleDescription() == nullptr) {
1180  edm::LogError("FastTimerService") << "FastTimerService::postModuleEventDelayedGet: invalid module";
1181  return;
1182  }
1183 
1184  edm::ModuleDescription const & md = * mcc.moduleDescription();
1185  unsigned int sid = sc.streamID().value();
1186  auto & stream = m_stream[sid];
1187 
1188  // if the ModuleCallingContext state is "Pefetching", the module is not running,
1189  // and is asking for its dependencies due to a "consumes" declaration.
1190  // we can ignore this signal.
1191 
1192  // if the ModuleCallingContext state is "Running", the module was running:
1193  // it declared its dependencies as "mayConsume", and is now calling getByToken/getByLabel.
1194  // we pause the timer for this module, and resume it later in the postModuleEventDelayedGet signal.
1195 
1196  // if the ModuleCallingContext state is "Invalid", we ignore the signal.
1197 
1199  if (md.id() < stream.fast_modules.size()) {
1200  ModuleInfo & module = * stream.fast_modules[md.id()];
1201  module.timer.pause();
1202  } else {
1203  // should never get here
1204  edm::LogError("FastTimerService") << "FastTimerService::preModuleEventDelayedGet: unexpected module " << md.moduleLabel();
1205  }
1206  }
1207 
1208 }
1209 
1211  // this is ever called only if m_enable_timing_modules = true
1212  assert(m_enable_timing_modules);
1213 
1214  if (mcc.moduleDescription() == nullptr) {
1215  edm::LogError("FastTimerService") << "FastTimerService::postModuleEventDelayedGet: invalid module";
1216  return;
1217  }
1218 
1219  edm::ModuleDescription const & md = * mcc.moduleDescription();
1220  unsigned int sid = sc.streamID().value();
1221  auto & stream = m_stream[sid];
1222 
1223  // see the description of the possible ModuleCallingContext states in preModuleEventDelayedGet, above.
1225  if (md.id() < stream.fast_modules.size()) {
1226  ModuleInfo & module = * stream.fast_modules[md.id()];
1227  module.timer.resume();
1228  } else {
1229  // should never get here
1230  edm::LogError("FastTimerService") << "FastTimerService::postModuleEventDelayedGet: unexpected module " << md.moduleLabel();
1231  }
1232  }
1233 
1234 }
1235 
1236 // associate to a path all the modules it contains
1237 void FastTimerService::fillPathMap(unsigned int pid, std::string const & name, std::vector<std::string> const & modules) {
1238  for (auto & stream: m_stream) {
1239 
1240  std::vector<ModuleInfo *> & pathmap = stream.paths[pid][name].modules;
1241  pathmap.clear();
1242  pathmap.reserve( modules.size() );
1243  std::unordered_set<ModuleInfo const *> pool; // keep track of inserted modules
1244  for (auto const & module: modules) {
1245  // fix the name of negated or ignored modules
1246  std::string const & label = (module[0] == '!' or module[0] == '-') ? module.substr(1) : module;
1247 
1248  auto const & it = stream.modules.find(label);
1249  if (it == stream.modules.end()) {
1250  // no matching module was found
1251  pathmap.push_back( 0 );
1252  } else if (pool.insert(& it->second).second) {
1253  // new module
1254  pathmap.push_back(& it->second);
1255  } else {
1256  // duplicate module
1257  pathmap.push_back( 0 );
1258  }
1259  }
1260 
1261  }
1262 }
1263 
1264 
1265 // query the current module/path/event
1266 // Note: these functions incur in a "per-call timer overhead" (see above), currently of the order of 340ns
1267 
1268 // return the time spent since the last preModuleEvent() event
1270  return m_stream[sid].current_module->timer.secondsUntilNow();
1271 }
1272 
1273 // return the time spent since the last prePathEvent() event
1275  return m_stream[sid].current_path->timer.secondsUntilNow();
1276 }
1277 
1278 // return the time spent since the last preEvent() event
1280  return m_stream[sid].timer_event.secondsUntilNow();
1281 }
1282 
1283 // query the time spent in a module (available after the module has run)
1285  if (module.id() < m_stream[sid].fast_modules.size()) {
1286  return m_stream[sid].fast_modules[module.id()]->time_active;
1287  } else {
1288  edm::LogError("FastTimerService") << "FastTimerService::queryModuleTime: unexpected module " << module.moduleLabel();
1289  return 0.;
1290  }
1291 }
1292 
1293 // query the time spent in a module (available after the module has run)
1294 double FastTimerService::queryModuleTime(edm::StreamID sid, unsigned int id) const {
1295  if (id < m_stream[sid].fast_modules.size()) {
1296  return m_stream[sid].fast_modules[id]->time_active;
1297  } else {
1298  edm::LogError("FastTimerService") << "FastTimerService::queryModuleTime: unexpected module id " << id;
1299  return 0.;
1300  }
1301 }
1302 
1303 // query the time spent in a module (available after the module has run)
1305  auto const & keyval = m_stream[sid].modules.find(label);
1306  if (keyval != m_stream[sid].modules.end()) {
1307  return keyval->second.time_active;
1308  } else {
1309  // module not found
1310  edm::LogError("FastTimerService") << "FastTimerService::queryModuleTimeByLabel: unexpected module " << label;
1311  return 0.;
1312  }
1313 }
1314 
1315 // query the time spent in a type of module (available after the module has run)
1317  auto const & keyval = m_stream[sid].moduletypes.find(type);
1318  if (keyval != m_stream[sid].moduletypes.end()) {
1319  return keyval->second.time_active;
1320  } else {
1321  // module not found
1322  edm::LogError("FastTimerService") << "FastTimerService::queryModuleTimeByType: unexpected module type " << type;
1323  return 0.;
1324  }
1325 }
1326 
1327 /* FIXME re-implement taking into account subprocesses
1328 // query the time spent in a path (available after the path has run)
1329 double FastTimerService::queryPathActiveTime(edm::StreamID sid, const std::string & path) const {
1330  PathMap<PathInfo>::const_iterator keyval = m_stream[sid].paths.find(path);
1331  if (keyval != m_stream[sid].paths.end()) {
1332  return keyval->second.time_active;
1333  } else {
1334  edm::LogError("FastTimerService") << "FastTimerService::queryPathActiveTime: unexpected path " << path;
1335  return 0.;
1336  }
1337 }
1338 
1339 // query the time spent in a path (available after the path has run)
1340 double FastTimerService::queryPathExclusiveTime(edm::StreamID sid, const std::string & path) const {
1341  PathMap<PathInfo>::const_iterator keyval = m_stream[sid].paths.find(path);
1342  if (keyval != m_stream[sid].paths.end()) {
1343  return keyval->second.time_exclusive;
1344  } else {
1345  edm::LogError("FastTimerService") << "FastTimerService::queryPathExclusiveTime: unexpected path " << path;
1346  return 0.;
1347  }
1348 }
1349 
1350 // query the total time spent in a path (available after the path has run)
1351 double FastTimerService::queryPathTotalTime(edm::StreamID sid, const std::string & path) const {
1352  PathMap<PathInfo>::const_iterator keyval = m_stream[sid].paths.find(path);
1353  if (keyval != m_stream[sid].paths.end()) {
1354  return keyval->second.time_total;
1355  } else {
1356  edm::LogError("FastTimerService") << "FastTimerService::queryPathTotalTime: unexpected path " << path;
1357  return 0.;
1358  }
1359 }
1360 */
1361 
1362 // query the time spent in the current event's source (available during event processing)
1364  return m_stream[sid].timing.source;
1365 }
1366 
1367 // query the time spent processing the current event (available after the event has been processed)
1369  return m_stream[sid].timing.event;
1370 }
1371 
1372 /* FIXME re-implement taking into account subprocesses
1373 // query the time spent in the current event's paths (available during endpaths)
1374 double FastTimerService::queryPathsTime(edm::StreamID sid) const {
1375  return m_stream[sid].timing.all_paths;
1376 }
1377 
1378 // query the time spent in the current event's endpaths (available after all endpaths have run)
1379 double FastTimerService::queryEndPathsTime(edm::StreamID sid) const {
1380  return m_stream[sid].timing.all_endpaths;
1381 }
1382 */
1383 
1384 // describe the module's configuration
1387  desc.addUntracked<bool>( "useRealTimeClock", true);
1388  desc.addUntracked<bool>( "enableTimingPaths", true);
1389  desc.addUntracked<bool>( "enableTimingModules", true);
1390  desc.addUntracked<bool>( "enableTimingExclusive", false);
1391  desc.addUntracked<bool>( "enableTimingSummary", false);
1392  desc.addUntracked<bool>( "skipFirstPath", false),
1393  desc.addUntracked<bool>( "enableDQM", true);
1394  desc.addUntracked<bool>( "enableDQMbyPathActive", false);
1395  desc.addUntracked<bool>( "enableDQMbyPathTotal", true);
1396  desc.addUntracked<bool>( "enableDQMbyPathOverhead", false);
1397  desc.addUntracked<bool>( "enableDQMbyPathDetails", false);
1398  desc.addUntracked<bool>( "enableDQMbyPathCounters", true);
1399  desc.addUntracked<bool>( "enableDQMbyPathExclusive", false);
1400  desc.addUntracked<bool>( "enableDQMbyModule", false);
1401  desc.addUntracked<bool>( "enableDQMbyModuleType", false);
1402  desc.addUntracked<bool>( "enableDQMSummary", false);
1403  desc.addUntracked<bool>( "enableDQMbyLuminosity", false)->setComment("deprecated: this parameter is ignored");
1404  desc.addUntracked<bool>( "enableDQMbyLumiSection", false);
1405  desc.addUntracked<bool>( "enableDQMbyProcesses", false);
1406  desc.addUntracked<double>( "dqmTimeRange", 1000. ); // ms
1407  desc.addUntracked<double>( "dqmTimeResolution", 5. ); // ms
1408  desc.addUntracked<double>( "dqmPathTimeRange", 100. ); // ms
1409  desc.addUntracked<double>( "dqmPathTimeResolution", 0.5); // ms
1410  desc.addUntracked<double>( "dqmModuleTimeRange", 40. ); // ms
1411  desc.addUntracked<double>( "dqmModuleTimeResolution", 0.2); // ms
1412  desc.addUntracked<double>( "dqmLuminosityRange", 1.e34 )->setComment("deprecated: this parameter is ignored");
1413  desc.addUntracked<double>( "dqmLuminosityResolution", 1.e31 )->setComment("deprecated: this parameter is ignored");
1414  desc.addUntracked<uint32_t>( "dqmLumiSectionsRange", 2500 ); // ~ 16 hours
1415  desc.addUntracked<std::string>( "dqmPath", "HLT/TimerService");
1416  desc.addUntracked<edm::InputTag>( "luminosityProduct", edm::InputTag("hltScalersRawToDigi"))->setComment("deprecated: this parameter is ignored");
1417  desc.addUntracked<std::vector<unsigned int> >("supportedProcesses", std::vector<unsigned int> { })->setComment("deprecated: this parameter is ignored");
1418  descriptions.add("FastTimerService", desc);
1419 }
1420 
1421 // assign a "process id" to a process, given its ProcessContext
1423 {
1424  unsigned int pid = 0;
1425 
1426  // iterate through the chain of ProcessContext until we reach the topmost process
1427  while (context->isSubProcess()) {
1428  context = & context->parentProcessContext();
1429  ++pid;
1430  }
1431  return pid;
1432 }
RunNumber_t run() const
Definition: EventID.h:42
void preGlobalBeginRun(edm::GlobalContext const &)
void preModuleEventDelayedGet(edm::StreamContext const &, edm::ModuleCallingContext const &)
std::string const & pathName() const
Definition: PathContext.h:37
type
Definition: HCALResponse.h:21
unsigned int maxNumberOfThreads() const
Definition: SystemBounds.h:46
T getUntrackedParameter(std::string const &, T const &) const
void postStreamBeginRun(edm::StreamContext const &)
void watchPreEvent(PreEvent::slot_type const &iSlot)
double queryEventTime(edm::StreamID) const
int i
Definition: DBlmapReader.cc:9
const double m_dqm_eventtime_resolution
Strings const & getTrigPathModules(std::string const &name) const
void postStreamEndLumi(edm::StreamContext const &)
std::string const & processName() const
std::string const & getTrigPath(size_type const i) const
void watchPrePathEvent(PrePathEvent::slot_type const &iSlot)
void watchPreallocate(Preallocate::slot_type const &iSlot)
static double delta(FastTimer::Clock::time_point const &first, FastTimer::Clock::time_point const &second)
static void fill_dups(std::vector< std::string > &dups, unsigned int size)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
Strings const & getEndPaths() const
void resume()
Definition: FastTimer.cc:51
unsigned int m_concurrent_streams
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
void postModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
bool wasrun() const
was this path run?
Definition: HLTPathStatus.h:60
void watchPreModuleEvent(PreModuleEvent::slot_type const &iSlot)
const bool m_enable_dqm_bypath_counters
const bool m_skip_first_path
void watchPostEvent(PostEvent::slot_type const &iSlot)
const bool m_enable_dqm_bypath_exclusive
LuminosityBlockID const & luminosityBlockID() const
Definition: GlobalContext.h:52
void printSummary(Timing const &summary, std::string const &label) const
std::vector< ProcessDescription > m_process
void watchPostStreamEndLumi(PostStreamEndLumi::slot_type const &iSlot)
const double m_dqm_pathtime_range
std::string const & moduleName() const
void watchPostPathEvent(PostPathEvent::slot_type const &iSlot)
void watchPostModuleEvent(PostModuleEvent::slot_type const &iSlot)
double currentPathTime(edm::StreamID) const
void watchPostSourceEvent(PostSourceEvent::slot_type const &iSlot)
std::vector< TimingPerProcess > m_job_summary_perprocess
RunIndex const & runIndex() const
Definition: StreamContext.h:60
string format
Some error handling for the usage.
void postPathEvent(edm::StreamContext const &, edm::PathContext const &, edm::HLTPathStatus const &)
unsigned int m_concurrent_threads
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:43
std::string const & moduleLabel() const
static unsigned int getUniqueID()
Returns a unique id each time called. Intended to be passed to ModuleDescription&#39;s constructor&#39;s modI...
std::string m_dqm_path
ProcessContext const & parentProcessContext() const
unsigned int m_concurrent_runs
void postStreamBeginLumi(edm::StreamContext const &)
RunIndex const & runIndex() const
Definition: GlobalContext.h:53
unsigned int maxNumberOfStreams() const
Definition: SystemBounds.h:43
void preModuleBeginJob(edm::ModuleDescription const &)
const bool m_enable_dqm_bynproc
Strings const & getEndPathModules(std::string const &name) const
size_type findTrigPath(std::string const &name) const
std::vector< LuminosityDescription > m_dqm_luminosity
unsigned int m_module_id
void prePathEvent(edm::StreamContext const &, edm::PathContext const &)
void stop()
Definition: FastTimer.cc:29
const bool m_enable_dqm_byls
void watchPostStreamBeginLumi(PostStreamBeginLumi::slot_type const &iSlot)
const double m_dqm_moduletime_resolution
std::mutex m_summary_mutex
void pause()
Definition: FastTimer.cc:40
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
FastTimerService(const edm::ParameterSet &, edm::ActivityRegistry &)
double queryModuleTimeByLabel(edm::StreamID, const std::string &) const
double currentEventTime(edm::StreamID) const
void watchPreModuleEventDelayedGet(PreModuleEventDelayedGet::slot_type const &iSlot)
void postEvent(edm::StreamContext const &)
void postGlobalEndRun(edm::GlobalContext const &)
void setLuminosity(unsigned int stream_id, unsigned int luminosity_id, double value)
ModuleDescription const * moduleDescription() const
std::vector< std::vector< TimingPerProcess > > m_run_summary_perprocess
const double infinity
void postStreamEndRun(edm::StreamContext const &)
void preModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
RunNumber_t run() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double seconds() const
Definition: FastTimer.cc:75
const bool m_enable_dqm_bypath_details
std::vector< Timing > m_run_summary
void fillPathMap(unsigned int pid, std::string const &name, std::vector< std::string > const &modules)
ProcessContext const * processContext() const
Definition: StreamContext.h:63
const bool m_enable_dqm_bypath_overhead
size_type findEndPath(std::string const &name) const
void watchPreModuleBeginJob(PreModuleBeginJob::slot_type const &iSlot)
void watchPostStreamEndRun(PostStreamEndRun::slot_type const &iSlot)
void mergeAndResetMEsRunSummaryCache(uint32_t run, uint32_t streamId, uint32_t moduleId)
Definition: DQMStore.cc:332
StreamID const & streamID() const
Definition: StreamContext.h:57
tuple out
Definition: dbtoconf.py:99
void watchPreGlobalBeginRun(PreGlobalBeginRun::slot_type const &iSlot)
const bool m_enable_dqm_bymodule
void postModuleEventDelayedGet(edm::StreamContext const &, edm::ModuleCallingContext const &)
const double m_dqm_moduletime_range
unsigned int value() const
Definition: StreamID.h:46
void watchPostModuleEventDelayedGet(PostModuleEventDelayedGet::slot_type const &iSlot)
double querySourceTime(edm::StreamID) const
int inter
tuple pid
Definition: sysUtil.py:22
void watchPostGlobalEndRun(PostGlobalEndRun::slot_type const &iSlot)
void preSourceEvent(edm::StreamID)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void preEvent(edm::StreamContext const &)
const bool m_enable_timing_summary
bool accept() const
has this path accepted the event?
Definition: HLTPathStatus.h:62
ProcessContext const * processContext() const
Definition: GlobalContext.h:56
void postSourceEvent(edm::StreamID)
const bool m_enable_dqm_bymoduletype
const bool m_enable_dqm_summary
void watchPostStreamBeginRun(PostStreamBeginRun::slot_type const &iSlot)
double queryModuleTimeByType(edm::StreamID, const std::string &) const
std::string const & getEndPath(size_type const i) const
const bool m_enable_dqm_bypath_total
void watchPreStreamBeginRun(PreStreamBeginRun::slot_type const &iSlot)
Strings const & getTrigPaths() const
double queryModuleTime(edm::StreamID, const edm::ModuleDescription &) const
const bool m_enable_dqm_bypath_active
unsigned int maxNumberOfConcurrentRuns() const
Definition: SystemBounds.h:44
std::vector< ModuleInfo * > modules
EventID const & eventID() const
Definition: StreamContext.h:59
void watchPreSourceEvent(PreSourceEvent::slot_type const &iSlot)
static Interceptor::Registry registry("Interceptor")
tuple status
Definition: ntuplemaker.py:245
tuple process
Definition: LaserDQM_cfg.py:3
static unsigned int processID(edm::ProcessContext const *)
double currentModuleTime(edm::StreamID) const
void preStreamBeginRun(edm::StreamContext const &)
std::vector< StreamData > m_stream
bool isSubProcess() const
Definition: vlib.h:208
tuple size
Write out results.
unsigned int reserveLuminosityPlots(std::string const &name, std::string const &title, std::string const &label, double range, double resolution)
void printProcessSummary(Timing const &total, TimingPerProcess const &summary, std::string const &label, std::string const &process) const
void preallocate(edm::service::SystemBounds const &)
unsigned int id() const
const double m_dqm_eventtime_range
const double m_dqm_pathtime_resolution
unsigned int index() const
Definition: HLTPathStatus.h:55
void start()
Definition: FastTimer.cc:17