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 // system headers
6 #ifdef __linux
7 #include <time.h>
8 #else
9 typedef int clockid_t;
10 #define CLOCK_REALTIME 0
11 #define CLOCK_MONOTONIC 1
12 #define CLOCK_PROCESS_CPUTIME_ID 2
13 #define CLOCK_THREAD_CPUTIME_ID 3
14 #endif
15 
16 // C++ headers
17 #include <cmath>
18 #include <limits>
19 #include <iostream>
20 #include <iomanip>
21 #include <string>
22 #include <sstream>
23 #include <unordered_set>
24 #include <unordered_map>
25 
26 // boost headers
27 #include <boost/format.hpp>
28 
29 // CMSSW headers
48 
49 
50 // file-static methods to fill a vector of strings with "(dup.) (...)" entries
51 static
52 void fill_dups(std::vector<std::string> & dups, unsigned int size) {
53  dups.reserve(size);
54  for (unsigned int i = dups.size(); i < size; ++i)
55  dups.push_back( (boost::format("(dup.) (%d)") % i).str() );
56 }
57 
58 
60  // configuration
61  m_timer_id( config.getUntrackedParameter<bool>( "useRealTimeClock" ) ? CLOCK_REALTIME : CLOCK_THREAD_CPUTIME_ID),
62  m_is_cpu_bound( false ),
63  m_enable_timing_paths( config.getUntrackedParameter<bool>( "enableTimingPaths" ) ),
64  m_enable_timing_modules( config.getUntrackedParameter<bool>( "enableTimingModules" ) ),
65  m_enable_timing_exclusive( config.getUntrackedParameter<bool>( "enableTimingExclusive" ) ),
66  m_enable_timing_summary( config.getUntrackedParameter<bool>( "enableTimingSummary" ) ),
67  m_skip_first_path( config.getUntrackedParameter<bool>( "skipFirstPath" ) ),
68  // dqm configuration
69  m_enable_dqm( config.getUntrackedParameter<bool>( "enableDQM" ) ),
70  m_enable_dqm_bypath_active( config.getUntrackedParameter<bool>( "enableDQMbyPathActive" ) ),
71  m_enable_dqm_bypath_total( config.getUntrackedParameter<bool>( "enableDQMbyPathTotal" ) ),
72  m_enable_dqm_bypath_overhead( config.getUntrackedParameter<bool>( "enableDQMbyPathOverhead" ) ),
73  m_enable_dqm_bypath_details( config.getUntrackedParameter<bool>( "enableDQMbyPathDetails" ) ),
74  m_enable_dqm_bypath_counters( config.getUntrackedParameter<bool>( "enableDQMbyPathCounters" ) ),
75  m_enable_dqm_bypath_exclusive( config.getUntrackedParameter<bool>( "enableDQMbyPathExclusive" ) ),
76  m_enable_dqm_bymodule( config.getUntrackedParameter<bool>( "enableDQMbyModule" ) ),
77  m_enable_dqm_bymoduletype( config.getUntrackedParameter<bool>( "enableDQMbyModuleType" ) ),
78  m_enable_dqm_summary( config.getUntrackedParameter<bool>( "enableDQMSummary" ) ),
79  m_enable_dqm_byluminosity( config.getUntrackedParameter<bool>( "enableDQMbyLuminosity" ) ),
80  m_enable_dqm_byls( config.existsAs<bool>("enableDQMbyLumiSection", false) ?
81  config.getUntrackedParameter<bool>("enableDQMbyLumiSection") :
82  ( edm::LogWarning("Configuration") << "enableDQMbyLumi is deprecated, please use enableDQMbyLumiSection instead", config.getUntrackedParameter<bool>("enableDQMbyLumi") )
83  ),
84  m_enable_dqm_bynproc( config.getUntrackedParameter<bool>( "enableDQMbyProcesses" ) ),
85  m_nproc_enabled( false ),
86  m_dqm_eventtime_range( config.getUntrackedParameter<double>( "dqmTimeRange" ) ), // ms
87  m_dqm_eventtime_resolution( config.getUntrackedParameter<double>( "dqmTimeResolution" ) ), // ms
88  m_dqm_pathtime_range( config.getUntrackedParameter<double>( "dqmPathTimeRange" ) ), // ms
89  m_dqm_pathtime_resolution( config.getUntrackedParameter<double>( "dqmPathTimeResolution" ) ), // ms
90  m_dqm_moduletime_range( config.getUntrackedParameter<double>( "dqmModuleTimeRange" ) ), // ms
91  m_dqm_moduletime_resolution( config.getUntrackedParameter<double>( "dqmModuleTimeResolution" ) ), // ms
92  m_dqm_luminosity_range( config.getUntrackedParameter<double>( "dqmLuminosityRange" ) / 1.e30), // cm-2 s-1
93  m_dqm_luminosity_resolution( config.getUntrackedParameter<double>( "dqmLuminosityResolution" ) / 1.e30), // cm-2 s-1
94  m_dqm_ls_range( config.getUntrackedParameter<uint32_t>( "dqmLumiSectionsRange" ) ), // lumisections
95  m_dqm_path( config.getUntrackedParameter<std::string>("dqmPath" ) ),
96  m_luminosity_label( config.getUntrackedParameter<edm::InputTag>("luminosityProduct") ), // SCAL unpacker
97  m_supported_processes( config.getUntrackedParameter<std::vector<unsigned int> >("supportedProcesses") ), // 8, 24, 32
98  // caching
99  m_first_path(0), // these are initialized at prePathBeginRun(),
100  m_last_path(0), // to make sure we cache the correct pointers
101  m_first_endpath(0),
102  m_last_endpath(0),
103  m_is_first_module(false),
104  // per-event accounting
105  m_event(0.),
106  m_source(0.),
107  m_all_paths(0.),
108  m_all_endpaths(0.),
109  m_interpaths(0.),
110  // per-job summary
111  m_summary_events(0),
112  m_summary_event(0.),
113  m_summary_source(0.),
114  m_summary_all_paths(0.),
115  m_summary_all_endpaths(0.),
116  m_summary_interpaths(0.),
117  // DQM - these are initialized at preBeginRun(), to make sure the DQM service has been loaded
118  m_dqms(0),
119  // event summary plots
120  m_dqm_event(0),
121  m_dqm_source(0),
122  m_dqm_all_paths(0),
123  m_dqm_all_endpaths(0),
124  m_dqm_interpaths(0),
125  // event summary plots - summed over nodes with the same number of processes
126  m_dqm_nproc_event(0),
127  m_dqm_nproc_source(0),
128  m_dqm_nproc_all_paths(0),
129  m_dqm_nproc_all_endpaths(0),
130  m_dqm_nproc_interpaths(0),
131  // plots by path
132  m_dqm_paths_active_time(0),
133  m_dqm_paths_total_time(0),
134  m_dqm_paths_exclusive_time(0),
135  m_dqm_paths_interpaths(0),
136  // plots per lumisection
137  m_dqm_byls_event(0),
138  m_dqm_byls_source(0),
139  m_dqm_byls_all_paths(0),
140  m_dqm_byls_all_endpaths(0),
141  m_dqm_byls_interpaths(0),
142  // plots per lumisection - summed over nodes with the same number of processes
143  m_dqm_nproc_byls_event(0),
144  m_dqm_nproc_byls_source(0),
145  m_dqm_nproc_byls_all_paths(0),
146  m_dqm_nproc_byls_all_endpaths(0),
147  m_dqm_nproc_byls_interpaths(0),
148  // plots vs. instantaneous luminosity
149  m_dqm_byluminosity_event(0),
150  m_dqm_byluminosity_source(0),
151  m_dqm_byluminosity_all_paths(0),
152  m_dqm_byluminosity_all_endpaths(0),
153  m_dqm_byluminosity_interpaths(0),
154  // plots vs. instantaneous luminosity - summed over nodes with the same number of processes
155  m_dqm_nproc_byluminosity_event(0),
156  m_dqm_nproc_byluminosity_source(0),
157  m_dqm_nproc_byluminosity_all_paths(0),
158  m_dqm_nproc_byluminosity_all_endpaths(0),
159  m_dqm_nproc_byluminosity_interpaths(0),
160  // per-path and per-module accounting
161  m_current_path(0),
162  m_paths(),
163  m_modules(),
164  m_moduletypes(),
165  m_fast_modules(),
166  m_fast_moduletypes()
167 {
168  // enable timers if required by DQM plots
176 
185 
188 
191  registry.watchPostEndJob( this, & FastTimerService::postEndJob );
195  registry.watchPreSource( this, & FastTimerService::preSource );
196  registry.watchPostSource( this, & FastTimerService::postSource );
197  // watch per-path events
200  // watch per-module events if enabled
202  registry.watchPreModule( this, & FastTimerService::preModule );
203  registry.watchPostModule( this, & FastTimerService::postModule );
204  }
205 
206 #if defined(__APPLE__) || defined (__MACH__)
207  host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &m_clock_port);
208 #endif // defined(__APPLE__) || defined(__MACH__)
209 }
210 
212 {
213 #if defined(__APPLE__) || defined (__MACH__)
214  mach_port_deallocate(mach_task_self(), m_clock_port);
215 #endif // defined(__APPLE__) || defined(__MACH__)
216 }
217 
219 {
220  //edm::LogImportant("FastTimerService") << __func__ << "()";
221 
222  // check if the process is bound to a single CPU.
223  // otherwise, the results of the CLOCK_THREAD_CPUTIME_ID timer might be inaccurate
224 #ifdef __linux
225  // cpu affinity is currently only supported on LINUX
227  if ((m_timer_id != CLOCK_REALTIME) and not m_is_cpu_bound) {
228  clockid_t clock;
229  if (clock_getcpuclockid(0, & clock) == ENOENT)
230  // the process is NOT bound to a single CPU, and the system does not support a consistent time source across multiple CPUs
231  edm::LogError("FastTimerService") << "this process is NOT bound to a single CPU, the results of the FastTimerService may be undefined";
232  }
233 #endif
234 
236  uint32_t size_p = tns.getTrigPaths().size();
237  uint32_t size_e = tns.getEndPaths().size();
238  uint32_t size = size_p + size_e;
239  for (uint32_t i = 0; i < size_p; ++i) {
240  std::string const & label = tns.getTrigPath(i);
241  m_paths[label].index = i;
242  }
243  for (uint32_t i = 0; i < size_e; ++i) {
244  std::string const & label = tns.getEndPath(i);
245  m_paths[label].index = size_p + i;
246  }
247 
248  // associate to each path all the modules it contains
249  for (uint32_t i = 0; i < tns.getTrigPaths().size(); ++i)
251  for (uint32_t i = 0; i < tns.getEndPaths().size(); ++i)
253 
254  if (m_enable_dqm)
255  // load the DQM store
257 
258  if (m_dqms) {
259  // book MonitorElement's
260  int eventbins = (int) std::ceil(m_dqm_eventtime_range / m_dqm_eventtime_resolution);
261  int pathbins = (int) std::ceil(m_dqm_pathtime_range / m_dqm_pathtime_resolution);
262  int modulebins = (int) std::ceil(m_dqm_moduletime_range / m_dqm_moduletime_resolution);
263  int lumibins = (int) std::ceil(m_dqm_luminosity_range / m_dqm_luminosity_resolution);
264 
265  // event summary plots
266  if (m_enable_dqm_summary) {
268  m_dqm_event = m_dqms->book1D("event", "Event processing time", eventbins, 0., m_dqm_eventtime_range)->getTH1F();
269  m_dqm_event ->StatOverflows(true);
270  m_dqm_event ->SetXTitle("processing time [ms]");
271  m_dqm_source = m_dqms->book1D("source", "Source processing time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
272  m_dqm_source ->StatOverflows(true);
273  m_dqm_source ->SetXTitle("processing time [ms]");
274  m_dqm_all_paths = m_dqms->book1D("all_paths", "Paths processing time", eventbins, 0., m_dqm_eventtime_range)->getTH1F();
275  m_dqm_all_paths ->StatOverflows(true);
276  m_dqm_all_paths ->SetXTitle("processing time [ms]");
277  m_dqm_all_endpaths = m_dqms->book1D("all_endpaths", "EndPaths processing time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
278  m_dqm_all_endpaths ->StatOverflows(true);
279  m_dqm_all_endpaths ->SetXTitle("processing time [ms]");
280  m_dqm_interpaths = m_dqms->book1D("interpaths", "Time spent between paths", pathbins, 0., m_dqm_eventtime_range)->getTH1F();
281  m_dqm_interpaths ->StatOverflows(true);
282  m_dqm_interpaths ->SetXTitle("processing time [ms]");
283  }
284 
285  // event summary plots - summed over nodes with the same number of processes
287  TH1F * plot;
288  for (int n : m_supported_processes) {
289  m_dqms->setCurrentFolder( (boost::format("%s/Running %d processes") % m_dqm_path % n).str() );
290  plot = m_dqms->book1D("event", "Event processing time", eventbins, 0., m_dqm_eventtime_range)->getTH1F();
291  plot->StatOverflows(true);
292  plot->SetXTitle("processing time [ms]");
293  plot = m_dqms->book1D("source", "Source processing time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
294  plot->StatOverflows(true);
295  plot->SetXTitle("processing time [ms]");
296  plot = m_dqms->book1D("all_paths", "Paths processing time", eventbins, 0., m_dqm_eventtime_range)->getTH1F();
297  plot->StatOverflows(true);
298  plot->SetXTitle("processing time [ms]");
299  plot = m_dqms->book1D("all_endpaths", "EndPaths processing time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
300  plot->StatOverflows(true);
301  plot->SetXTitle("processing time [ms]");
302  plot = m_dqms->book1D("interpaths", "Time spent between paths", pathbins, 0., m_dqm_eventtime_range)->getTH1F();
303  plot->StatOverflows(true);
304  plot->SetXTitle("processing time [ms]");
305  }
306  }
307 
308  // plots by path
310  m_dqm_paths_active_time = m_dqms->bookProfile("paths_active_time", "Additional time spent in each path", size, -0.5, size-0.5, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
311  m_dqm_paths_active_time ->StatOverflows(true);
312  m_dqm_paths_active_time ->SetYTitle("processing time [ms]");
313  m_dqm_paths_total_time = m_dqms->bookProfile("paths_total_time", "Total time spent in each path", size, -0.5, size-0.5, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
314  m_dqm_paths_total_time ->StatOverflows(true);
315  m_dqm_paths_total_time ->SetYTitle("processing time [ms]");
316  m_dqm_paths_exclusive_time = m_dqms->bookProfile("paths_exclusive_time", "Exclusive time spent in each path", size, -0.5, size-0.5, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
317  m_dqm_paths_exclusive_time ->StatOverflows(true);
318  m_dqm_paths_exclusive_time ->SetYTitle("processing time [ms]");
319  m_dqm_paths_interpaths = m_dqms->bookProfile("paths_interpaths", "Time spent between each path", size, -0.5, size-0.5, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
320  m_dqm_paths_interpaths ->StatOverflows(true);
321  m_dqm_paths_interpaths ->SetYTitle("processing time [ms]");
322 
323  for (uint32_t i = 0; i < size_p; ++i) {
324  std::string const & label = tns.getTrigPath(i);
325  m_dqm_paths_active_time ->GetXaxis()->SetBinLabel(i + 1, label.c_str());
326  m_dqm_paths_total_time ->GetXaxis()->SetBinLabel(i + 1, label.c_str());
327  m_dqm_paths_exclusive_time ->GetXaxis()->SetBinLabel(i + 1, label.c_str());
328  m_dqm_paths_interpaths ->GetXaxis()->SetBinLabel(i + 1, label.c_str());
329  }
330  for (uint32_t i = 0; i < size_e; ++i) {
331  std::string const & label = tns.getEndPath(i);
332  m_dqm_paths_active_time ->GetXaxis()->SetBinLabel(i + size_p + 1, label.c_str());
333  m_dqm_paths_total_time ->GetXaxis()->SetBinLabel(i + size_p + 1, label.c_str());
334  m_dqm_paths_exclusive_time ->GetXaxis()->SetBinLabel(i + size_p + 1, label.c_str());
335  m_dqm_paths_interpaths ->GetXaxis()->SetBinLabel(i + size_p + 1, label.c_str());
336  }
337 
338  // per-lumisection plots
339  if (m_enable_dqm_byls) {
341  m_dqm_byls_event = m_dqms->bookProfile("event_byls", "Event processing time, by LumiSection", m_dqm_ls_range, 0.5, m_dqm_ls_range+0.5, eventbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
342  m_dqm_byls_event ->StatOverflows(true);
343  m_dqm_byls_event ->SetXTitle("lumisection");
344  m_dqm_byls_event ->SetYTitle("processing time [ms]");
345  m_dqm_byls_source = m_dqms->bookProfile("source_byls", "Source processing time, by LumiSection", m_dqm_ls_range, 0.5, m_dqm_ls_range+0.5, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
346  m_dqm_byls_source ->StatOverflows(true);
347  m_dqm_byls_source ->SetXTitle("lumisection");
348  m_dqm_byls_source ->SetYTitle("processing time [ms]");
349  m_dqm_byls_all_paths = m_dqms->bookProfile("all_paths_byls", "Paths processing time, by LumiSection", m_dqm_ls_range, 0.5, m_dqm_ls_range+0.5, eventbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
350  m_dqm_byls_all_paths ->StatOverflows(true);
351  m_dqm_byls_all_paths ->SetXTitle("lumisection");
352  m_dqm_byls_all_paths ->SetYTitle("processing time [ms]");
353  m_dqm_byls_all_endpaths = m_dqms->bookProfile("all_endpaths_byls", "EndPaths processing time, by LumiSection", m_dqm_ls_range, 0.5, m_dqm_ls_range+0.5, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
354  m_dqm_byls_all_endpaths ->StatOverflows(true);
355  m_dqm_byls_all_endpaths ->SetXTitle("lumisection");
356  m_dqm_byls_all_endpaths ->SetYTitle("processing time [ms]");
357  m_dqm_byls_interpaths = m_dqms->bookProfile("interpaths_byls", "Time spent between paths, by LumiSection", m_dqm_ls_range, 0.5, m_dqm_ls_range+0.5, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
358  m_dqm_byls_interpaths ->StatOverflows(true);
359  m_dqm_byls_interpaths ->SetXTitle("lumisection");
360  m_dqm_byls_interpaths ->SetYTitle("processing time [ms]");
361  }
362 
363  // per-lumisection plots
364  if (m_enable_dqm_byls and m_enable_dqm_bynproc) {
365  TProfile * plot;
366  for (int n : m_supported_processes) {
367  m_dqms->setCurrentFolder( (boost::format("%s/Running %d processes") % m_dqm_path % n).str() );
368  plot = m_dqms->bookProfile("event_byls", "Event processing time, by LumiSection", m_dqm_ls_range, 0.5, m_dqm_ls_range+0.5, eventbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
369  plot->StatOverflows(true);
370  plot->SetXTitle("lumisection");
371  plot->SetYTitle("processing time [ms]");
372  plot = m_dqms->bookProfile("source_byls", "Source processing time, by LumiSection", m_dqm_ls_range, 0.5, m_dqm_ls_range+0.5, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
373  plot->StatOverflows(true);
374  plot->SetXTitle("lumisection");
375  plot->SetYTitle("processing time [ms]");
376  plot = m_dqms->bookProfile("all_paths_byls", "Paths processing time, by LumiSection", m_dqm_ls_range, 0.5, m_dqm_ls_range+0.5, eventbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
377  plot->StatOverflows(true);
378  plot->SetXTitle("lumisection");
379  plot->SetYTitle("processing time [ms]");
380  plot = m_dqms->bookProfile("all_endpaths_byls", "EndPaths processing time, by LumiSection", m_dqm_ls_range, 0.5, m_dqm_ls_range+0.5, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
381  plot->StatOverflows(true);
382  plot->SetXTitle("lumisection");
383  plot->SetYTitle("processing time [ms]");
384  plot = m_dqms->bookProfile("interpaths_byls", "Time spent between paths, by LumiSection", m_dqm_ls_range, 0.5, m_dqm_ls_range+0.5, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
385  plot->StatOverflows(true);
386  plot->SetXTitle("lumisection");
387  plot->SetYTitle("processing time [ms]");
388  }
389  }
390 
391  // plots vs. instantaneous luminosity
394  m_dqm_byluminosity_event = m_dqms->bookProfile("event_byluminosity", "Event processing time vs. instantaneous luminosity", lumibins, 0., m_dqm_luminosity_range, eventbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
395  m_dqm_byluminosity_event ->StatOverflows(true);
396  m_dqm_byluminosity_event ->SetXTitle("instantaneous luminosity [10^{30} cm^{-2}s^{-1}]");
397  m_dqm_byluminosity_event ->SetYTitle("processing time [ms]");
398  m_dqm_byluminosity_source = m_dqms->bookProfile("source_byluminosity", "Source processing time vs. instantaneous luminosity", lumibins, 0., m_dqm_luminosity_range, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
399  m_dqm_byluminosity_source ->StatOverflows(true);
400  m_dqm_byluminosity_source ->SetXTitle("instantaneous luminosity [10^{30} cm^{-2}s^{-1}]");
401  m_dqm_byluminosity_source ->SetYTitle("processing time [ms]");
402  m_dqm_byluminosity_all_paths = m_dqms->bookProfile("all_paths_byluminosity", "Paths processing time vs. instantaneous luminosity", lumibins, 0., m_dqm_luminosity_range, eventbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
403  m_dqm_byluminosity_all_paths ->StatOverflows(true);
404  m_dqm_byluminosity_all_paths ->SetXTitle("instantaneous luminosity [10^{30} cm^{-2}s^{-1}]");
405  m_dqm_byluminosity_all_paths ->SetYTitle("processing time [ms]");
406  m_dqm_byluminosity_all_endpaths = m_dqms->bookProfile("all_endpaths_byluminosity", "EndPaths processing time vs. instantaneous luminosity", lumibins, 0., m_dqm_luminosity_range, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
407  m_dqm_byluminosity_all_endpaths ->StatOverflows(true);
408  m_dqm_byluminosity_all_endpaths ->SetXTitle("instantaneous luminosity [10^{30} cm^{-2}s^{-1}]");
409  m_dqm_byluminosity_all_endpaths ->SetYTitle("processing time [ms]");
410  m_dqm_byluminosity_interpaths = m_dqms->bookProfile("interpaths_byluminosity", "Time spent between paths vs. instantaneous luminosity", lumibins, 0., m_dqm_luminosity_range, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
411  m_dqm_byluminosity_interpaths ->StatOverflows(true);
412  m_dqm_byluminosity_interpaths ->SetXTitle("instantaneous luminosity [10^{30} cm^{-2}s^{-1}]");
413  m_dqm_byluminosity_interpaths ->SetYTitle("processing time [ms]");
414  }
415 
416  // plots vs. instantaneous luminosity
417  if (m_enable_dqm_byluminosity and m_enable_dqm_bynproc) {
418  TProfile * plot;
419  for (int n : m_supported_processes) {
420  m_dqms->setCurrentFolder( (boost::format("%s/Running %d processes") % m_dqm_path % n).str() );
421  plot = m_dqms->bookProfile("event_byluminosity", "Event processing time vs. instantaneous luminosity", lumibins, 0., m_dqm_luminosity_range, eventbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
422  plot->StatOverflows(true);
423  plot->SetYTitle("processing time [ms]");
424  plot->SetXTitle("instantaneous luminosity [10^{30} cm^{-2}s^{-1}]");
425  plot = m_dqms->bookProfile("source_byluminosity", "Source processing time vs. instantaneous luminosity", lumibins, 0., m_dqm_luminosity_range, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
426  plot->StatOverflows(true);
427  plot->SetYTitle("processing time [ms]");
428  plot->SetXTitle("instantaneous luminosity [10^{30} cm^{-2}s^{-1}]");
429  plot = m_dqms->bookProfile("all_paths_byluminosity", "Paths processing time vs. instantaneous luminosity", lumibins, 0., m_dqm_luminosity_range, eventbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
430  plot->StatOverflows(true);
431  plot->SetYTitle("processing time [ms]");
432  plot->SetXTitle("instantaneous luminosity [10^{30} cm^{-2}s^{-1}]");
433  plot = m_dqms->bookProfile("all_endpaths_byluminosity", "EndPaths processing time vs. instantaneous luminosity", lumibins, 0., m_dqm_luminosity_range, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
434  plot->StatOverflows(true);
435  plot->SetYTitle("processing time [ms]");
436  plot->SetXTitle("instantaneous luminosity [10^{30} cm^{-2}s^{-1}]");
437  plot = m_dqms->bookProfile("interpaths_byluminosity", "Time spent between paths vs. instantaneous luminosity", lumibins, 0., m_dqm_luminosity_range, pathbins, 0., std::numeric_limits<double>::infinity(), " ")->getTProfile();
438  plot->StatOverflows(true);
439  plot->SetYTitle("processing time [ms]");
440  plot->SetXTitle("instantaneous luminosity [10^{30} cm^{-2}s^{-1}]");
441  }
442  }
443 
444  // per-path and per-module accounting
445  if (m_enable_timing_paths) {
446  m_dqms->setCurrentFolder((m_dqm_path + "/Paths"));
447  for (auto & keyval: m_paths) {
448  std::string const & pathname = keyval.first;
449  PathInfo & pathinfo = keyval.second;
450 
452  pathinfo.dqm_active = m_dqms->book1D(pathname + "_active", pathname + " active time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
453  pathinfo.dqm_active ->StatOverflows(true);
454  pathinfo.dqm_active ->SetXTitle("processing time [ms]");
455  }
456 
458  pathinfo.dqm_total = m_dqms->book1D(pathname + "_total", pathname + " total time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
459  pathinfo.dqm_total ->StatOverflows(true);
460  pathinfo.dqm_total ->SetXTitle("processing time [ms]");
461  }
462 
464  pathinfo.dqm_premodules = m_dqms->book1D(pathname + "_premodules", pathname + " pre-modules overhead", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
465  pathinfo.dqm_premodules ->StatOverflows(true);
466  pathinfo.dqm_premodules ->SetXTitle("processing time [ms]");
467  pathinfo.dqm_intermodules = m_dqms->book1D(pathname + "_intermodules", pathname + " inter-modules overhead", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
468  pathinfo.dqm_intermodules ->StatOverflows(true);
469  pathinfo.dqm_intermodules ->SetXTitle("processing time [ms]");
470  pathinfo.dqm_postmodules = m_dqms->book1D(pathname + "_postmodules", pathname + " post-modules overhead", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
471  pathinfo.dqm_postmodules ->StatOverflows(true);
472  pathinfo.dqm_postmodules ->SetXTitle("processing time [ms]");
473  pathinfo.dqm_overhead = m_dqms->book1D(pathname + "_overhead", pathname + " overhead time", modulebins, 0., m_dqm_moduletime_range)->getTH1F();
474  pathinfo.dqm_overhead ->StatOverflows(true);
475  pathinfo.dqm_overhead ->SetXTitle("processing time [ms]");
476  }
477 
479  // book histograms for modules-in-paths statistics
480 
481  // find histograms X-axis labels
482  uint32_t id;
483  std::vector<std::string> const & modules = ((id = tns.findTrigPath(pathname)) != tns.getTrigPaths().size()) ? tns.getTrigPathModules(id) :
484  ((id = tns.findEndPath(pathname)) != tns.getEndPaths().size()) ? tns.getEndPathModules(id) :
485  std::vector<std::string>();
486 
487  static std::vector<std::string> dup;
488  if (modules.size() > dup.size())
489  fill_dups(dup, modules.size());
490 
491  std::vector<const char *> labels(modules.size(), nullptr);
492  for (uint32_t i = 0; i < modules.size(); ++i)
493  labels[i] = (pathinfo.modules[i]) ? modules[i].c_str() : dup[i].c_str();
494 
495  // book counter histograms
496  if (m_enable_dqm_bypath_counters) {
497  pathinfo.dqm_module_counter = m_dqms->book1D(pathname + "_module_counter", pathname + " module counter", modules.size(), -0.5, modules.size() - 0.5)->getTH1F();
498  // find module labels
499  for (uint32_t i = 0; i < modules.size(); ++i) {
500  pathinfo.dqm_module_counter->GetXaxis()->SetBinLabel( i+1, labels[i] );
501  }
502  }
503  // book detailed timing histograms
505  pathinfo.dqm_module_active = m_dqms->book1D(pathname + "_module_active", pathname + " module active", modules.size(), -0.5, modules.size() - 0.5)->getTH1F();
506  pathinfo.dqm_module_active ->SetYTitle("cumulative processing time [ms]");
507  pathinfo.dqm_module_total = m_dqms->book1D(pathname + "_module_total", pathname + " module total", modules.size(), -0.5, modules.size() - 0.5)->getTH1F();
508  pathinfo.dqm_module_total ->SetYTitle("cumulative processing time [ms]");
509  // find module labels
510  for (uint32_t i = 0; i < modules.size(); ++i) {
511  pathinfo.dqm_module_active ->GetXaxis()->SetBinLabel( i+1, labels[i] );
512  pathinfo.dqm_module_total ->GetXaxis()->SetBinLabel( i+1, labels[i] );
513  }
514  }
515  }
516 
517  // book exclusive path time histograms
519  pathinfo.dqm_exclusive = m_dqms->book1D(pathname + "_exclusive", pathname + " exclusive time", pathbins, 0., m_dqm_pathtime_range)->getTH1F();
520  pathinfo.dqm_exclusive ->StatOverflows(true);
521  pathinfo.dqm_exclusive ->SetXTitle("processing time [ms]");
522  }
523 
524  }
525  }
526 
527  if (m_enable_dqm_bymodule) {
528  m_dqms->setCurrentFolder((m_dqm_path + "/Modules"));
529  for (auto & keyval: m_modules) {
530  std::string const & label = keyval.first;
531  ModuleInfo & module = keyval.second;
532  module.dqm_active = m_dqms->book1D(label, label, modulebins, 0., m_dqm_moduletime_range)->getTH1F();
533  module.dqm_active->StatOverflows(true);
534  module.dqm_active->SetXTitle("processing time [ms]");
535  }
536  }
537 
539  m_dqms->setCurrentFolder((m_dqm_path + "/ModuleTypes"));
540  for (auto & keyval: m_moduletypes) {
541  std::string const & label = keyval.first;
542  ModuleInfo & module = keyval.second;
543  module.dqm_active = m_dqms->book1D(label, label, modulebins, 0., m_dqm_moduletime_range)->getTH1F();
544  module.dqm_active->StatOverflows(true);
545  module.dqm_active->SetXTitle("processing time [ms]");
546  }
547  }
548 
549  }
550 }
551 
552 void FastTimerService::setNumberOfProcesses(unsigned int procs) {
553  // the service is not configured to support plots by number of processes
555  return;
556 
557  // the DQM store has not been configured yet
558  if (not m_dqms)
559  return;
560 
561  // check if the service is configured to support this number of processes
562  if (std::find(m_supported_processes.begin(), m_supported_processes.end(), procs) == m_supported_processes.end()) {
563  m_nproc_enabled = false;
564  // event summary plots - summed over nodes with the same number of processes
565  m_dqm_nproc_event = 0;
566  m_dqm_nproc_source = 0;
570  // plots per lumisection - summed over nodes with the same number of processes
576  // plots vs. instantaneous luminosity - summed over nodes with the same number of processes
582  } else {
583  m_nproc_enabled = true;
584  // event summary plots - summed over nodes with the same number of processes
585  m_dqm_nproc_event = m_dqms->get( (boost::format("%s/Running %d processes/%s") % m_dqm_path % procs % "event" ).str() )->getTH1F();
586  m_dqm_nproc_source = m_dqms->get( (boost::format("%s/Running %d processes/%s") % m_dqm_path % procs % "source" ).str() )->getTH1F();
587  m_dqm_nproc_all_paths = m_dqms->get( (boost::format("%s/Running %d processes/%s") % m_dqm_path % procs % "all_paths" ).str() )->getTH1F();
588  m_dqm_nproc_all_endpaths = m_dqms->get( (boost::format("%s/Running %d processes/%s") % m_dqm_path % procs % "all_endpaths" ).str() )->getTH1F();
589  m_dqm_nproc_interpaths = m_dqms->get( (boost::format("%s/Running %d processes/%s") % m_dqm_path % procs % "interpaths" ).str() )->getTH1F();
590  // plots per lumisection - summed over nodes with the same number of processes
591  m_dqm_nproc_byls_event = m_dqms->get( (boost::format("%s/Running %d processes/%s") % m_dqm_path % procs % "event_byls" ).str() )->getTProfile();
592  m_dqm_nproc_byls_source = m_dqms->get( (boost::format("%s/Running %d processes/%s") % m_dqm_path % procs % "source_byls" ).str() )->getTProfile();
593  m_dqm_nproc_byls_all_paths = m_dqms->get( (boost::format("%s/Running %d processes/%s") % m_dqm_path % procs % "all_paths_byls" ).str() )->getTProfile();
594  m_dqm_nproc_byls_all_endpaths = m_dqms->get( (boost::format("%s/Running %d processes/%s") % m_dqm_path % procs % "all_endpaths_byls" ).str() )->getTProfile();
595  m_dqm_nproc_byls_interpaths = m_dqms->get( (boost::format("%s/Running %d processes/%s") % m_dqm_path % procs % "interpaths_byls" ).str() )->getTProfile();
596  // plots vs. instantaneous luminosity - summed over nodes with the same number of processes
597  m_dqm_nproc_byluminosity_event = m_dqms->get( (boost::format("%s/Running %d processes/%s") % m_dqm_path % procs % "event_byluminosity" ).str() )->getTProfile();
598  m_dqm_nproc_byluminosity_source = m_dqms->get( (boost::format("%s/Running %d processes/%s") % m_dqm_path % procs % "source_byluminosity" ).str() )->getTProfile();
599  m_dqm_nproc_byluminosity_all_paths = m_dqms->get( (boost::format("%s/Running %d processes/%s") % m_dqm_path % procs % "all_paths_byluminosity" ).str() )->getTProfile();
600  m_dqm_nproc_byluminosity_all_endpaths = m_dqms->get( (boost::format("%s/Running %d processes/%s") % m_dqm_path % procs % "all_endpaths_byluminosity").str() )->getTProfile();
601  m_dqm_nproc_byluminosity_interpaths = m_dqms->get( (boost::format("%s/Running %d processes/%s") % m_dqm_path % procs % "interpaths_byluminosity" ).str() )->getTProfile();
602  }
603 }
604 
606  //edm::LogImportant("FastTimerService") << __func__ << "()";
607 
609  // print a timing sumary for the whle job
611 
612  std::ostringstream out;
613  out << std::fixed << std::setprecision(6);
614  out << "FastReport " << (m_timer_id == CLOCK_REALTIME ? "(real time) " : "(CPU time) ") << '\n';
615  out << "FastReport " << std::right << std::setw(10) << m_summary_source / (double) m_summary_events << " Source" << '\n';
616  out << "FastReport " << std::right << std::setw(10) << m_summary_event / (double) m_summary_events << " Event" << '\n';
617  out << "FastReport " << std::right << std::setw(10) << m_summary_all_paths / (double) m_summary_events << " all Paths" << '\n';
618  out << "FastReport " << std::right << std::setw(10) << m_summary_all_endpaths / (double) m_summary_events << " all EndPaths" << '\n';
619  out << "FastReport " << std::right << std::setw(10) << m_summary_interpaths / (double) m_summary_events << " between paths" << '\n';
621  double modules_total = 0.;
622  for (auto & keyval: m_modules)
623  modules_total += keyval.second.summary_active;
624  out << "FastReport " << std::right << std::setw(10) << modules_total / (double) m_summary_events << " all Modules" << '\n';
625  }
626  out << '\n';
628  out << "FastReport " << (m_timer_id == CLOCK_REALTIME ? "(real time) " : "(CPU time) ") << " Active Path" << '\n';
629  for (auto const & name: tns.getTrigPaths())
630  out << "FastReport "
631  << std::right << std::setw(10) << m_paths[name].summary_active / (double) m_summary_events << " "
632  << name << '\n';
633  out << '\n';
634  out << "FastReport " << (m_timer_id == CLOCK_REALTIME ? "(real time) " : "(CPU time) ") << " Active EndPath" << '\n';
635  for (auto const & name: tns.getEndPaths())
636  out << "FastReport "
637  << std::right << std::setw(10) << m_paths[name].summary_active / (double) m_summary_events << " "
638  << name << '\n';
639  } else if (m_enable_timing_paths and m_enable_timing_modules) {
640  out << "FastReport " << (m_timer_id == CLOCK_REALTIME ? "(real time) " : "(CPU time) ") << " Active Pre- Inter- Post-mods Overhead Total Path" << '\n';
641  for (auto const & name: tns.getTrigPaths()) {
642  out << "FastReport "
643  << std::right << std::setw(10) << m_paths[name].summary_active / (double) m_summary_events << " "
644  << std::right << std::setw(10) << m_paths[name].summary_premodules / (double) m_summary_events << " "
645  << std::right << std::setw(10) << m_paths[name].summary_intermodules / (double) m_summary_events << " "
646  << std::right << std::setw(10) << m_paths[name].summary_postmodules / (double) m_summary_events << " "
647  << std::right << std::setw(10) << m_paths[name].summary_overhead / (double) m_summary_events << " "
648  << std::right << std::setw(10) << m_paths[name].summary_total / (double) m_summary_events << " "
649  << name << '\n';
650  }
651  out << '\n';
652  out << "FastReport " << (m_timer_id == CLOCK_REALTIME ? "(real time) " : "(CPU time) ") << " Active Pre- Inter- Post-mods Overhead Total EndPath" << '\n';
653  for (auto const & name: tns.getEndPaths()) {
654  out << "FastReport "
655  << std::right << std::setw(10) << m_paths[name].summary_active / (double) m_summary_events << " "
656  << std::right << std::setw(10) << m_paths[name].summary_premodules / (double) m_summary_events << " "
657  << std::right << std::setw(10) << m_paths[name].summary_intermodules / (double) m_summary_events << " "
658  << std::right << std::setw(10) << m_paths[name].summary_postmodules / (double) m_summary_events << " "
659  << std::right << std::setw(10) << m_paths[name].summary_overhead / (double) m_summary_events << " "
660  << std::right << std::setw(10) << m_paths[name].summary_total / (double) m_summary_events << " "
661  << name << '\n';
662  }
663  }
664  out << '\n';
665  if (m_enable_timing_modules) {
666  out << "FastReport " << (m_timer_id == CLOCK_REALTIME ? "(real time) " : "(CPU time) ") << " Active Module" << '\n';
667  for (auto & keyval: m_modules) {
668  std::string const & label = keyval.first;
669  ModuleInfo const & module = keyval.second;
670  out << "FastReport " << std::right << std::setw(10) << module.summary_active / (double) m_summary_events << " " << label << '\n';
671  }
672  out << "FastReport " << (m_timer_id == CLOCK_REALTIME ? "(real time) " : "(CPU time) ") << " Active Module" << '\n';
673  out << '\n';
674  out << "FastReport " << (m_timer_id == CLOCK_REALTIME ? "(real time) " : "(CPU time) ") << " Active Module" << '\n';
675  for (auto & keyval: m_moduletypes) {
676  std::string const & label = keyval.first;
677  ModuleInfo const & module = keyval.second;
678  out << "FastReport " << std::right << std::setw(10) << module.summary_active / (double) m_summary_events << " " << label << '\n';
679  }
680  out << "FastReport " << (m_timer_id == CLOCK_REALTIME ? "(real time) " : "(CPU time) ") << " Active Module" << '\n';
681  }
682  out << '\n';
683  edm::LogVerbatim("FastReport") << out.str();
684  }
685 
686  // needed for the DAQ when reconfiguring between runs
687  reset();
688 }
689 
691  // transient dqm configuration
692  m_nproc_enabled = false;
693  // caching
694  m_first_path = 0; // these are initialized at prePathBeginRun(),
695  m_last_path = 0; // to make sure we cache the correct pointers
696  m_first_endpath = 0;
697  m_last_endpath = 0;
698  m_is_first_module = false;
699  // per-event accounting
700  m_event = 0.;
701  m_source = 0.;
702  m_all_paths = 0.;
703  m_all_endpaths = 0.;
704  m_interpaths = 0.;
705  // per-job summary
706  m_summary_events = 0;
707  m_summary_event = 0.;
708  m_summary_source = 0.;
709  m_summary_all_paths = 0.;
712  // DQM - the DAQ destroys and re-creates the DQM and DQMStore services at each reconfigure, so we don't need to clean them up
713  m_dqms = 0;
714  // event summary plots
715  m_dqm_event = 0;
716  m_dqm_source = 0;
717  m_dqm_all_paths = 0;
718  m_dqm_all_endpaths = 0;
719  m_dqm_interpaths = 0;
720  // event summary plots - summed over nodes with the same number of processes
721  m_dqm_nproc_event = 0;
722  m_dqm_nproc_source = 0;
726  // plots by path
731  // plots per lumisection
732  m_dqm_byls_event = 0;
733  m_dqm_byls_source = 0;
737  // plots per lumisection - summed over nodes with the same number of processes
743  // plots vs. instantaneous luminosity
749  // plots vs. instantaneous luminosity - summed over nodes with the same number of processes
755  // per-path and per-module accounting
756  m_current_path = 0;
757  m_paths.clear(); // this should destroy all PathInfo objects and Reset the associated plots
758  m_modules.clear(); // this should destroy all ModuleInfo objects and Reset the associated plots
759  m_moduletypes.clear(); // this should destroy all ModuleInfo objects and Reset the associated plots
760  m_fast_modules.clear();
761  m_fast_moduletypes.clear();
762 }
763 
765  //edm::LogImportant("FastTimerService") << __func__ << "(" << & module << ")";
766  //edm::LogImportant("FastTimerService") << "module type " << module.moduleName() << " label " << module.moduleLabel() << " @ " << & module;
767 
768  // allocate a counter for each module and module type
769  m_fast_modules[& module] = & m_modules[module.moduleLabel()];;
771 }
772 
774  //edm::LogImportant("FastTimerService") << __func__ << "(...)";
775 
776  // new event, reset the per-event counter
778 
779  // clear the event counters
780  m_event = 0;
781  m_all_paths = 0;
782  m_all_endpaths = 0;
783  m_interpaths = 0;
784  for (auto & keyval : m_paths) {
785  keyval.second.time_active = 0.;
786  keyval.second.time_premodules = 0.;
787  keyval.second.time_intermodules = 0.;
788  keyval.second.time_postmodules = 0.;
789  keyval.second.time_total = 0.;
790  }
791  for (auto & keyval : m_modules) {
792  keyval.second.time_active = 0.;
793  keyval.second.has_just_run = false;
794  keyval.second.is_exclusive = false;
795  }
796  for (auto & keyval : m_moduletypes) {
797  keyval.second.time_active = 0.;
798  keyval.second.has_just_run = false;
799  keyval.second.is_exclusive = false;
800  }
801 
802  // copy the start event timestamp as the end of the previous path
803  // used by the inter-path overhead measurement
804  m_timer_path.second = m_timer_event.first;
805 }
806 
808  //edm::LogImportant("FastTimerService") << __func__ << "(...)";
809 
811  for (auto & keyval: m_paths) {
812  PathInfo & pathinfo = keyval.second;
813  float exclusive = pathinfo.time_overhead;
814 
815  for (uint32_t i = 0; i <= pathinfo.last_run; ++i) {
816  ModuleInfo * module = pathinfo.modules[i];
817  if (module == 0)
818  // this is a module occurring more than once in the same path, skip it after the first occurrence
819  continue;
820  if (module->is_exclusive)
821  exclusive += module->time_active;
822  }
823  m_dqm_paths_exclusive_time->Fill(pathinfo.index, exclusive * 1000.);
825  pathinfo.dqm_exclusive->Fill(exclusive * 1000.);
826  }
827  }
828  }
829 
830  // fill plots for per-event time by module
831  if (m_dqms and m_enable_dqm_bymodule) {
832  for (auto & keyval : m_modules) {
833  ModuleInfo & module = keyval.second;
834  module.dqm_active->Fill(module.time_active * 1000.);
835  }
836  }
837  // fill plots for per-event time by module type
839  for (auto & keyval : m_moduletypes) {
840  ModuleInfo & module = keyval.second;
841  module.dqm_active->Fill(module.time_active * 1000.);
842  }
843  }
844 
845  // stop the per-event timer, and account event time
849  // 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
850  double interpaths = delta(m_timer_path.second, m_timer_event.second);
851  m_interpaths += interpaths;
853  if (m_dqms) {
854  m_dqm_paths_interpaths->Fill(m_paths.size(), interpaths * 1000.);
855 
856  if (m_enable_dqm_summary) {
857  m_dqm_event ->Fill(m_event * 1000.);
858  m_dqm_source ->Fill(m_source * 1000.);
859  m_dqm_all_paths ->Fill(m_all_paths * 1000.);
860  m_dqm_all_endpaths ->Fill(m_all_endpaths * 1000.);
861  m_dqm_interpaths ->Fill(m_interpaths * 1000.);
862 
863  if (m_nproc_enabled) {
864  m_dqm_nproc_event ->Fill(m_event * 1000.);
865  m_dqm_nproc_source ->Fill(m_source * 1000.);
866  m_dqm_nproc_all_paths ->Fill(m_all_paths * 1000.);
868  m_dqm_nproc_interpaths ->Fill(m_interpaths * 1000.);
869  }
870  }
871 
872  if (m_enable_dqm_byls) {
873  unsigned int ls = event.getLuminosityBlock().luminosityBlock();
874  m_dqm_byls_event ->Fill(ls, m_event * 1000.);
875  m_dqm_byls_source ->Fill(ls, m_source * 1000.);
876  m_dqm_byls_all_paths ->Fill(ls, m_all_paths * 1000.);
877  m_dqm_byls_all_endpaths ->Fill(ls, m_all_endpaths * 1000.);
878  m_dqm_byls_interpaths ->Fill(ls, m_interpaths * 1000.);
879 
880  if (m_nproc_enabled) {
881  m_dqm_nproc_byls_event ->Fill(ls, m_event * 1000.);
882  m_dqm_nproc_byls_source ->Fill(ls, m_source * 1000.);
883  m_dqm_nproc_byls_all_paths ->Fill(ls, m_all_paths * 1000.);
884  m_dqm_nproc_byls_all_endpaths ->Fill(ls, m_all_endpaths * 1000.);
885  m_dqm_nproc_byls_interpaths ->Fill(ls, m_interpaths * 1000.);
886  }
887  }
888 
890  float luminosity = 0.;
892  if (event.getByLabel(m_luminosity_label, h_luminosity) and not h_luminosity->empty())
893  luminosity = h_luminosity->front().instantLumi(); // in units of 1e30 cm-2s-1
894 
895  m_dqm_byluminosity_event ->Fill(luminosity, m_event * 1000.);
896  m_dqm_byluminosity_source ->Fill(luminosity, m_source * 1000.);
897  m_dqm_byluminosity_all_paths ->Fill(luminosity, m_all_paths * 1000.);
898  m_dqm_byluminosity_all_endpaths ->Fill(luminosity, m_all_endpaths * 1000.);
899  m_dqm_byluminosity_interpaths ->Fill(luminosity, m_interpaths * 1000.);
900 
901  if (m_nproc_enabled) {
902  m_dqm_nproc_byluminosity_event ->Fill(luminosity, m_event * 1000.);
903  m_dqm_nproc_byluminosity_source ->Fill(luminosity, m_source * 1000.);
904  m_dqm_nproc_byluminosity_all_paths ->Fill(luminosity, m_all_paths * 1000.);
905  m_dqm_nproc_byluminosity_all_endpaths ->Fill(luminosity, m_all_endpaths * 1000.);
906  m_dqm_nproc_byluminosity_interpaths ->Fill(luminosity, m_interpaths * 1000.);
907  }
908  }
909  }
910 }
911 
913  //edm::LogImportant("FastTimerService") << __func__ << "()";
914 
916 
917  // clear the event counters
918  m_source = 0;
919 
920  // keep track of the total number of events
922 }
923 
925  //edm::LogImportant("FastTimerService") << __func__ << "()";
926 
930 }
931 
932 void FastTimerService::prePathBeginRun(std::string const & path ) {
933  //edm::LogImportant("FastTimerService") << __func__ << "(" << path << ")";
934 
935  // cache the pointers to the names of the first and last path and endpath
937  if (not m_skip_first_path and not tns.getTrigPaths().empty()) {
938  if (path == tns.getTrigPaths().front())
939  m_first_path = & path;
940  if (path == tns.getTrigPaths().back())
941  m_last_path = & path;
942  }
943  else if (m_skip_first_path and tns.getTrigPaths().size() > 1) {
944  if (path == tns.getTrigPaths().at(1))
945  m_first_path = & path;
946  if (path == tns.getTrigPaths().back())
947  m_last_path = & path;
948  }
949  if (not tns.getEndPaths().empty()) {
950  if (path == tns.getEndPaths().front())
951  m_first_endpath = & path;
952  if (path == tns.getEndPaths().back())
953  m_last_endpath = & path;
954  }
955 }
956 
957 void FastTimerService::preProcessPath(std::string const & path ) {
958  //edm::LogImportant("FastTimerService") << __func__ << "(" << path << ")";
959 
960  // prepare to measure the time spent between the beginning of the path and the execution of the first module
961  m_is_first_module = true;
962 
963  PathMap<PathInfo>::iterator keyval = m_paths.find(path);
964  if (keyval != m_paths.end()) {
965  m_current_path = & keyval->second;
966 
968  // reset the status of this path's modules
970  if (module)
971  module->has_just_run = false;
972  }
973  } else {
974  // should never get here
975  m_current_path = 0;
976  edm::LogError("FastTimerService") << "FastTimerService::preProcessPath: unexpected path " << path;
977  }
978 
979  // time each (end)path
981 
982  if (& path == m_first_path) {
983  // this is the first path, start the "all paths" counter
984  m_timer_paths.first = m_timer_path.first;
985  } else if (& path == m_first_endpath) {
986  // this is the first endpath, start the "all paths" counter
987  m_timer_endpaths.first = m_timer_path.first;
988  }
989 
990  // measure the inter-path overhead as the time elapsed since the end of preiovus path
991  // (or the beginning of the event, if this is the first path - see preProcessEvent)
992  double interpaths = delta(m_timer_path.second, m_timer_path.first);
993  m_interpaths += interpaths;
994  if (m_dqms) {
995  m_dqm_paths_interpaths->Fill(m_current_path->index, interpaths * 1000.);
996  }
997 }
998 
1000  //edm::LogImportant("FastTimerService") << __func__ << "(" << path << ", ...)";
1001 
1002  // time each (end)path
1003  stop(m_timer_path);
1004 
1005  double active = delta(m_timer_path);
1006 
1007  // if enabled, account each (end)path
1008  if (m_enable_timing_paths) {
1009 
1010  PathInfo & pathinfo = * m_current_path;
1011  pathinfo.time_active = active;
1012  pathinfo.summary_active += active;
1013 
1014  if (m_dqms) {
1015  m_dqm_paths_active_time->Fill(pathinfo.index, active * 1000.);
1017  pathinfo.dqm_active->Fill(active * 1000.);
1018  }
1019  }
1020 
1021  // measure the time spent between the execution of the last module and the end of the path
1023  double pre = 0.; // time spent before the first active module
1024  double inter = 0.; // time spent between active modules
1025  double post = 0.; // time spent after the last active module
1026  double overhead = 0.; // time spent before, between, or after modules
1027  double current = 0.; // time spent in modules active in the current path
1028  double total = active; // total per-path time, including modules already run as part of other paths
1029 
1030  // implementation note:
1031  // "active" has already measured all the time spent in this path
1032  // "current" will be the sum of the time spent inside each module while running this path, so that
1033  // "overhead" will be active - current
1034  // "total" will be active + the sum of the time spent in non-active modules
1035 
1036  uint32_t last_run = status.index(); // index of the last module run in this path
1037  for (uint32_t i = 0; i <= last_run; ++i) {
1038  ModuleInfo * module = pathinfo.modules[i];
1039 
1040  // fill counter histograms - also for duplicate modules, to properly extract rejection information
1042  pathinfo.dqm_module_counter->Fill(i);
1043  }
1044 
1045  if (module == 0)
1046  // this is a module occurring more than once in the same path, skip it after the first occurrence
1047  continue;
1048 
1049  if (module->has_just_run) {
1050  current += module->time_active;
1051  module->is_exclusive = true;
1052  } else {
1053  total += module->time_active;
1054  module->is_exclusive = false;
1055  }
1056 
1057  // fill detailed timing histograms
1059  // fill the total time for all non-duplicate modules
1060  pathinfo.dqm_module_total->Fill(i, module->time_active * 1000.);
1061  if (module->has_just_run) {
1062  // fill the active time only for module actually running in this path
1063  pathinfo.dqm_module_active->Fill(i, module->time_active * 1000.);
1064  }
1065  }
1066 
1067  }
1068 
1069  if (status.accept())
1071  pathinfo.dqm_module_counter->Fill(pathinfo.modules.size());
1072  }
1073 
1074  if (m_is_first_module) {
1075  // no modules were active during this path, account all the time as overhead
1076  pre = 0.;
1077  inter = 0.;
1078  post = active;
1079  overhead = active;
1080  } else {
1081  // extract overhead information
1082  pre = delta(m_timer_path.first, m_timer_first_module);
1083  post = delta(m_timer_module.second, m_timer_path.second);
1084  inter = active - pre - current - post;
1085  // take care of numeric precision and rounding errors - the timer is less precise than nanosecond resolution
1086  if (std::abs(inter) < 1e-9)
1087  inter = 0.;
1088  overhead = active - current;
1089  // take care of numeric precision and rounding errors - the timer is less precise than nanosecond resolution
1090  if (std::abs(overhead) < 1e-9)
1091  overhead = 0.;
1092  }
1093 
1094  pathinfo.time_premodules = pre;
1095  pathinfo.time_intermodules = inter;
1096  pathinfo.time_postmodules = post;
1097  pathinfo.time_overhead = overhead;
1098  pathinfo.time_total = total;
1099  pathinfo.summary_premodules += pre;
1100  pathinfo.summary_intermodules += inter;
1101  pathinfo.summary_postmodules += post;
1102  pathinfo.summary_overhead += overhead;
1103  pathinfo.summary_total += total;
1104  pathinfo.last_run = last_run;
1105  if (m_dqms) {
1107  pathinfo.dqm_premodules ->Fill(pre * 1000.);
1108  pathinfo.dqm_intermodules->Fill(inter * 1000.);
1109  pathinfo.dqm_postmodules ->Fill(post * 1000.);
1110  pathinfo.dqm_overhead ->Fill(overhead * 1000.);
1111  }
1112  m_dqm_paths_total_time->Fill(pathinfo.index, total * 1000.);
1114  pathinfo.dqm_total ->Fill(total * 1000.);
1115  }
1116  }
1117  }
1118  }
1119 
1120  if (& path == m_last_path) {
1121  // this is the last path, stop and account the "all paths" counter
1122  m_timer_paths.second = m_timer_path.second;
1125  } else if (& path == m_last_endpath) {
1126  // this is the last endpath, stop and account the "all endpaths" counter
1127  m_timer_endpaths.second = m_timer_path.second;
1130  }
1131 
1132 }
1133 
1135  //edm::LogImportant("FastTimerService") << __func__ << "(" << & module << ")";
1136 
1137  // this is ever called only if m_enable_timing_modules = true
1138  assert(m_enable_timing_modules);
1139 
1140  // time each module
1142 
1143  if (m_is_first_module) {
1144  m_is_first_module = false;
1145 
1146  // measure the time spent between the beginning of the path and the execution of the first module
1148  }
1149 }
1150 
1152  //edm::LogImportant("FastTimerService") << __func__ << "(" << & module << ")";
1153 
1154  // this is ever called only if m_enable_timing_modules = true
1155  assert(m_enable_timing_modules);
1156 
1157  // time and account each module
1159 
1160  { // if-scope
1161  ModuleMap<ModuleInfo*>::iterator keyval = m_fast_modules.find(& module);
1162  if (keyval != m_fast_modules.end()) {
1163  double time = delta(m_timer_module);
1164  ModuleInfo & module = * keyval->second;
1165  module.has_just_run = true;
1166  module.time_active = time;
1167  module.summary_active += time;
1168  // plots are filled post event processing
1169  } else {
1170  // should never get here
1171  edm::LogError("FastTimerService") << "FastTimerService::postModule: unexpected module " << module.moduleLabel();
1172  }
1173  }
1174 
1175  { // if-scope
1176  ModuleMap<ModuleInfo*>::iterator keyval = m_fast_moduletypes.find(& module);
1177  if (keyval != m_fast_moduletypes.end()) {
1178  double time = delta(m_timer_module);
1179  ModuleInfo & module = * keyval->second;
1180  // module.has_just_run is not useful here
1181  module.time_active += time;
1182  module.summary_active += time;
1183  // plots are filled post event processing
1184  } else {
1185  // should never get here
1186  edm::LogError("FastTimerService") << "FastTimerService::postModule: unexpected module " << module.moduleLabel();
1187  }
1188  }
1189 
1190 }
1191 
1192 // associate to a path all the modules it contains
1193 void FastTimerService::fillPathMap(std::string const & name, std::vector<std::string> const & modules) {
1194  std::vector<ModuleInfo *> & pathmap = m_paths[name].modules;
1195  pathmap.clear();
1196  pathmap.reserve( modules.size() );
1197  std::unordered_set<ModuleInfo const *> pool; // keep track of inserted modules
1198  for (auto const & module: modules) {
1199  // fix the name of negated or ignored modules
1200  std::string const & label = (module[0] == '!' or module[0] == '-') ? module.substr(1) : module;
1201 
1202  auto const & it = m_modules.find(label);
1203  if (it == m_modules.end()) {
1204  // no matching module was found
1205  pathmap.push_back( 0 );
1206  } else if (pool.insert(& it->second).second) {
1207  // new module
1208  pathmap.push_back(& it->second);
1209  } else {
1210  // duplicate module
1211  pathmap.push_back( 0 );
1212  }
1213 
1214  }
1215 }
1216 
1217 
1218 // query the current module/path/event
1219 // Note: these functions incur in a "per-call timer overhead" (see above), currently of the order of 340ns
1220 
1221 // return the time spent since the last preModule() event
1223  struct timespec now;
1224  gettime(now);
1225  return delta(m_timer_module.first, now);
1226 }
1227 
1228 // return the time spent since the last preProcessPath() event
1230  struct timespec now;
1231  gettime(now);
1232  return delta(m_timer_path.first, now);
1233 }
1234 
1235 // return the time spent since the last preProcessEvent() event
1237  struct timespec now;
1238  gettime(now);
1239  return delta(m_timer_event.first, now);
1240 }
1241 
1242 // query the time spent in a module (available after the module has run)
1245  if (keyval != m_fast_modules.end()) {
1246  return keyval->second->time_active;
1247  } else {
1248  edm::LogError("FastTimerService") << "FastTimerService::queryModuleTime: unexpected module " << module.moduleLabel();
1249  return 0.;
1250  }
1251 }
1252 
1253 // query the time spent in a module (available after the module has run
1254 double FastTimerService::queryModuleTimeByLabel(const std::string & label) const {
1255  auto const & keyval = m_modules.find(label);
1256  if (keyval != m_modules.end()) {
1257  return keyval->second.time_active;
1258  } else {
1259  // module not found
1260  edm::LogError("FastTimerService") << "FastTimerService::queryModuleTimeByLabel: unexpected module " << label;
1261  return 0.;
1262  }
1263 }
1264 
1265 // query the time spent in a module (available after the module has run
1266 double FastTimerService::queryModuleTimeByType(const std::string & type) const {
1267  auto const & keyval = m_moduletypes.find(type);
1268  if (keyval != m_moduletypes.end()) {
1269  return keyval->second.time_active;
1270  } else {
1271  // module not found
1272  edm::LogError("FastTimerService") << "FastTimerService::queryModuleTimeByType: unexpected module type " << type;
1273  return 0.;
1274  }
1275 }
1276 
1277 // query the time spent in a path (available after the path has run)
1278 double FastTimerService::queryPathActiveTime(const std::string & path) const {
1279  PathMap<PathInfo>::const_iterator keyval = m_paths.find(path);
1280  if (keyval != m_paths.end()) {
1281  return keyval->second.time_active;
1282  } else {
1283  edm::LogError("FastTimerService") << "FastTimerService::queryPathActiveTime: unexpected path " << path;
1284  return 0.;
1285  }
1286 }
1287 
1288 // query the total time spent in a path (available after the path has run)
1289 double FastTimerService::queryPathTotalTime(const std::string & path) const {
1290  PathMap<PathInfo>::const_iterator keyval = m_paths.find(path);
1291  if (keyval != m_paths.end()) {
1292  return keyval->second.time_total;
1293  } else {
1294  edm::LogError("FastTimerService") << "FastTimerService::queryPathTotalTime: unexpected path " << path;
1295  return 0.;
1296  }
1297 }
1298 
1299 // query the time spent in the current event's source (available during event processing)
1301  return m_source;
1302 }
1303 
1304 // query the time spent in the current event's paths (available during endpaths)
1306  return m_all_paths;
1307 }
1308 
1309 // query the time spent in the current event's endpaths (available after all endpaths have run)
1311  return m_all_endpaths;
1312 }
1313 
1314 // query the time spent processing the current event (available after the event has been processed)
1316  return m_event;
1317 }
1318 
1319 // describe the module's configuration
1322  desc.addUntracked<bool>( "useRealTimeClock", true);
1323  desc.addUntracked<bool>( "enableTimingPaths", true);
1324  desc.addUntracked<bool>( "enableTimingModules", true);
1325  desc.addUntracked<bool>( "enableTimingExclusive", false);
1326  desc.addUntracked<bool>( "enableTimingSummary", false);
1327  desc.addUntracked<bool>( "skipFirstPath", false),
1328  desc.addUntracked<bool>( "enableDQM", true);
1329  desc.addUntracked<bool>( "enableDQMbyPathActive", false);
1330  desc.addUntracked<bool>( "enableDQMbyPathTotal", true);
1331  desc.addUntracked<bool>( "enableDQMbyPathOverhead", false);
1332  desc.addUntracked<bool>( "enableDQMbyPathDetails", false);
1333  desc.addUntracked<bool>( "enableDQMbyPathCounters", true);
1334  desc.addUntracked<bool>( "enableDQMbyPathExclusive", false);
1335  desc.addUntracked<bool>( "enableDQMbyModule", false);
1336  desc.addUntracked<bool>( "enableDQMbyModuleType", false);
1337  desc.addUntracked<bool>( "enableDQMSummary", false);
1338  desc.addUntracked<bool>( "enableDQMbyLuminosity", false);
1339  desc.addNode(
1340  edm::ParameterDescription<bool>( "enableDQMbyLumiSection", false, false) or
1341  edm::ParameterDescription<bool>( "enableDQMbyLumi", false, false)
1342  );
1343  desc.addUntracked<bool>( "enableDQMbyProcesses", false);
1344  desc.addUntracked<double>( "dqmTimeRange", 1000. ); // ms
1345  desc.addUntracked<double>( "dqmTimeResolution", 5. ); // ms
1346  desc.addUntracked<double>( "dqmPathTimeRange", 100. ); // ms
1347  desc.addUntracked<double>( "dqmPathTimeResolution", 0.5); // ms
1348  desc.addUntracked<double>( "dqmModuleTimeRange", 40. ); // ms
1349  desc.addUntracked<double>( "dqmModuleTimeResolution", 0.2); // ms
1350  desc.addUntracked<double>( "dqmLuminosityRange", 1.e34 ); // cm-2 s-1
1351  desc.addUntracked<double>( "dqmLuminosityResolution", 1.e31 ); // cm-2 s-1
1352  desc.addUntracked<uint32_t>( "dqmLumiSectionsRange", 2500 ); // ~ 16 hours
1353  desc.addUntracked<std::string>( "dqmPath", "HLT/TimerService");
1354  desc.addUntracked<edm::InputTag>( "luminosityProduct", edm::InputTag("hltScalersRawToDigi"));
1355  desc.addUntracked<std::vector<unsigned int> >("supportedProcesses", { 8, 24, 32 });
1356  descriptions.add("FastTimerService", desc);
1357 }
void prePathBeginRun(std::string const &)
std::pair< struct timespec, struct timespec > m_timer_path
type
Definition: HCALResponse.h:22
int i
Definition: DBlmapReader.cc:9
const double m_dqm_eventtime_resolution
Strings const & getTrigPathModules(std::string const &name) const
TProfile * m_dqm_byls_all_endpaths
std::string const & getTrigPath(size_type const i) const
const bool m_enable_dqm_byluminosity
const uint32_t m_dqm_ls_range
static void fill_dups(std::vector< std::string > &dups, unsigned int size)
double queryModuleTimeByType(const std::string &) const
ModuleMap< ModuleInfo * > m_fast_moduletypes
TProfile * m_dqm_byls_source
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
TProfile * m_dqm_nproc_byls_all_paths
double queryEventTime() const
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
std::pair< struct timespec, struct timespec > m_timer_event
Strings const & getEndPaths() const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
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
const clockid_t m_timer_id
const double m_dqm_luminosity_resolution
double queryModuleTimeByLabel(const std::string &) const
TProfile * m_dqm_byluminosity_interpaths
TProfile * m_dqm_nproc_byluminosity_source
void preProcessEvent(edm::EventID const &, edm::Timestamp const &)
const bool m_enable_dqm_bypath_counters
void postProcessEvent(edm::Event const &, edm::EventSetup const &)
const bool m_skip_first_path
void watchPostModule(PostModule::slot_type const &iSlot)
std::string const * m_last_path
TProfile * m_dqm_nproc_byls_interpaths
void watchPreProcessEvent(PreProcessEvent::slot_type const &iSlot)
void postModule(edm::ModuleDescription const &)
const bool m_enable_dqm_bypath_exclusive
double queryPathTotalTime(const std::string &) const
std::unordered_map< std::string, ModuleInfo > m_moduletypes
const double m_dqm_pathtime_range
std::string const & moduleName() const
#define abs(x)
Definition: mlp_lapack.h:159
std::string const * m_first_endpath
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
const edm::InputTag m_luminosity_label
string format
Some error handling for the usage.
static bool isCpuBound()
Definition: CPUAffinity.cc:60
#define CLOCK_THREAD_CPUTIME_ID
PathInfo * m_current_path
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
void setNumberOfProcesses(unsigned int)
std::string const & moduleLabel() const
std::pair< struct timespec, struct timespec > m_timer_endpaths
void watchPreModule(PreModule::slot_type const &iSlot)
double queryEndPathsTime() const
TProfile * m_dqm_nproc_byluminosity_event
TProfile * m_dqm_nproc_byluminosity_all_paths
TProfile * m_dqm_byls_interpaths
void preModuleBeginJob(edm::ModuleDescription const &)
const bool m_enable_dqm_bynproc
double querySourceTime() const
Strings const & getEndPathModules(std::string const &name) const
void watchPostProcessEvent(PostProcessEvent::slot_type const &iSlot)
list path
Definition: scaleCards.py:51
size_type findTrigPath(std::string const &name) const
void stop(std::pair< struct timespec, struct timespec > &times) const
void watchPrePathBeginRun(PrePathBeginRun::slot_type const &iSlot)
std::pair< struct timespec, struct timespec > m_timer_paths
const bool m_enable_dqm_byls
int clockid_t
const double m_dqm_moduletime_resolution
TProfile * m_dqm_byluminosity_source
void preModule(edm::ModuleDescription const &)
const bool m_enable_dqm
TProfile * m_dqm_nproc_byluminosity_all_endpaths
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
FastTimerService(const edm::ParameterSet &, edm::ActivityRegistry &)
std::string const * m_first_path
TProfile * m_dqm_nproc_byls_source
TProfile * m_dqm_nproc_byls_all_endpaths
std::string const * m_last_endpath
double queryPathActiveTime(const std::string &) const
const double infinity
void start(std::pair< struct timespec, struct timespec > &times) const
PathMap< PathInfo > m_paths
void watchPreSource(PreSource::slot_type const &iSlot)
struct timespec m_timer_first_module
const bool m_enable_dqm_bypath_details
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
Definition: DQMStore.cc:1031
#define CLOCK_REALTIME
const bool m_enable_dqm_bypath_overhead
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
size_type findEndPath(std::string const &name) const
void watchPreModuleBeginJob(PreModuleBeginJob::slot_type const &iSlot)
TProfile * m_dqm_nproc_byls_event
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
const std::string m_dqm_path
TProfile * m_dqm_byluminosity_all_endpaths
tuple out
Definition: dbtoconf.py:99
std::unordered_map< std::string, ModuleInfo > m_modules
ModuleMap< ModuleInfo * > m_fast_modules
const bool m_enable_dqm_bymodule
const double m_dqm_moduletime_range
TProfile * m_dqm_byluminosity_all_paths
double queryModuleTime(const edm::ModuleDescription &) const
int inter
TH1F * getTH1F(void) const
TProfile * m_dqm_paths_exclusive_time
double currentModuleTime() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
TProfile * m_dqm_byls_all_paths
double queryPathsTime() const
const bool m_enable_timing_summary
bool accept() const
has this path accepted the event?
Definition: HLTPathStatus.h:63
const bool m_enable_dqm_bymoduletype
std::pair< struct timespec, struct timespec > m_timer_module
const bool m_enable_dqm_summary
void watchPostSource(PostSource::slot_type const &iSlot)
TProfile * m_dqm_byls_event
void gettime(struct timespec &stamp) const
std::string const & getEndPath(size_type const i) const
const bool m_enable_dqm_bypath_total
Strings const & getTrigPaths() const
TProfile * getTProfile(void) const
void fillPathMap(std::string const &name, std::vector< std::string > const &modules)
const bool m_enable_dqm_bypath_active
unsigned int m_summary_events
void postProcessPath(std::string const &, edm::HLTPathStatus const &)
const std::vector< unsigned int > m_supported_processes
TProfile * m_dqm_byluminosity_event
std::vector< ModuleInfo * > modules
TProfile * m_dqm_paths_active_time
const double m_dqm_luminosity_range
TH1F * m_dqm_nproc_all_endpaths
TProfile * m_dqm_paths_total_time
static Interceptor::Registry registry("Interceptor")
tuple status
Definition: ntuplemaker.py:245
TProfile * m_dqm_nproc_byluminosity_interpaths
Definition: vlib.h:209
double currentEventTime() const
void watchPreProcessPath(PreProcessPath::slot_type const &iSlot)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
void preProcessPath(std::string const &)
std::pair< struct timespec, struct timespec > m_timer_source
tuple size
Write out results.
static double delta(const struct timespec &first, const struct timespec &second)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
TProfile * m_dqm_paths_interpaths
void preBeginRun(edm::RunID const &, edm::Timestamp const &)
void watchPostProcessPath(PostProcessPath::slot_type const &iSlot)
void watchPreBeginRun(PreBeginRun::slot_type const &iSlot)
const double m_dqm_eventtime_range
const double m_dqm_pathtime_resolution
double currentPathTime() const
unsigned int index() const
get index of module giving the status of this path
Definition: HLTPathStatus.h:56