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