CMS 3D CMS Logo

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 <mutex>
11 #include <string>
12 #include <sstream>
13 #include <unordered_set>
14 #include <unordered_map>
15 
16 // boost headers
17 #include <boost/format.hpp>
18 #include <boost/range/irange.hpp>
19 
20 // CMSSW headers
37 
38 // local headers
39 #include "memory_usage.h"
40 
42 
43 namespace {
44 
45  // convert any std::chrono::duration to milliseconds
46  template <class Rep, class Period>
47  double ms(std::chrono::duration<Rep, Period> duration)
48  {
49  return std::chrono::duration_cast<std::chrono::duration<double, std::milli>>(duration).count();;
50  }
51 
52  // convert any boost::chrono::duration to milliseconds
53  template <class Rep, class Period>
54  double ms(boost::chrono::duration<Rep, Period> duration)
55  {
56  return boost::chrono::duration_cast<boost::chrono::duration<double, boost::milli>>(duration).count();;
57  }
58 
59  // convert from bytes to kilobytes, rounding down
60  uint64_t kB(uint64_t bytes)
61  {
62  return bytes / 1024;
63  }
64 } // namespace
65 
67 
68 // resources being monitored by the service
69 
70 // Resources
71 
73  time_thread(boost::chrono::nanoseconds::zero()),
74  time_real(boost::chrono::nanoseconds::zero()),
75  allocated(0ul),
76  deallocated(0ul)
77 { }
78 
79 void
81  time_thread = boost::chrono::nanoseconds::zero();
82  time_real = boost::chrono::nanoseconds::zero();
83  allocated = 0ul;
84  deallocated = 0ul;
85 }
86 
89  time_thread += other.time_thread;
90  time_real += other.time_real;
91  allocated += other.allocated;
92  deallocated += other.deallocated;
93  return *this;
94 }
95 
98  Resources result(*this);
99  result += other;
100  return result;
101 }
102 
103 // AtomicResources
104 // operation on the whole object are not atomic, as the operations
105 // on the individual fields could be interleaved; however, accumulation
106 // of results should yield the correct result.
107 
109  time_thread(0ul),
110  time_real(0ul),
111  allocated(0ul),
112  deallocated(0ul)
113 { }
114 
116  time_thread(other.time_thread.load()),
117  time_real(other.time_real.load()),
118  allocated(other.allocated.load()),
119  deallocated(other.deallocated.load())
120 { }
121 
122 void
124  time_thread = 0ul;
125  time_real = 0ul;
126  allocated = 0ul;
127  deallocated = 0ul;
128 }
129 
132  time_thread = other.time_thread.load();
133  time_real = other.time_real.load();
134  allocated = other.allocated.load();
135  deallocated = other.deallocated.load();
136  return *this;
137 }
138 
141  time_thread += other.time_thread.load();
142  time_real += other.time_real.load();
143  allocated += other.allocated.load();
144  deallocated += other.deallocated.load();
145  return *this;
146 }
147 
150  AtomicResources result(*this);
151  result += other;
152  return result;
153 }
154 
155 // ResourcesPerModule
156 
158  = default;
159 
160 void
162  total.reset();
163  events = 0;
164 }
165 
168  total += other.total;
169  events += other.events;
170  return *this;
171 }
172 
175  ResourcesPerModule result(*this);
176  result += other;
177  return result;
178 }
179 
180 
181 // ResourcesPerPath
182 
184  = default;
185 
186 void
188  active.reset();
189  total.reset();
190  last = 0;
191  status = false;
192 }
193 
196  active += other.active;
197  total += other.total;
198  last = 0; // summing these makes no sense, reset them instead
199  status = false;
200  return *this;
201 }
202 
205  ResourcesPerPath result(*this);
206  result += other;
207  return result;
208 }
209 
210 
211 // ResourcesPerProcess
212 
214  total(),
215  paths(process.paths_.size()),
216  endpaths(process.endPaths_.size())
217 {
218 }
219 
220 void
222  total.reset();
223  for (auto & path: paths)
224  path.reset();
225  for (auto & path: endpaths)
226  path.reset();
227 }
228 
231  total += other.total;
232  assert(paths.size() == other.paths.size());
233  for (unsigned int i: boost::irange(0ul, paths.size()))
234  paths[i] += other.paths[i];
235  assert(endpaths.size() == other.endpaths.size());
236  for (unsigned int i: boost::irange(0ul, endpaths.size()))
237  endpaths[i] += other.endpaths[i];
238  return *this;
239 }
240 
244  result += other;
245  return result;
246 }
247 
248 
249 // ResourcesPerJob
250 
252  = default;
253 
254 FastTimerService::ResourcesPerJob::ResourcesPerJob(ProcessCallGraph const& job, std::vector<GroupOfModules> const& groups) :
255  total(),
256  overhead(),
257  event(),
258  highlight( groups.size() ),
259  modules( job.size() ),
260  processes(),
261  events(0)
262 {
263  processes.reserve(job.processes().size());
264  for (auto const& process: job.processes())
265  processes.emplace_back(process);
266 }
267 
268 void
270  total.reset();
271  overhead.reset();
272  event.reset();
273  for (auto & module: highlight)
274  module.reset();
275  for (auto & module: modules)
276  module.reset();
277  for (auto & process: processes)
278  process.reset();
279  events = 0;
280 }
281 
284  total += other.total;
285  overhead += other.overhead;
286  event += other.event;
287  assert(highlight.size() == other.highlight.size());
288  for (unsigned int i: boost::irange(0ul, highlight.size()))
289  highlight[i] += other.highlight[i];
290  assert(modules.size() == other.modules.size());
291  for (unsigned int i: boost::irange(0ul, modules.size()))
292  modules[i] += other.modules[i];
293  assert(processes.size() == other.processes.size());
294  for (unsigned int i: boost::irange(0ul, processes.size()))
295  processes[i] += other.processes[i];
296  events += other.events;
297  return *this;
298 }
299 
302  ResourcesPerJob result(*this);
303  result += other;
304  return result;
305 }
306 
307 
308 // per-thread measurements
309 
310 // Measurement
311 
313  measure();
314 }
315 
316 void
318  #ifdef DEBUG_THREAD_CONCURRENCY
319  id = std::this_thread::get_id();
320  #endif // DEBUG_THREAD_CONCURRENCY
321  time_thread = boost::chrono::thread_clock::now();
323  allocated = memory_usage::allocated();
324  deallocated = memory_usage::deallocated();
325 }
326 
327 void
329  #ifdef DEBUG_THREAD_CONCURRENCY
330  assert(std::this_thread::get_id() == id);
331  #endif // DEBUG_THREAD_CONCURRENCY
332  auto new_time_thread = boost::chrono::thread_clock::now();
333  auto new_time_real = boost::chrono::high_resolution_clock::now();
334  auto new_allocated = memory_usage::allocated();
335  auto new_deallocated = memory_usage::deallocated();
336  store.time_thread = new_time_thread - time_thread;
337  store.time_real = new_time_real - time_real;
338  store.allocated = new_allocated - allocated;
339  store.deallocated = new_deallocated - deallocated;
340  time_thread = new_time_thread;
341  time_real = new_time_real;
342  allocated = new_allocated;
343  deallocated = new_deallocated;
344 }
345 
346 void
348  #ifdef DEBUG_THREAD_CONCURRENCY
349  assert(std::this_thread::get_id() == id);
350  #endif // DEBUG_THREAD_CONCURRENCY
351  auto new_time_thread = boost::chrono::thread_clock::now();
352  auto new_time_real = boost::chrono::high_resolution_clock::now();
353  auto new_allocated = memory_usage::allocated();
354  auto new_deallocated = memory_usage::deallocated();
355  store.time_thread += boost::chrono::duration_cast<boost::chrono::nanoseconds>(new_time_thread - time_thread).count();
356  store.time_real += boost::chrono::duration_cast<boost::chrono::nanoseconds>(new_time_real - time_real).count();
357  store.allocated += new_allocated - allocated;
358  store.deallocated += new_deallocated - deallocated;
359  time_thread = new_time_thread;
360  time_real = new_time_real;
361  allocated = new_allocated;
362  deallocated = new_deallocated;
363 }
364 
366 
368  time_thread_(nullptr),
369  time_thread_byls_(nullptr),
370  time_real_(nullptr),
371  time_real_byls_(nullptr),
372  allocated_(nullptr),
373  allocated_byls_(nullptr),
374  deallocated_(nullptr),
375  deallocated_byls_(nullptr)
376 {
377 }
378 
379 void
381 {
382  // the plots are owned by the DQMStore
383  time_thread_ = nullptr;
384  time_thread_byls_ = nullptr;
385  time_real_ = nullptr;
386  time_real_byls_ = nullptr;
387  allocated_ = nullptr;
388  allocated_byls_ = nullptr;
389  deallocated_ = nullptr;
390  deallocated_byls_ = nullptr;
391 }
392 
393 void
395  DQMStore::IBooker & booker,
396  std::string const& name,
397  std::string const& title,
398  PlotRanges const& ranges,
399  unsigned int lumisections,
400  bool byls)
401 {
402  int time_bins = (int) std::ceil(ranges.time_range / ranges.time_resolution);
403  int mem_bins = (int) std::ceil(ranges.memory_range / ranges.memory_resolution);
404  std::string y_title_ms = (boost::format("events / %.1f ms") % ranges.time_resolution).str();
405  std::string y_title_kB = (boost::format("events / %.1f kB") % ranges.memory_resolution).str();
406 
407  time_thread_ = booker.book1D(
408  name + " time_thread",
409  title + " processing time (cpu)",
410  time_bins, 0., ranges.time_range
411  )->getTH1F();
412  time_thread_->StatOverflows(true);
413  time_thread_->SetXTitle("processing time [ms]");
414  time_thread_->SetYTitle(y_title_ms.c_str());
415 
416  time_real_ = booker.book1D(
417  name + " time_real",
418  title + " processing time (real)",
419  time_bins, 0., ranges.time_range
420  )->getTH1F();
421  time_real_->StatOverflows(true);
422  time_real_->SetXTitle("processing time [ms]");
423  time_real_->SetYTitle(y_title_ms.c_str());
424 
426  {
427  allocated_ = booker.book1D(
428  name + " allocated",
429  title + " allocated memory",
430  mem_bins, 0., ranges.memory_range
431  )->getTH1F();
432  allocated_->StatOverflows(true);
433  allocated_->SetXTitle("memory [kB]");
434  allocated_->SetYTitle(y_title_kB.c_str());
435 
436  deallocated_ = booker.book1D(
437  name + " deallocated",
438  title + " deallocated memory",
439  mem_bins, 0., ranges.memory_range
440  )->getTH1F();
441  deallocated_->StatOverflows(true);
442  deallocated_->SetXTitle("memory [kB]");
443  deallocated_->SetYTitle(y_title_kB.c_str());
444  }
445 
446  if (not byls)
447  return;
448 
450  name + " time_thread_byls",
451  title + " processing time (cpu) vs. lumisection",
452  lumisections, 0.5, lumisections + 0.5,
453  time_bins, 0., std::numeric_limits<double>::infinity(),
454  " ")->getTProfile();
455  time_thread_byls_->StatOverflows(true);
456  time_thread_byls_->SetXTitle("lumisection");
457  time_thread_byls_->SetYTitle("processing time [ms]");
458 
459  time_real_byls_ = booker.bookProfile(
460  name + " time_real_byls",
461  title + " processing time (real) vs. lumisection",
462  lumisections, 0.5, lumisections + 0.5,
463  time_bins, 0., std::numeric_limits<double>::infinity(),
464  " ")->getTProfile();
465  time_real_byls_->StatOverflows(true);
466  time_real_byls_->SetXTitle("lumisection");
467  time_real_byls_->SetYTitle("processing time [ms]");
468 
470  {
471  allocated_byls_ = booker.bookProfile(
472  name + " allocated_byls",
473  title + " allocated memory vs. lumisection",
474  lumisections, 0.5, lumisections + 0.5,
476  " ")->getTProfile();
477  allocated_byls_->StatOverflows(true);
478  allocated_byls_->SetXTitle("lumisection");
479  allocated_byls_->SetYTitle("memory [kB]");
480 
482  name + " deallocated_byls",
483  title + " deallocated memory vs. lumisection",
484  lumisections, 0.5, lumisections + 0.5,
486  " ")->getTProfile();
487  deallocated_byls_->StatOverflows(true);
488  deallocated_byls_->SetXTitle("lumisection");
489  deallocated_byls_->SetYTitle("memory [kB]");
490  }
491 }
492 
493 void
494 FastTimerService::PlotsPerElement::fill(Resources const& data, unsigned int lumisection)
495 {
496  if (time_thread_)
497  time_thread_->Fill(ms(data.time_thread));
498 
499  if (time_thread_byls_)
500  time_thread_byls_->Fill(lumisection, ms(data.time_thread));
501 
502  if (time_real_)
503  time_real_->Fill(ms(data.time_real));
504 
505  if (time_real_byls_)
506  time_real_byls_->Fill(lumisection, ms(data.time_real));
507 
508  if (allocated_)
509  allocated_->Fill(kB(data.allocated));
510 
511  if (allocated_byls_)
512  allocated_byls_->Fill(lumisection, kB(data.allocated));
513 
514  if (deallocated_)
515  deallocated_->Fill(kB(data.deallocated));
516 
517  if (deallocated_byls_)
518  deallocated_byls_->Fill(lumisection, kB(data.deallocated));
519 }
520 
521 void
523 {
524  if (time_thread_)
526 
527  if (time_thread_byls_)
528  time_thread_byls_->Fill(lumisection, ms(boost::chrono::nanoseconds(data.time_thread.load())));
529 
530  if (time_real_)
531  time_real_->Fill(ms(boost::chrono::nanoseconds(data.time_real.load())));
532 
533  if (time_real_byls_)
534  time_real_byls_->Fill(lumisection, ms(boost::chrono::nanoseconds(data.time_real.load())));
535 
536  if (allocated_)
537  allocated_->Fill(kB(data.allocated));
538 
539  if (allocated_byls_)
540  allocated_byls_->Fill(lumisection, kB(data.allocated));
541 
542  if (deallocated_)
543  deallocated_->Fill(kB(data.deallocated));
544 
545  if (deallocated_byls_)
546  deallocated_byls_->Fill(lumisection, kB(data.deallocated));
547 }
548 
549 void
551 {
552  float total;
553  float fraction;
554 
555  total = ms(data.time_thread);
556  fraction = (total > 0.) ? (ms(part.time_thread) / total) : 0.;
557  if (time_thread_)
558  time_thread_->Fill(total, fraction);
559 
560  if (time_thread_byls_)
561  time_thread_byls_->Fill(lumisection, total, fraction);
562 
563  total = ms(data.time_real);
564  fraction = (total > 0.) ? (ms(part.time_real) / total) : 0.;
565  if (time_real_)
566  time_real_->Fill(total, fraction);
567 
568  if (time_real_byls_)
569  time_real_byls_->Fill(lumisection, total, fraction);
570 
571  total = kB(data.allocated);
572  fraction = (total > 0.) ? (kB(part.allocated) / total) : 0.;
573  if (allocated_)
574  allocated_->Fill(total, fraction);
575 
576  if (allocated_byls_)
577  allocated_byls_->Fill(lumisection, total, fraction);
578 
579  total = kB(data.deallocated);
580  fraction = (total > 0.) ? (kB(part.deallocated) / total) : 0.;
581  if (deallocated_)
582  deallocated_->Fill(total, fraction);
583 
584  if (deallocated_byls_)
585  deallocated_byls_->Fill(lumisection, total, fraction);
586 }
587 
588 
590  total_(),
591  module_counter_(nullptr),
592  module_time_thread_total_(nullptr),
593  module_time_real_total_(nullptr),
594  module_allocated_total_(nullptr),
595  module_deallocated_total_(nullptr)
596 {
597 }
598 
599 void
601 {
602  // the plots are owned by the DQMStore
603  total_.reset();
604  module_counter_ = nullptr;
605  module_time_thread_total_ = nullptr;
606  module_time_real_total_ = nullptr;
607  module_allocated_total_ = nullptr;
608  module_deallocated_total_ = nullptr;
609 }
610 
611 void
613  DQMStore::IBooker & booker,
614  std::string const & prefixDir,
615  ProcessCallGraph const& job,
617  PlotRanges const& ranges,
618  unsigned int lumisections,
619  bool byls)
620 {
621  const std::string basedir = booker.pwd();
622  // booker.setCurrentFolder(basedir + "/path " + path.name_);
623  booker.setCurrentFolder(basedir + "/" + prefixDir + path.name_);
624 
625  total_.book(booker, "path", path.name_, ranges, lumisections, byls);
626 
627  unsigned int bins = path.modules_and_dependencies_.size();
628  module_counter_ = booker.book1DD(
629  "module_counter",
630  "module counter",
631  bins + 1, -0.5, bins + 0.5
632  )->getTH1D();
633  module_counter_->SetYTitle("events");
635  "module_time_thread_total",
636  "total module time (cpu)",
637  bins, -0.5, bins - 0.5
638  )->getTH1D();
639  module_time_thread_total_->SetYTitle("processing time [ms]");
641  "module_time_real_total",
642  "total module time (real)",
643  bins, -0.5, bins - 0.5
644  )->getTH1D();
645  module_time_real_total_->SetYTitle("processing time [ms]");
647  {
649  "module_allocated_total",
650  "total allocated memory",
651  bins, -0.5, bins - 0.5
652  )->getTH1D();
653  module_allocated_total_->SetYTitle("memory [kB]");
655  "module_deallocated_total",
656  "total deallocated memory",
657  bins, -0.5, bins - 0.5
658  )->getTH1D();
659  module_deallocated_total_->SetYTitle("memory [kB]");
660  }
661  for (unsigned int bin: boost::irange(0u, bins)) {
662  auto const& module = job[path.modules_and_dependencies_[bin]];
663  std::string const& label = module.scheduled_ ? module.module_.moduleLabel() : module.module_.moduleLabel() + " (unscheduled)";
664  module_counter_ ->GetXaxis()->SetBinLabel(bin + 1, label.c_str());
665  module_time_thread_total_->GetXaxis()->SetBinLabel(bin + 1, label.c_str());
666  module_time_real_total_ ->GetXaxis()->SetBinLabel(bin + 1, label.c_str());
668  {
669  module_allocated_total_ ->GetXaxis()->SetBinLabel(bin + 1, label.c_str());
670  module_deallocated_total_->GetXaxis()->SetBinLabel(bin + 1, label.c_str());
671  }
672  }
673  module_counter_->GetXaxis()->SetBinLabel(bins + 1, "");
674 
675  booker.setCurrentFolder(basedir);
676 }
677 
678 void
680 {
681  // fill the total path time
682  total_.fill(path.total, ls);
683 
684  // fill the modules that actually ran and the total time spent in each od them
685  for (unsigned int i = 0; i < path.last; ++i) {
686  auto const& module = data.modules[description.modules_and_dependencies_[i]];
687  if (module_counter_)
688  module_counter_->Fill(i);
689 
691  module_time_thread_total_->Fill(i, ms(module.total.time_thread));
692 
694  module_time_real_total_->Fill(i, ms(module.total.time_real));
695 
697  module_allocated_total_->Fill(i, kB(module.total.allocated));
698 
700  module_deallocated_total_->Fill(i, kB(module.total.deallocated));
701  }
702  if (module_counter_ and path.status)
703  module_counter_->Fill(path.last);
704 }
705 
706 
708  event_(),
709  paths_(process.paths_.size()),
710  endpaths_(process.endPaths_.size())
711 {
712 }
713 
714 void
716 {
717  event_.reset();
718  for (auto & path: paths_)
719  path.reset();
720  for (auto & path: endpaths_)
721  path.reset();
722 }
723 
724 void
726  DQMStore::IBooker & booker,
727  ProcessCallGraph const& job,
729  PlotRanges const& event_ranges,
730  PlotRanges const& path_ranges,
731  unsigned int lumisections,
732  bool bypath,
733  bool byls)
734 {
735  const std::string basedir = booker.pwd();
736  event_.book(booker,
737  "process " + process.name_, "process " + process.name_,
738  event_ranges,
739  lumisections,
740  byls);
741  if (bypath) {
742  booker.setCurrentFolder(basedir + "/process " + process.name_ + " paths");
743  for (unsigned int id: boost::irange(0ul, paths_.size()))
744  {
745  paths_[id].book(booker,"path ",
746  job, process.paths_[id],
747  path_ranges,
748  lumisections,
749  byls);
750  }
751  for (unsigned int id: boost::irange(0ul, endpaths_.size()))
752  {
753  endpaths_[id].book(booker,"endpath ",
754  job, process.endPaths_[id],
755  path_ranges,
756  lumisections,
757  byls);
758  }
759  booker.setCurrentFolder(basedir);
760  }
761 }
762 
763 void
765 {
766  // fill process event plots
767  event_.fill(process.total, ls);
768 
769  // fill all paths plots
770  for (unsigned int id: boost::irange(0ul, paths_.size()))
771  paths_[id].fill(description.paths_[id], data, process.paths[id], ls);
772 
773  // fill all endpaths plots
774  for (unsigned int id: boost::irange(0ul, endpaths_.size()))
775  endpaths_[id].fill(description.endPaths_[id], data, process.endpaths[id], ls);
776 }
777 
778 FastTimerService::PlotsPerJob::PlotsPerJob(ProcessCallGraph const& job, std::vector<GroupOfModules> const& groups) :
779  event_(),
780  event_ex_(),
781  overhead_(),
782  highlight_(groups.size()),
783  modules_(job.size()),
784  processes_()
785 {
786  processes_.reserve(job.processes().size());
787  for (auto const& process: job.processes())
788  processes_.emplace_back(process);
789 }
790 
791 void
793 {
794  event_.reset();
795  event_ex_.reset();
796  overhead_.reset();
797  for (auto & module: highlight_)
798  module.reset();
799  for (auto & module: modules_)
800  module.reset();
801  for (auto & process: processes_)
802  process.reset();
803 }
804 
805 void
807  DQMStore::IBooker & booker,
808  ProcessCallGraph const& job,
809  std::vector<GroupOfModules> const& groups,
810  PlotRanges const& event_ranges,
811  PlotRanges const& path_ranges,
812  PlotRanges const& module_ranges,
813  unsigned int lumisections,
814  bool bymodule,
815  bool bypath,
816  bool byls)
817 {
818  const std::string basedir = booker.pwd();
819 
820  // event summary plots
821  event_.book(booker,
822  "event", "Event",
823  event_ranges,
824  lumisections,
825  byls);
826 
827  event_ex_.book(booker,
828  "event_ex", "Event (explicit)",
829  event_ranges,
830  lumisections,
831  byls);
832 
833  overhead_.book(booker,
834  "overhead", "Overhead",
835  event_ranges,
836  lumisections,
837  byls);
838 
839  modules_[job.source().id()].book(booker,
840  "source", "Source",
841  module_ranges,
842  lumisections,
843  byls);
844 
845  // plot the time spent in few given groups of modules
846  for (unsigned int group: boost::irange(0ul, groups.size())) {
847  auto const & label = groups[group].label;
848  highlight_[group].book(booker,
849  "highlight " + label, "Highlight " + label,
850  event_ranges,
851  lumisections,
852  byls);
853  }
854 
855  // plots per subprocess (event, modules, paths and endpaths)
856  for (unsigned int pid: boost::irange(0ul, job.processes().size())) {
857  auto const& process = job.processDescription(pid);
858  processes_[pid].book(booker,
859  job, process,
860  event_ranges,
861  path_ranges,
862  lumisections,
863  bypath,
864  byls);
865 
866  if (bymodule) {
867  booker.setCurrentFolder(basedir + "/process " + process.name_ + " modules");
868  for (unsigned int id: process.modules_)
869  {
870  auto const& module_name = job.module(id).moduleLabel();
871  modules_[id].book(booker,
873  module_ranges,
874  lumisections,
875  byls);
876  }
877  booker.setCurrentFolder(basedir);
878  }
879  }
880 }
881 
882 void
884 {
885  // fill total event plots
886  event_.fill(data.total, ls);
887  event_ex_.fill(data.event, ls);
888  overhead_.fill(data.overhead, ls);
889 
890  // fill highltight plots
891  for (unsigned int group: boost::irange(0ul, highlight_.size()))
892  highlight_[group].fill_fraction(data.total, data.highlight[group], ls);
893 
894  // fill modules plots
895  for (unsigned int id: boost::irange(0ul, modules_.size()))
896  modules_[id].fill(data.modules[id].total, ls);
897 
898  for (unsigned int pid: boost::irange(0ul, processes_.size()))
899  processes_[pid].fill(job.processDescription(pid), data, data.processes[pid], ls);
900 }
901 
902 
904 
906  // configuration
907  callgraph_(),
908  // job configuration
909  concurrent_runs_( 0 ),
910  concurrent_streams_( 0 ),
911  concurrent_threads_( 0 ),
912  print_event_summary_( config.getUntrackedParameter<bool>( "printEventSummary" ) ),
913  print_run_summary_( config.getUntrackedParameter<bool>( "printRunSummary" ) ),
914  print_job_summary_( config.getUntrackedParameter<bool>( "printJobSummary" ) ),
915  // dqm configuration
916  module_id_( edm::ModuleDescription::invalidID() ),
917  enable_dqm_( config.getUntrackedParameter<bool>( "enableDQM" ) ),
918  enable_dqm_bymodule_( config.getUntrackedParameter<bool>( "enableDQMbyModule" ) ),
919  enable_dqm_bypath_( config.getUntrackedParameter<bool>( "enableDQMbyPath" ) ),
920  enable_dqm_byls_( config.getUntrackedParameter<bool>( "enableDQMbyLumiSection" ) ),
921  enable_dqm_bynproc_( config.getUntrackedParameter<bool>( "enableDQMbyProcesses" ) ),
922  dqm_event_ranges_( { config.getUntrackedParameter<double>( "dqmTimeRange" ), // ms
923  config.getUntrackedParameter<double>( "dqmTimeResolution" ), // ms
924  config.getUntrackedParameter<double>( "dqmMemoryRange" ), // kB
925  config.getUntrackedParameter<double>( "dqmMemoryResolution" ) } ), // kB
926  dqm_path_ranges_( { config.getUntrackedParameter<double>( "dqmPathTimeRange" ), // ms
927  config.getUntrackedParameter<double>( "dqmPathTimeResolution" ), // ms
928  config.getUntrackedParameter<double>( "dqmPathMemoryRange" ), // kB
929  config.getUntrackedParameter<double>( "dqmPathMemoryResolution" ) } ), // kB
930  dqm_module_ranges_( { config.getUntrackedParameter<double>( "dqmModuleTimeRange" ), // ms
931  config.getUntrackedParameter<double>( "dqmModuleTimeResolution" ), // ms
932  config.getUntrackedParameter<double>( "dqmModuleMemoryRange" ), // kB
933  config.getUntrackedParameter<double>( "dqmModuleMemoryResolution") } ), // kB
934  dqm_lumisections_range_( config.getUntrackedParameter<unsigned int>( "dqmLumiSectionsRange" ) ),
935  dqm_path_( config.getUntrackedParameter<std::string>("dqmPath" ) ),
936  // highlight configuration
937  highlight_module_psets_( config.getUntrackedParameter<std::vector<edm::ParameterSet>>("highlightModules") ),
938  highlight_modules_( highlight_module_psets_.size()) // filled in postBeginJob()
939 {
940  // start observing when a thread enters or leaves the TBB global thread arena
941  tbb::task_scheduler_observer::observe();
942 
943  // register EDM call backs
944  registry.watchPreallocate( this, & FastTimerService::preallocate );
945  registry.watchPreBeginJob( this, & FastTimerService::preBeginJob );
946  registry.watchPostBeginJob( this, & FastTimerService::postBeginJob );
947  registry.watchPostEndJob( this, & FastTimerService::postEndJob );
948  registry.watchPreGlobalBeginRun( this, & FastTimerService::preGlobalBeginRun );
949 //registry.watchPostGlobalBeginRun( this, & FastTimerService::postGlobalBeginRun );
950 //registry.watchPreGlobalEndRun( this, & FastTimerService::preGlobalEndRun );
951  registry.watchPostGlobalEndRun( this, & FastTimerService::postGlobalEndRun );
952  registry.watchPreStreamBeginRun( this, & FastTimerService::preStreamBeginRun );
953 //registry.watchPostStreamBeginRun( this, & FastTimerService::postStreamBeginRun );
954 //registry.watchPreStreamEndRun( this, & FastTimerService::preStreamEndRun );
955  registry.watchPostStreamEndRun( this, & FastTimerService::postStreamEndRun );
956 //registry.watchPreGlobalBeginLumi( this, & FastTimerService::preGlobalBeginLumi );
957 //registry.watchPostGlobalBeginLumi( this, & FastTimerService::postGlobalBeginLumi );
958 //registry.watchPreGlobalEndLumi( this, & FastTimerService::preGlobalEndLumi );
959 //registry.watchPostGlobalEndLumi( this, & FastTimerService::postGlobalEndLumi );
960  registry.watchPreStreamBeginLumi( this, & FastTimerService::preStreamBeginLumi );
961 //registry.watchPostStreamBeginLumi( this, & FastTimerService::postStreamBeginLumi );
962 //registry.watchPreStreamEndLumi( this, & FastTimerService::preStreamEndLumi );
963  registry.watchPostStreamEndLumi( this, & FastTimerService::postStreamEndLumi );
964  registry.watchPreEvent( this, & FastTimerService::preEvent );
965  registry.watchPostEvent( this, & FastTimerService::postEvent );
966  registry.watchPrePathEvent( this, & FastTimerService::prePathEvent );
967  registry.watchPostPathEvent( this, & FastTimerService::postPathEvent );
968  registry.watchPreSourceConstruction( this, & FastTimerService::preSourceConstruction);
969 //registry.watchPostSourceConstruction( this, & FastTimerService::postSourceConstruction);
970 //registry.watchPreSourceRun( this, & FastTimerService::preSourceRun );
971 //registry.watchPostSourceRun( this, & FastTimerService::postSourceRun );
972 //registry.watchPreSourceLumi( this, & FastTimerService::preSourceLumi );
973 //registry.watchPostSourceLumi( this, & FastTimerService::postSourceLumi );
974  registry.watchPreSourceEvent( this, & FastTimerService::preSourceEvent );
975  registry.watchPostSourceEvent( this, & FastTimerService::postSourceEvent );
976 //registry.watchPreModuleBeginJob( this, & FastTimerService::preModuleBeginJob );
977 //registry.watchPostModuleBeginJob( this, & FastTimerService::postModuleBeginJob );
978 //registry.watchPreModuleEndJob( this, & FastTimerService::preModuleEndJob );
979 //registry.watchPostModuleEndJob( this, & FastTimerService::postModuleEndJob );
980 //registry.watchPreModuleBeginStream( this, & FastTimerService::preModuleBeginStream );
981 //registry.watchPostModuleBeginStream( this, & FastTimerService::postModuleBeginStream );
982 //registry.watchPreModuleEndStream( this, & FastTimerService::preModuleEndStream );
983 //registry.watchPostModuleEndStream( this, & FastTimerService::postModuleEndStream );
984 //registry.watchPreModuleGlobalBeginRun( this, & FastTimerService::preModuleGlobalBeginRun );
985 //registry.watchPostModuleGlobalBeginRun( this, & FastTimerService::postModuleGlobalBeginRun );
986 //registry.watchPreModuleGlobalEndRun( this, & FastTimerService::preModuleGlobalEndRun );
987 //registry.watchPostModuleGlobalEndRun( this, & FastTimerService::postModuleGlobalEndRun );
988 //registry.watchPreModuleGlobalBeginLumi( this, & FastTimerService::preModuleGlobalBeginLumi );
989 //registry.watchPostModuleGlobalBeginLumi( this, & FastTimerService::postModuleGlobalBeginLumi );
990 //registry.watchPreModuleGlobalEndLumi( this, & FastTimerService::preModuleGlobalEndLumi );
991 //registry.watchPostModuleGlobalEndLumi( this, & FastTimerService::postModuleGlobalEndLumi );
992 //registry.watchPreModuleStreamBeginRun( this, & FastTimerService::preModuleStreamBeginRun );
993 //registry.watchPostModuleStreamBeginRun( this, & FastTimerService::postModuleStreamBeginRun );
994 //registry.watchPreModuleStreamEndRun( this, & FastTimerService::preModuleStreamEndRun );
995 //registry.watchPostModuleStreamEndRun( this, & FastTimerService::postModuleStreamEndRun );
996 //registry.watchPreModuleStreamBeginLumi( this, & FastTimerService::preModuleStreamBeginLumi );
997 //registry.watchPostModuleStreamBeginLumi( this, & FastTimerService::postModuleStreamBeginLumi );
998 //registry.watchPreModuleStreamEndLumi( this, & FastTimerService::preModuleStreamEndLumi );
999 //registry.watchPostModuleStreamEndLumi( this, & FastTimerService::postModuleStreamEndLumi );
1000 //registry.watchPreModuleEventPrefetching( this, & FastTimerService::preModuleEventPrefetching );
1001 //registry.watchPostModuleEventPrefetching( this, & FastTimerService::postModuleEventPrefetching );
1002  registry.watchPreModuleEvent( this, & FastTimerService::preModuleEvent );
1003  registry.watchPostModuleEvent( this, & FastTimerService::postModuleEvent );
1004  registry.watchPreModuleEventDelayedGet( this, & FastTimerService::preModuleEventDelayedGet );
1005  registry.watchPostModuleEventDelayedGet( this, & FastTimerService::postModuleEventDelayedGet );
1006 //registry.watchPreEventReadFromSource( this, & FastTimerService::preEventReadFromSource );
1007 //registry.watchPostEventReadFromSource( this, & FastTimerService::postEventReadFromSource );
1008 }
1009 
1011 
1012 double
1014 {
1015  // private version, assume "id" is valid
1016  auto const& stream = streams_[sid];
1017  auto const& module = stream.modules[id];
1018  return ms(module.total.time_real);
1019 }
1020 
1021 double
1023 {
1024  return queryModuleTime_(sid, callgraph_.source().id());
1025 }
1026 
1027 double
1029 {
1030  auto const& stream = streams_[sid];
1031  return ms(stream.total.time_real);
1032 }
1033 
1034 double
1036 {
1037  unsigned int pid = callgraph_.processId(process);
1038  auto const& stream = streams_[sid];
1039  return ms(stream.processes[pid].total.time_real);
1040 }
1041 
1042 double
1044 {
1045  return queryModuleTime_(sid, md.id());
1046 }
1047 
1048 double
1050 {
1051  if (id < callgraph_.size())
1052  return queryModuleTime_(sid, id);
1053 
1054  // FIXME issue a LogWarning, raise an exception, or return NaN
1055  return 0.;
1056 }
1057 
1058 double
1060 {
1061  for (unsigned int id: boost::irange(0u, callgraph_.size()))
1062  if (callgraph_.module(id).moduleLabel() == label)
1063  return queryModuleTime_(sid, id);
1064 
1065  // FIXME issue a LogWarning, raise an exception, or return NaN
1066  return 0.;
1067 }
1068 
1069 double
1071 {
1072  for (unsigned int id: callgraph_.processDescription(process).modules_)
1073  if (callgraph_.module(id).moduleLabel() == label)
1074  return queryModuleTime_(sid, id);
1075 
1076  // FIXME issue a LogWarning, raise an exception, or return NaN
1077  return 0.;
1078 }
1079 
1080 double
1082 {
1083  auto const& stream = streams_[sid];
1084  for (unsigned int pid: boost::irange(0ul, callgraph_.processes().size()))
1085  {
1086  auto const& desc = callgraph_.processDescription(pid);
1087  for (unsigned int id: boost::irange(0ul, desc.paths_.size()))
1088  if (desc.paths_[id].name_ == path)
1089  return ms(stream.processes[pid].paths[id].total.time_real);
1090  for (unsigned int id: boost::irange(0ul, desc.endPaths_.size()))
1091  if (desc.paths_[id].name_ == path)
1092  return ms(stream.processes[pid].endpaths[id].total.time_real);
1093  }
1094 
1095  // FIXME issue a LogWarning, raise an exception, or return NaN
1096  return 0.;
1097 }
1098 
1099 double
1101 {
1102  auto const& stream = streams_[sid];
1103  unsigned int pid = callgraph_.processId(process);
1104  auto const& desc = callgraph_.processDescription(pid);
1105  for (unsigned int id: boost::irange(0ul, desc.paths_.size()))
1106  if (desc.paths_[id].name_ == path)
1107  return ms(stream.processes[pid].paths[id].total.time_real);
1108  for (unsigned int id: boost::irange(0ul, desc.endPaths_.size()))
1109  if (desc.paths_[id].name_ == path)
1110  return ms(stream.processes[pid].endpaths[id].total.time_real);
1111 
1112  // FIXME issue a LogWarning, raise an exception, or return NaN
1113  return 0.;
1114 }
1115 
1116 double
1118 {
1119  auto const& stream = streams_[sid];
1120  for (unsigned int group: boost::irange(0ul, highlight_modules_.size()))
1121  if (highlight_modules_[group].label == label)
1122  return ms(stream.highlight[group].time_real);
1123 
1124  // FIXME issue a LogWarning, raise an exception, or return NaN
1125  return 0.;
1126 }
1127 
1128 
1129 void
1131 {
1132  LogDebug("FastTimerService") << "The FastTimerService received is currently not monitoring the signal \"" << signal << "\".\n";
1133 }
1134 
1135 void
1137 {
1138  // warn about each signal only once per job
1139  if (unsupported_signals_.insert(signal).second)
1140  edm::LogWarning("FastTimerService") << "The FastTimerService received the unsupported signal \"" << signal << "\".\n"
1141  << "Please report how to reproduce the issue to cms-hlt@cern.ch .";
1142 }
1143 
1144 void
1146 {
1147  ignoredSignal(__func__);
1148 
1149  // reset the run counters only during the main process being run
1150  if (isFirstSubprocess(gc)) {
1152  run_summary_[gc.runIndex()].reset();
1153  }
1154 }
1155 
1156 void
1158 {
1159  ignoredSignal(__func__);
1160 }
1161 
1162 void
1164 {
1165  ignoredSignal(__func__);
1166 
1167  unsigned int sid = sc.streamID().value();
1168 
1169  // reset counters and book the DQM plots during the main process being run
1170  if (isFirstSubprocess(sc)) {
1171  subprocess_run_check_[sid] = 0;
1172 
1173  // book the DQM plots
1174  if (enable_dqm_) {
1175  // define a callback to book the MonitorElements
1176  auto bookTransactionCallback = [&, this] (DQMStore::IBooker & booker)
1177  {
1178  booker.setCurrentFolder(dqm_path_);
1179  stream_plots_[sid].book(booker, callgraph_,
1188  };
1189 
1190  // book MonitorElements for this stream
1191  edm::Service<DQMStore>()->bookTransaction(bookTransactionCallback, sc.eventID().run(), sid, module_id_);
1192  }
1193  }
1194 }
1195 
1196 
1197 void
1199 {
1203 
1204  if (enable_dqm_bynproc_)
1205  dqm_path_ += (boost::format("/Running %d processes") % concurrent_threads_).str();
1206 
1207  // allocate atomic variables to keep track of the completion of each step, process by process
1208  subprocess_event_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_streams_);
1209  for (unsigned int i = 0; i < concurrent_streams_; ++i)
1211  subprocess_lumisection_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_streams_);
1212  for (unsigned int i = 0; i < concurrent_streams_; ++i)
1214  subprocess_run_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_streams_);
1215  for (unsigned int i = 0; i < concurrent_streams_; ++i)
1216  subprocess_run_check_[i] = 0;
1217  subprocess_global_run_check_ = std::make_unique<std::atomic<unsigned int>[]>(concurrent_streams_);
1218  for (unsigned int i = 0; i < concurrent_runs_; ++i)
1220 
1221  // assign a pseudo module id to the FastTimerService
1223 }
1224 
1225 void
1228 }
1229 
1230 void
1232  callgraph_.preBeginJob(pathsAndConsumes, context);
1233 }
1234 
1235 void
1237  unsigned int modules = callgraph_.size();
1238 
1239  // module highlights
1240  for (unsigned int group: boost::irange(0ul, highlight_module_psets_.size())) {
1241  // copy and sort for faster search via std::binary_search
1242  auto labels = highlight_module_psets_[group].getUntrackedParameter<std::vector<std::string>>("modules");
1243  std::sort(labels.begin(), labels.end());
1244 
1245  highlight_modules_[group].label = highlight_module_psets_[group].getUntrackedParameter<std::string>("label");
1246  highlight_modules_[group].modules.reserve(labels.size());
1247  // convert the module labels in module ids
1248  for (unsigned int i = 0; i < modules; ++i) {
1249  auto const & label = callgraph_.module(i).moduleLabel();
1250  if (std::binary_search(labels.begin(), labels.end(), label))
1251  highlight_modules_[group].modules.push_back(i);
1252  }
1253  }
1254  highlight_module_psets_.clear();
1255 
1256  // allocate the resource counters for each stream, process, path and module
1258  streams_.resize(concurrent_streams_, temp);
1259  run_summary_.resize(concurrent_runs_, temp);
1260  job_summary_ = temp;
1261 
1262  // check that the DQMStore service is available
1263  if (enable_dqm_ and not edm::Service<DQMStore>().isAvailable()) {
1264  // the DQMStore is not available, disable all DQM plots
1265  enable_dqm_ = false;
1266  // FIXME issue a LogWarning ?
1267  }
1268 
1269  // allocate the structures to hold pointers to the DQM plots
1270  if (enable_dqm_)
1272 
1273 }
1274 
1275 void
1277 {
1278  ignoredSignal(__func__);
1279 }
1280 
1281 void
1283 {
1284  ignoredSignal(__func__);
1285 }
1286 
1287 void
1289 {
1290  ignoredSignal(__func__);
1291 
1292  unsigned int sid = sc.streamID().value();
1293 
1294  // merge plots only after the last subprocess has run
1296  if (enable_dqm_ and last) {
1297  DQMStore & store = * edm::Service<DQMStore>();
1299  }
1300 }
1301 
1302 void
1304 {
1305  ignoredSignal(__func__);
1306 }
1307 
1308 void
1310 {
1311  ignoredSignal(__func__);
1312 }
1313 
1314 void
1316 {
1317  ignoredSignal(__func__);
1318 }
1319 
1320 void
1322 {
1323  ignoredSignal(__func__);
1324 }
1325 
1326 void
1328 {
1329  ignoredSignal(__func__);
1330 
1331  // reset counters only during the main process transition
1332  if (isFirstSubprocess(sc)) {
1333  unsigned int sid = sc.streamID().value();
1335  }
1336 }
1337 
1338 void
1340 {
1341  ignoredSignal(__func__);
1342 }
1343 
1344 void
1346 {
1347  ignoredSignal(__func__);
1348 }
1349 
1350 void
1352  ignoredSignal(__func__);
1353 
1354  unsigned int sid = sc.streamID().value();
1355 
1356  // merge plots only after the last subprocess has run
1358  if (enable_dqm_ and last) {
1359  DQMStore & store = * edm::Service<DQMStore>();
1361  }
1362 }
1363 
1364 void
1366 {
1367  ignoredSignal(__func__);
1368 }
1369 
1370 void
1372 {
1373  ignoredSignal(__func__);
1374 
1375  // handle the summaries only after the last subprocess has run
1377  if (print_run_summary_ and last) {
1378  edm::LogVerbatim out("FastReport");
1379  printSummary(out, run_summary_[gc.runIndex()], "Run");
1380  }
1381 }
1382 
1383 void
1385 {
1386  ignoredSignal(__func__);
1387 }
1388 
1389 void
1391 {
1392  ignoredSignal(__func__);
1393 }
1394 
1395 void
1397 {
1398  ignoredSignal(__func__);
1399 }
1400 
1401 void
1403 {
1404  ignoredSignal(__func__);
1405 }
1406 
1407 void
1409 {
1410  if (print_job_summary_) {
1411  edm::LogVerbatim out("FastReport");
1412  printSummary(out, job_summary_, "Job");
1413  }
1414 }
1415 
1416 
1417 template <typename T>
1419 {
1420  out << "FastReport ";
1421  if (label.size() < 60)
1422  for (unsigned int i = (60-label.size()) / 2; i > 0; --i)
1423  out << '-';
1424  out << ' ' << label << " Summary ";
1425  if (label.size() < 60)
1426  for (unsigned int i = (59-label.size()) / 2; i > 0; --i)
1427  out << '-';
1428  out << '\n';
1429 }
1430 
1431 template <typename T>
1433 {
1434  out << "FastReport CPU time Real time Allocated Deallocated " << label << "\n";
1435  // FastReport ######.### ms ######.### ms +######### kB -######### kB ...
1436 }
1437 
1438 template <typename T>
1440 {
1441  out << boost::format("FastReport %10.3f ms %10.3f ms %+10d kB %+10d kB %s\n")
1442  % ms(data.time_thread)
1443  % ms(data.time_real)
1444  % kB(data.allocated)
1445  % kB(data.deallocated)
1446  % label;
1447 }
1448 
1449 template <typename T>
1451 {
1452  printHeader(out, "Event");
1453  printEventHeader(out, "Modules");
1454  auto const& source_d = callgraph_.source();
1455  auto const& source = data.modules[source_d.id()];
1456  printEventLine(out, source.total, source_d.moduleLabel());
1457  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1458  auto const& proc_d = callgraph_.processDescription(i);
1459  auto const& proc = data.processes[i];
1460  printEventLine(out, proc.total, "process " + proc_d.name_);
1461  for (unsigned int m: proc_d.modules_) {
1462  auto const& module_d = callgraph_.module(m);
1463  auto const& module = data.modules[m];
1464  printEventLine(out, module.total, " " + module_d.moduleLabel());
1465  }
1466  }
1467  printEventLine(out, data.total, "total");
1468  out << '\n';
1469  printEventHeader(out, "Processes and Paths");
1470  printEventLine(out, source.total, source_d.moduleLabel());
1471  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1472  auto const& proc_d = callgraph_.processDescription(i);
1473  auto const& proc = data.processes[i];
1474  printEventLine(out, proc.total, "process " + proc_d.name_);
1475  for (unsigned int p = 0; p < proc.paths.size(); ++p) {
1476  auto const& name = proc_d.paths_[p].name_;
1477  auto const& path = proc.paths[p];
1478  printEventLine(out, path.active, name + " (only scheduled modules)");
1479  printEventLine(out, path.total, name + " (including dependencies)");
1480  }
1481  for (unsigned int p = 0; p < proc.endpaths.size(); ++p) {
1482  auto const& name = proc_d.endPaths_[p].name_;
1483  auto const& path = proc.endpaths[p];
1484  printEventLine(out, path.active, name + " (only scheduled modules)");
1485  printEventLine(out, path.total, name + " (including dependencies)");
1486  }
1487  }
1488  printEventLine(out, data.total, "total");
1489  out << '\n';
1490  for (unsigned int group: boost::irange(0ul, highlight_modules_.size())) {
1491  printEventHeader(out, "Highlighted modules");
1492  for (unsigned int m: highlight_modules_[group].modules) {
1493  auto const& module_d = callgraph_.module(m);
1494  auto const& module = data.modules[m];
1495  printEventLine(out, module.total, " " + module_d.moduleLabel());
1496  }
1498  out << '\n';
1499  }
1500 }
1501 
1502 template <typename T>
1503 void FastTimerService::printSummaryHeader(T& out, std::string const& label, bool detailed) const
1504 {
1505  if (detailed)
1506  out << "FastReport CPU time avg. when run Real time avg. when run Alloc, avg. when run Dealloc. avg. when run " << label;
1507  // FastReport ######.### ms ######.### ms ######.### ms ######.### ms +######### kB +######### kB -######### kB -######### kB ...
1508  else
1509  out << "FastReport CPU time avg. Real time avg. Alloc, avg. Dealloc. avg. " << label;
1510  // FastReport ######.### ms ######.### ms +######### kB -######### kB ...
1511 }
1512 
1513 template <typename T>
1515 {
1516  out << boost::format("FastReport %10.3f ms %10.3f ms %+10d kB %+10d kB %s\n")
1517  % (events ? ms(data.time_thread) / events : 0)
1518  % (events ? ms(data.time_real) / events : 0)
1519  % (events ? kB(data.allocated) / events : 0)
1520  % (events ? kB(data.deallocated) / events : 0)
1521  % label;
1522 }
1523 
1524 template <typename T>
1526 {
1527  out << boost::format("FastReport %10.3f ms %10.3f ms %10.3f ms %10.3f ms %+10d kB %+10d kB %+10d kB %+10d kB %s\n")
1528  % (events ? ms(data.time_thread) / events : 0) % (active ? ms(data.time_thread) / active : 0)
1529  % (events ? ms(data.time_real) / events : 0) % (active ? ms(data.time_real) / active : 0)
1530  % (events ? kB(data.allocated) / events : 0) % (active ? kB(data.allocated) / active : 0)
1531  % (events ? kB(data.deallocated) / events : 0) % (active ? kB(data.deallocated) / active : 0)
1532  % label;
1533 }
1534 
1535 template <typename T>
1537 {
1538  printHeader(out, label);
1539  printSummaryHeader(out, "Modules", true);
1540  auto const& source_d = callgraph_.source();
1541  auto const& source = data.modules[source_d.id()];
1542  printSummaryLine(out, source.total, data.events, source.events, source_d.moduleLabel());
1543  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1544  auto const& proc_d = callgraph_.processDescription(i);
1545  auto const& proc = data.processes[i];
1546  printSummaryLine(out, proc.total, data.events, "process " + proc_d.name_);
1547  for (unsigned int m: proc_d.modules_) {
1548  auto const& module_d = callgraph_.module(m);
1549  auto const& module = data.modules[m];
1550  printSummaryLine(out, module.total, data.events, module.events, module_d.moduleLabel());
1551  }
1552  }
1553  printSummaryLine(out, data.total, data.events, "total");
1554  out << '\n';
1555  printSummaryHeader(out, "Processes and Paths", false);
1556  printSummaryLine(out, source.total, data.events, source_d.moduleLabel());
1557  for (unsigned int i = 0; i < callgraph_.processes().size(); ++i) {
1558  auto const& proc_d = callgraph_.processDescription(i);
1559  auto const& proc = data.processes[i];
1560  printSummaryLine(out, proc.total, data.events, "process " + proc_d.name_);
1561  for (unsigned int p = 0; p < proc.paths.size(); ++p) {
1562  auto const& name = proc_d.paths_[p].name_;
1563  auto const& path = proc.paths[p];
1564  printSummaryLine(out, path.active, data.events, name + " (only scheduled modules)");
1565  printSummaryLine(out, path.total, data.events, name + " (including dependencies)");
1566  }
1567  for (unsigned int p = 0; p < proc.endpaths.size(); ++p) {
1568  auto const& name = proc_d.endPaths_[p].name_;
1569  auto const& path = proc.endpaths[p];
1570  printSummaryLine(out, path.active, data.events, name + " (only scheduled modules)");
1571  printSummaryLine(out, path.total, data.events, name + " (including dependencies)");
1572  }
1573  }
1574  printSummaryLine(out, data.total, data.events, "total");
1575  out << '\n';
1576  for (unsigned int group: boost::irange(0ul, highlight_modules_.size())) {
1577  printSummaryHeader(out, "Highlighted modules", true);
1578  for (unsigned int m: highlight_modules_[group].modules) {
1579  auto const& module_d = callgraph_.module(m);
1580  auto const& module = data.modules[m];
1581  printSummaryLine(out, module.total, data.events, module.events, module_d.moduleLabel());
1582  }
1583  printSummaryLine(out, data.highlight[group], data.events, highlight_modules_[group].label);
1584  out << '\n';
1585  }
1586 }
1587 
1588 // check if this is the first process being signalled
1589 bool
1591 {
1592  return (not sc.processContext()->isSubProcess());
1593 }
1594 
1595 bool
1597 {
1598  return (not gc.processContext()->isSubProcess());
1599 }
1600 
1601 // check if this is the last process being signalled
1602 bool
1603 FastTimerService::isLastSubprocess(std::atomic<unsigned int>& check)
1604 {
1605  // release-acquire semantic guarantees that all writes in this and other threads are visible
1606  // after this operation; full sequentially-consistent ordering is (probably) not needed.
1607  unsigned int old_value = check.fetch_add(1, std::memory_order_acq_rel);
1608  return (old_value == callgraph_.processes().size() - 1);
1609 }
1610 
1611 void
1613 {
1614  ignoredSignal(__func__);
1615 }
1616 
1617 void
1619 {
1620  ignoredSignal(__func__);
1621 
1622  unsigned int pid = callgraph_.processId(* sc.processContext());
1623  unsigned int sid = sc.streamID();
1624  auto & stream = streams_[sid];
1625  auto & process = callgraph_.processDescription(pid);
1626 
1627  // measure the event resources as the sum of all modules' resources
1628  auto & data = stream.processes[pid].total;
1629  for (unsigned int i: process.modules_)
1630  data += stream.modules[i].total;
1631  stream.total += data;
1632 
1633  // handle the summaries and fill the plots only after the last subprocess has run
1635  if (not last)
1636  return;
1637 
1638  // measure the event resources explicitly
1639  stream.event_measurement.measure_and_store(stream.event);
1640 
1641  // highlighted modules
1642  for (unsigned int group: boost::irange(0ul, highlight_modules_.size()))
1643  for (unsigned int i: highlight_modules_[group].modules)
1644  stream.highlight[group] += stream.modules[i].total;
1645 
1646  // avoid concurrent access to the summary objects
1647  {
1648  std::lock_guard<std::mutex> guard(summary_mutex_);
1649  job_summary_ += stream;
1650  run_summary_[sc.runIndex()] += stream;
1651  }
1652 
1653  if (print_event_summary_) {
1654  edm::LogVerbatim out("FastReport");
1655  printEvent(out, stream);
1656  }
1657 
1658  if (enable_dqm_)
1659  stream_plots_[sid].fill(callgraph_, stream, sc.eventID().luminosityBlock());
1660 }
1661 
1662 void
1664 {
1665  // clear the event counters
1666  auto & stream = streams_[sid];
1667  stream.reset();
1668  ++stream.events;
1669 
1670  subprocess_event_check_[sid] = 0;
1671 
1672  // reuse the same measurement for the Source module and for the explicit begin of the Event
1673  auto & measurement = thread();
1674  measurement.measure_and_accumulate(stream.overhead);
1675  stream.event_measurement = measurement;
1676 }
1677 
1678 
1679 void
1681 {
1683  unsigned int id = md.id();
1684  auto & stream = streams_[sid];
1685 
1686  thread().measure_and_store(stream.modules[id].total);
1687  ++stream.modules[id].events;
1688 }
1689 
1690 
1691 void
1693 {
1694  unsigned int sid = sc.streamID().value();
1695  unsigned int pid = callgraph_.processId(* sc.processContext());
1696  unsigned int id = pc.pathID();
1697  auto & stream = streams_[sid];
1698  auto & data = pc.isEndPath() ? stream.processes[pid].endpaths[id] : stream.processes[pid].paths[id];
1699  data.status = false;
1700  data.last = 0;
1701 }
1702 
1703 
1704 void
1706 {
1707  unsigned int sid = sc.streamID().value();
1708  unsigned int pid = callgraph_.processId(* sc.processContext());
1709  unsigned int id = pc.pathID();
1710  auto & stream = streams_[sid];
1711  auto & data = pc.isEndPath() ? stream.processes[pid].endpaths[id] : stream.processes[pid].paths[id];
1712 
1714  unsigned int index = path.modules_on_path_.empty() ? 0 : status.index() + 1;
1715  data.last = path.modules_on_path_.empty() ? 0 : path.last_dependency_of_module_[status.index()];
1716 
1717  for (unsigned int i = 0; i < index; ++i) {
1718  auto const& module = stream.modules[path.modules_on_path_[i]];
1719  data.active += module.total;
1720  }
1721  for (unsigned int i = 0; i < data.last; ++i) {
1722  auto const& module = stream.modules[path.modules_and_dependencies_[i]];
1723  data.total += module.total;
1724  }
1725 }
1726 
1727 void
1729 {
1730  unsigned int sid = sc.streamID().value();
1731  auto & stream = streams_[sid];
1732  thread().measure_and_accumulate(stream.overhead);
1733 }
1734 
1735 void
1737 {
1738  edm::ModuleDescription const& md = * mcc.moduleDescription();
1739  unsigned int id = md.id();
1740  unsigned int sid = sc.streamID().value();
1741  auto & stream = streams_[sid];
1742 
1743  thread().measure_and_store(stream.modules[id].total);
1744  ++stream.modules[id].events;
1745 }
1746 
1747 void
1749 {
1750  unsupportedSignal(__func__);
1751 }
1752 
1753 void
1755 {
1756  unsupportedSignal(__func__);
1757 }
1758 
1759 void
1761 {
1762  ignoredSignal(__func__);
1763 }
1764 
1765 void
1767 {
1768  ignoredSignal(__func__);
1769 }
1770 
1771 void
1773 {
1774  ignoredSignal(__func__);
1775 }
1776 
1777 void
1779 {
1780  ignoredSignal(__func__);
1781 }
1782 
1783 void
1785 {
1786  ignoredSignal(__func__);
1787 }
1788 
1789 void
1791 {
1792  ignoredSignal(__func__);
1793 }
1794 
1795 void
1797 {
1798  ignoredSignal(__func__);
1799 }
1800 
1801 void
1803 {
1804  ignoredSignal(__func__);
1805 }
1806 
1807 void
1809 {
1810  ignoredSignal(__func__);
1811 }
1812 
1813 void
1815 {
1816  ignoredSignal(__func__);
1817 }
1818 
1819 void
1821 {
1822  ignoredSignal(__func__);
1823 }
1824 
1825 void
1827 {
1828  ignoredSignal(__func__);
1829 }
1830 
1831 void
1833 {
1834  ignoredSignal(__func__);
1835 }
1836 
1837 void
1839 {
1840  ignoredSignal(__func__);
1841 }
1842 
1843 void
1845 {
1846  ignoredSignal(__func__);
1847 }
1848 
1849 void
1851 {
1852  ignoredSignal(__func__);
1853 }
1854 
1855 void
1857 {
1858  ignoredSignal(__func__);
1859 }
1860 
1861 void
1863 {
1864  ignoredSignal(__func__);
1865 }
1866 
1867 void
1869 {
1870  ignoredSignal(__func__);
1871 }
1872 
1873 void
1875 {
1876  ignoredSignal(__func__);
1877 }
1878 
1879 void
1881 {
1882  // initialise the measurement point for a thread that has newly joining the TBB pool
1883  // FIXME any resources used or freed will be accounted to the next stream the uses this thread
1884  thread().measure();
1885 }
1886 
1887 void
1889 {
1890  // account any resources used or freed by the thread before leaving the TBB pool.
1891  // FIXME arbitrarility use the first stream because there is no global measurement
1892  auto & stream = streams_.front();
1893  thread().measure_and_accumulate(stream.overhead);
1894 }
1895 
1898 {
1899  return threads_.local();
1900 }
1901 
1902 
1903 // describe the module's configuration
1904 void
1906 {
1908  desc.addUntracked<bool>( "printEventSummary", false);
1909  desc.addUntracked<bool>( "printRunSummary", true);
1910  desc.addUntracked<bool>( "printJobSummary", true);
1911  desc.addUntracked<bool>( "enableDQM", true);
1912  desc.addUntracked<bool>( "enableDQMbyModule", false);
1913  desc.addUntracked<bool>( "enableDQMbyPath", false);
1914  desc.addUntracked<bool>( "enableDQMbyLumiSection", false);
1915  desc.addUntracked<bool>( "enableDQMbyProcesses", false);
1916  desc.addUntracked<double>( "dqmTimeRange", 1000. ); // ms
1917  desc.addUntracked<double>( "dqmTimeResolution", 5. ); // ms
1918  desc.addUntracked<double>( "dqmMemoryRange", 1000000. ); // kB
1919  desc.addUntracked<double>( "dqmMemoryResolution", 5000. ); // kB
1920  desc.addUntracked<double>( "dqmPathTimeRange", 100. ); // ms
1921  desc.addUntracked<double>( "dqmPathTimeResolution", 0.5); // ms
1922  desc.addUntracked<double>( "dqmPathMemoryRange", 1000000. ); // kB
1923  desc.addUntracked<double>( "dqmPathMemoryResolution", 5000. ); // kB
1924  desc.addUntracked<double>( "dqmModuleTimeRange", 40. ); // ms
1925  desc.addUntracked<double>( "dqmModuleTimeResolution", 0.2); // ms
1926  desc.addUntracked<double>( "dqmModuleMemoryRange", 100000. ); // kB
1927  desc.addUntracked<double>( "dqmModuleMemoryResolution", 500. ); // kB
1928  desc.addUntracked<unsigned>( "dqmLumiSectionsRange", 2500 ); // ~ 16 hours
1929  desc.addUntracked<std::string>( "dqmPath", "HLT/TimerService");
1930 
1931  edm::ParameterSetDescription highlightModulesDescription;
1932  highlightModulesDescription.addUntracked<std::vector<std::string>>("modules", {});
1933  highlightModulesDescription.addUntracked<std::string>("label", "producers");
1934  desc.addVPSetUntracked("highlightModules", highlightModulesDescription, {});
1935 
1936  // # OBSOLETE - these parameters are ignored, they are left only not to break old configurations
1937  // they will not be printed in the generated cfi.py file
1938  desc.addOptionalNode(edm::ParameterDescription<bool>("useRealTimeClock", true, false), false)->setComment("This parameter is obsolete and will be ignored.");
1939  desc.addOptionalNode(edm::ParameterDescription<bool>("enableTimingPaths", true, false), false)->setComment("This parameter is obsolete and will be ignored.");
1940  desc.addOptionalNode(edm::ParameterDescription<bool>("enableTimingModules", true, false), false)->setComment("This parameter is obsolete and will be ignored.");
1941  desc.addOptionalNode(edm::ParameterDescription<bool>("enableTimingExclusive", false, false), false)->setComment("This parameter is obsolete and will be ignored.");
1942  desc.addOptionalNode(edm::ParameterDescription<bool>("enableTimingSummary", false, false), false)->setComment("This parameter is obsolete and will be ignored.");
1943  desc.addOptionalNode(edm::ParameterDescription<bool>("skipFirstPath", false, false), false)->setComment("This parameter is obsolete and will be ignored.");
1944  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathActive", false, false), false)->setComment("This parameter is obsolete and will be ignored.");
1945  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathTotal", true, false), false)->setComment("This parameter is obsolete and will be ignored.");
1946  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathOverhead", false, false), false)->setComment("This parameter is obsolete and will be ignored.");
1947  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathDetails", false, false), false)->setComment("This parameter is obsolete and will be ignored.");
1948  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathCounters", true, false), false)->setComment("This parameter is obsolete and will be ignored.");
1949  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyPathExclusive", false, false), false)->setComment("This parameter is obsolete and will be ignored.");
1950  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMbyModuleType", false, false), false)->setComment("This parameter is obsolete and will be ignored.");
1951  desc.addOptionalNode(edm::ParameterDescription<bool>("enableDQMSummary", false, false), false)->setComment("This parameter is obsolete and will be ignored.");
1952 
1953  descriptions.add("FastTimerService", desc);
1954 }
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:39
size
Write out results.
void preGlobalBeginRun(edm::GlobalContext const &)
void preModuleEventDelayedGet(edm::StreamContext const &, edm::ModuleCallingContext const &)
const bool print_run_summary_
unsigned int maxNumberOfThreads() const
Definition: SystemBounds.h:46
void fill(Resources const &, unsigned int lumisection)
void setComment(std::string const &value)
T getUntrackedParameter(std::string const &, T const &) const
void postStreamBeginRun(edm::StreamContext const &)
double queryEventTime(edm::StreamID) const
void postGlobalEndLumi(edm::GlobalContext const &)
void postGlobalBeginLumi(edm::GlobalContext const &)
void on_scheduler_entry(bool worker) final
void postStreamEndLumi(edm::StreamContext const &)
void on_scheduler_exit(bool worker) final
std::vector< edm::ParameterSet > highlight_module_psets_
void postModuleGlobalEndLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void preEventReadFromSource(edm::StreamContext const &, edm::ModuleCallingContext const &)
void preGlobalEndRun(edm::GlobalContext const &)
void preBeginJob(edm::PathsAndConsumesOfModulesBase const &, edm::ProcessContext const &)
AtomicResources operator+(AtomicResources const &other) const
unsigned int concurrent_threads_
std::vector< unsigned int > modules_and_dependencies_
void postEventReadFromSource(edm::StreamContext const &, edm::ModuleCallingContext const &)
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: CLHEP.h:16
double queryHighlightTime(edm::StreamID sid, std::string const &label) const
const PlotRanges dqm_event_ranges_
void postModuleGlobalEndRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void postModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
void unsupportedSignal(const std::string &signal) const
std::vector< GroupOfModules > highlight_modules_
ResourcesPerJob job_summary_
MonitorElement * bookProfile(Args &&...args)
Definition: DQMStore.h:157
PlotsPerJob(ProcessCallGraph const &job, std::vector< GroupOfModules > const &groups)
unsigned int processId(edm::ProcessContext const &) const
TrainProcessor *const proc
Definition: MVATrainer.cc:101
PlotsPerProcess(ProcessCallGraph::ProcessType const &)
void preGlobalEndLumi(edm::GlobalContext const &)
std::vector< ResourcesPerPath > endpaths
const std::string & pwd(void)
Definition: DQMStore.cc:285
void book(DQMStore::IBooker &, std::string const &, ProcessCallGraph const &, ProcessCallGraph::PathType const &, PlotRanges const &ranges, unsigned int lumisections, bool byls)
double queryModuleTime_(edm::StreamID, unsigned int id) const
bool isFirstSubprocess(edm::StreamContext const &)
const bool enable_dqm_bynproc_
unsigned int concurrent_runs_
boost::chrono::nanoseconds time_real
TH1D * getTH1D(void) const
void measure_and_accumulate(AtomicResources &store)
std::atomic< uint64_t > deallocated
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_global_run_check_
std::vector< ResourcesPerJob > streams_
std::atomic< uint64_t > allocated
RunIndex const & runIndex() const
Definition: StreamContext.h:60
Definition: config.py:1
void postPathEvent(edm::StreamContext const &, edm::PathContext const &, edm::HLTPathStatus const &)
std::vector< PlotsPerElement > highlight_
void preModuleGlobalBeginLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
#define nullptr
void book(DQMStore::IBooker &, ProcessCallGraph const &, ProcessCallGraph::ProcessType const &, PlotRanges const &event_ranges, PlotRanges const &path_ranges, unsigned int lumisections, bool bypath, bool byls)
ResourcesPerProcess & operator+=(ResourcesPerProcess const &other)
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:40
const bool print_job_summary_
std::string const & moduleLabel() const
const bool enable_dqm_bypath_
edm::ModuleDescription const & source() const
static unsigned int getUniqueID()
Returns a unique id each time called. Intended to be passed to ModuleDescription&#39;s constructor&#39;s modI...
Measurement & thread()
tbb::enumerable_thread_specific< Measurement, tbb::cache_aligned_allocator< Measurement >, tbb::ets_key_per_instance > threads_
void postStreamBeginLumi(edm::StreamContext const &)
void printSummary(T &out, ResourcesPerJob const &, std::string const &label) const
const PlotRanges dqm_path_ranges_
RunIndex const & runIndex() const
Definition: GlobalContext.h:53
unsigned int maxNumberOfStreams() const
Definition: SystemBounds.h:43
ResourcesPerProcess operator+(ResourcesPerProcess const &other) const
ResourcesPerJob operator+(ResourcesPerJob const &other) const
std::vector< ResourcesPerModule > modules
bool isEndPath() const
Definition: PathContext.h:42
void printEvent(T &out, ResourcesPerJob const &) const
void printHeader(T &out, std::string const &label) const
void postModuleStreamEndLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
std::mutex summary_mutex_
ResourcesPerJob & operator+=(ResourcesPerJob const &other)
std::vector< PlotsPerJob > stream_plots_
void printSummaryHeader(T &out, std::string const &label, bool detaile) const
void fill(ProcessCallGraph::ProcessType const &, ResourcesPerJob const &, ResourcesPerProcess const &, unsigned int ls)
double queryModuleTime(edm::StreamID, const edm::ModuleDescription &module) const
void prePathEvent(edm::StreamContext const &, edm::PathContext const &)
unsigned int module_id_
std::vector< ResourcesPerJob > run_summary_
void printEventHeader(T &out, std::string const &label) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
FastTimerService(const edm::ParameterSet &, edm::ActivityRegistry &)
void preModuleStreamEndLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
void postEvent(edm::StreamContext const &)
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_lumisection_check_
void preBeginJob(edm::PathsAndConsumesOfModulesBase const &, edm::ProcessContext const &)
void postGlobalEndRun(edm::GlobalContext const &)
static uint64_t deallocated()
Definition: memory_usage.cc:75
ModuleDescription const * moduleDescription() const
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_event_check_
void fill_fraction(Resources const &, Resources const &, unsigned int lumisection)
std::vector< ProcessType > const & processes() const
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
ResourcesPerModule operator+(ResourcesPerModule const &other) const
const double infinity
const unsigned int dqm_lumisections_range_
void postStreamEndRun(edm::StreamContext const &)
std::vector< PathType > paths_
void preModuleEvent(edm::StreamContext const &, edm::ModuleCallingContext const &)
ResourcesPerPath & operator+=(ResourcesPerPath const &other)
std::vector< PlotsPerElement > modules_
ProcessType const & processDescription(unsigned int) const
ParameterDescriptionNode * addOptionalNode(ParameterDescriptionNode const &node, bool writeToCfi)
std::string dqm_path_
void preSourceConstruction(edm::ModuleDescription const &)
void printSummaryLine(T &out, Resources const &data, uint64_t events, std::string const &label) const
unsigned int pathID() const
Definition: PathContext.h:39
format
Some error handling for the usage.
ProcessContext const * processContext() const
Definition: StreamContext.h:63
void printEventLine(T &out, Resources const &data, std::string const &label) const
std::atomic< boost::chrono::nanoseconds::rep > time_thread
void mergeAndResetMEsRunSummaryCache(uint32_t run, uint32_t streamId, uint32_t moduleId)
Definition: DQMStore.cc:360
Resources operator+(Resources const &other) const
std::vector< Resources > highlight
const bool enable_dqm_bymodule_
bin
set the eta bin as selection string.
string ranges
Definition: diffTwoXMLs.py:78
StreamID const & streamID() const
Definition: StreamContext.h:57
~FastTimerService() override
const PlotRanges dqm_module_ranges_
std::vector< PlotsPerPath > endpaths_
static bool is_available()
Definition: memory_usage.cc:65
const bool enable_dqm_byls_
def ls(path, rec=False)
Definition: eostools.py:348
std::vector< PlotsPerProcess > processes_
void postModuleEventDelayedGet(edm::StreamContext const &, edm::ModuleCallingContext const &)
const bool print_event_summary_
unsigned int value() const
Definition: StreamID.h:46
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
unsigned long long uint64_t
Definition: Time.h:15
void postModuleStreamBeginLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
void book(DQMStore::IBooker &, ProcessCallGraph const &, std::vector< GroupOfModules > const &, PlotRanges const &event_ranges, PlotRanges const &path_ranges, PlotRanges const &module_ranges, unsigned int lumisections, bool bymodule, bool bypath, bool byls)
double querySourceTime(edm::StreamID) const
void preModuleStreamEndRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
void postModuleStreamEndRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
part
Definition: HCALResponse.h:20
def load(fileName)
Definition: svgfig.py:546
static uint64_t allocated()
Definition: memory_usage.cc:70
void postModuleStreamBeginRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
TH1F * getTH1F(void) const
void preSourceEvent(edm::StreamID)
boost::chrono::nanoseconds time_thread
void add(std::string const &label, ParameterSetDescription const &psetDescription)
susybsm::MuonSegment ms
Definition: classes.h:31
void preEvent(edm::StreamContext const &)
void postGlobalBeginRun(edm::GlobalContext const &)
ProcessContext const * processContext() const
Definition: GlobalContext.h:56
void preStreamBeginLumi(edm::StreamContext const &)
ResourcesPerProcess(ProcessCallGraph::ProcessType const &process)
void ignoredSignal(const std::string &signal) const
void postSourceEvent(edm::StreamID)
void preModuleStreamBeginLumi(edm::StreamContext const &, edm::ModuleCallingContext const &)
void preStreamEndRun(edm::StreamContext const &)
HLT enums.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
std::atomic< boost::chrono::nanoseconds::rep > time_real
void preModuleStreamBeginRun(edm::StreamContext const &, edm::ModuleCallingContext const &)
void preStreamEndLumi(edm::StreamContext const &)
void measure_and_store(Resources &store)
ResourcesPerModule & operator+=(ResourcesPerModule const &other)
std::vector< PathType > endPaths_
TProfile * getTProfile(void) const
void event_()
void postModuleEventPrefetching(edm::StreamContext const &, edm::ModuleCallingContext const &)
void preModuleGlobalEndLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
unsigned int size() const
edm::ModuleDescription const & module(unsigned int module) const
double queryPathTime(edm::StreamID, std::string const &path) const
void preGlobalBeginLumi(edm::GlobalContext const &)
unsigned int maxNumberOfConcurrentRuns() const
Definition: SystemBounds.h:44
AtomicResources & operator+=(AtomicResources const &other)
Resources & operator+=(Resources const &other)
void preModuleEventPrefetching(edm::StreamContext const &, edm::ModuleCallingContext const &)
void preSourceConstruction(edm::ModuleDescription const &)
void preModuleGlobalEndRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
tbb::concurrent_unordered_set< std::string > unsupported_signals_
std::vector< PlotsPerPath > paths_
EventID const & eventID() const
Definition: StreamContext.h:59
void postModuleGlobalBeginRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
std::vector< ResourcesPerProcess > processes
static Interceptor::Registry registry("Interceptor")
double queryModuleTimeByLabel(edm::StreamID, std::string const &module) const
boost::date_time::subsecond_duration< boost::posix_time::time_duration, 1000000000 > nanoseconds
AtomicResources & operator=(AtomicResources const &other)
def check(config)
Definition: trackerTree.py:14
void book(DQMStore::IBooker &, std::string const &name, std::string const &title, PlotRanges const &ranges, unsigned int lumisections, bool byls)
ProcessCallGraph callgraph_
long double T
void mergeAndResetMEsLuminositySummaryCache(uint32_t run, uint32_t lumi, uint32_t streamId, uint32_t moduleId)
Definition: DQMStore.cc:434
void postModuleGlobalBeginLumi(edm::GlobalContext const &, edm::ModuleCallingContext const &)
void preStreamBeginRun(edm::StreamContext const &)
std::vector< ResourcesPerPath > paths
MonitorElement * book1DD(Args &&...args)
Definition: DQMStore.h:127
bool isSubProcess() const
ResourcesPerPath operator+(ResourcesPerPath const &other) const
Definition: vlib.h:208
void preModuleGlobalBeginRun(edm::GlobalContext const &, edm::ModuleCallingContext const &)
ParameterDescriptionBase * addVPSetUntracked(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
static std::string const source
Definition: EdmProvDump.cc:43
std::unique_ptr< std::atomic< unsigned int >[]> subprocess_run_check_
std::vector< unsigned int > modules_
unsigned int concurrent_streams_
bool isLastSubprocess(std::atomic< unsigned int > &check)
Definition: event.py:1
void preallocate(edm::service::SystemBounds const &)
void fill(ProcessCallGraph const &, ResourcesPerJob const &, unsigned int ls)
unsigned int id() const
void fill(ProcessCallGraph::PathType const &, ResourcesPerJob const &, ResourcesPerPath const &, unsigned int lumisection)
unsigned int index() const
Definition: HLTPathStatus.h:55