CMS 3D CMS Logo

StallMonitor.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: FWCore/Services
4 // Class : StallMonitor
5 //
6 // Implementation:
7 //
8 // Original Author: Kyle Knoepfel
9 //
10 
27 
28 #include "tbb/concurrent_unordered_map.h"
29 
30 #include <atomic>
31 #include <chrono>
32 #include <iomanip>
33 #include <iostream>
34 #include <sstream>
35 
36 namespace {
37 
38  using duration_t = std::chrono::microseconds;
39  using clock_t = std::chrono::steady_clock;
40  auto now = clock_t::now;
41 
42  inline auto stream_id(edm::StreamContext const& cs) { return cs.streamID().value(); }
43 
44  inline auto module_id(edm::ModuleCallingContext const& mcc) { return mcc.moduleDescription()->id(); }
45 
46  //===============================================================
47  class StallStatistics {
48  public:
49  // c'tor receiving 'std::string const&' type not provided since we
50  // must be able to call (e.g.) std::vector<StallStatistics>(20),
51  // for which a default label is not sensible in this context.
52  StallStatistics() = default;
53 
54  std::string const& label() const { return label_; }
55  unsigned numberOfStalls() const { return stallCounter_; }
56 
57  using rep_t = duration_t::rep;
58 
59  duration_t totalStalledTime() const { return duration_t{totalTime_.load()}; }
60  duration_t maxStalledTime() const { return duration_t{maxTime_.load()}; }
61 
62  // Modifiers
63  void setLabel(std::string const& label) { label_ = label; }
64 
65  void update(duration_t const ms) {
66  ++stallCounter_;
67  auto const thisTime = ms.count();
68  totalTime_ += thisTime;
69  rep_t max{maxTime_};
70  while (thisTime > max && !maxTime_.compare_exchange_strong(max, thisTime))
71  ;
72  }
73 
74  private:
75  std::string label_{};
76  std::atomic<unsigned> stallCounter_{};
77  std::atomic<rep_t> totalTime_{};
78  std::atomic<rep_t> maxTime_{};
79  };
80 
81  //===============================================================
82  // Message-assembly utilities
83  template <typename T>
84  std::enable_if_t<std::is_integral<T>::value> concatenate(std::ostream& os, T const t) {
85  os << ' ' << t;
86  }
87 
88  template <typename H, typename... T>
89  std::enable_if_t<std::is_integral<H>::value> concatenate(std::ostream& os, H const h, T const... t) {
90  os << ' ' << h;
91  concatenate(os, t...);
92  }
93 
94  enum class step : char {
95  preSourceEvent = 'S',
96  postSourceEvent = 's',
97  preEvent = 'E',
98  postModuleEventPrefetching = 'p',
99  preModuleEventAcquire = 'A',
100  postModuleEventAcquire = 'a',
101  preModuleEvent = 'M',
102  preEventReadFromSource = 'R',
103  postEventReadFromSource = 'r',
104  postModuleEvent = 'm',
105  postEvent = 'e'
106  };
107 
108  enum class Phase : short {
109  globalEndRun = -4,
110  streamEndRun = -3,
111  globalEndLumi = -2,
112  streamEndLumi = -1,
113  Event = 0,
114  streamBeginLumi = 1,
115  globalBeginLumi = 2,
116  streamBeginRun = 3,
117  globalBeginRun = 4
118  };
119 
120  std::ostream& operator<<(std::ostream& os, step const s) {
121  os << static_cast<std::underlying_type_t<step>>(s);
122  return os;
123  }
124 
125  std::ostream& operator<<(std::ostream& os, Phase const s) {
126  os << static_cast<std::underlying_type_t<Phase>>(s);
127  return os;
128  }
129 
130  template <step S, typename... ARGS>
131  std::string assembleMessage(ARGS const... args) {
132  std::ostringstream oss;
133  oss << S;
134  concatenate(oss, args...);
135  oss << '\n';
136  return oss.str();
137  }
138 
139  Phase toTransitionImpl(edm::StreamContext const& iContext) {
140  using namespace edm;
141  switch (iContext.transition()) {
142  case StreamContext::Transition::kBeginRun:
143  return Phase::streamBeginRun;
144  case StreamContext::Transition::kBeginLuminosityBlock:
145  return Phase::streamBeginLumi;
146  case StreamContext::Transition::kEvent:
147  return Phase::Event;
148  case StreamContext::Transition::kEndLuminosityBlock:
149  return Phase::streamEndLumi;
150  case StreamContext::Transition::kEndRun:
151  return Phase::streamEndRun;
152  default:
153  break;
154  }
155  assert(false);
156  return Phase::Event;
157  }
158 
159  auto toTransition(edm::StreamContext const& iContext) -> std::underlying_type_t<Phase> {
160  return static_cast<std::underlying_type_t<Phase>>(toTransitionImpl(iContext));
161  }
162 
163  Phase toTransitionImpl(edm::GlobalContext const& iContext) {
164  using namespace edm;
165  switch (iContext.transition()) {
166  case GlobalContext::Transition::kBeginRun:
167  return Phase::globalBeginRun;
168  case GlobalContext::Transition::kBeginLuminosityBlock:
169  return Phase::globalBeginLumi;
170  case GlobalContext::Transition::kEndLuminosityBlock:
171  return Phase::globalEndLumi;
172  case GlobalContext::Transition::kWriteLuminosityBlock:
173  return Phase::globalEndLumi;
174  case GlobalContext::Transition::kEndRun:
175  return Phase::globalEndRun;
176  case GlobalContext::Transition::kWriteRun:
177  return Phase::globalEndRun;
178  default:
179  break;
180  }
181  assert(false);
182  return Phase::Event;
183  }
184  auto toTransition(edm::GlobalContext const& iContext) -> std::underlying_type_t<Phase> {
185  return static_cast<std::underlying_type_t<Phase>>(toTransitionImpl(iContext));
186  }
187 
188 } // namespace
189 
190 namespace edm {
191  namespace service {
192 
193  class StallMonitor {
194  public:
196  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
197 
198  private:
199  void preModuleConstruction(edm::ModuleDescription const&);
200  void preModuleDestruction(edm::ModuleDescription const&);
201  void postBeginJob();
202  void preSourceEvent(StreamID);
203  void postSourceEvent(StreamID);
204  void preEvent(StreamContext const&);
205  void preModuleEventAcquire(StreamContext const&, ModuleCallingContext const&);
206  void postModuleEventAcquire(StreamContext const&, ModuleCallingContext const&);
207  void preModuleEvent(StreamContext const&, ModuleCallingContext const&);
208  void postModuleEventPrefetching(StreamContext const&, ModuleCallingContext const&);
209  void preEventReadFromSource(StreamContext const&, ModuleCallingContext const&);
210  void postEventReadFromSource(StreamContext const&, ModuleCallingContext const&);
211  void postModuleEvent(StreamContext const&, ModuleCallingContext const&);
212  void postEvent(StreamContext const&);
213  void preModuleStreamTransition(StreamContext const&, ModuleCallingContext const&);
214  void postModuleStreamTransition(StreamContext const&, ModuleCallingContext const&);
215  void preModuleGlobalTransition(GlobalContext const&, ModuleCallingContext const&);
216  void postModuleGlobalTransition(GlobalContext const&, ModuleCallingContext const&);
217  void postEndJob();
218 
220  bool const validFile_; // Separate data member from file to improve efficiency.
221  duration_t const stallThreshold_;
222  decltype(now()) beginTime_{};
223 
224  // There can be multiple modules per stream. Therefore, we need
225  // the combination of StreamID and ModuleID to correctly track
226  // stalling information. We use tbb::concurrent_unordered_map
227  // for this purpose.
228  using StreamID_value = decltype(std::declval<StreamID>().value());
229  using ModuleID = decltype(std::declval<ModuleDescription>().id());
230  tbb::concurrent_unordered_map<std::pair<StreamID_value, ModuleID>, std::pair<decltype(beginTime_), bool>>
231  stallStart_{};
232 
233  std::vector<std::string> moduleLabels_{};
234  std::vector<StallStatistics> moduleStats_{};
235  unsigned int numStreams_;
236  };
237 
238  } // namespace service
239 
240 } // namespace edm
241 
242 namespace {
243  constexpr char const* filename_default{""};
244  constexpr double threshold_default{0.1}; //default threashold in seconds
245  std::string const space{" "};
246 } // namespace
247 
249 using namespace std::chrono;
250 
251 StallMonitor::StallMonitor(ParameterSet const& iPS, ActivityRegistry& iRegistry)
252  : file_{iPS.getUntrackedParameter<std::string>("fileName", filename_default)},
253  validFile_{file_},
254  stallThreshold_{
255  std::chrono::round<duration_t>(duration<double>(iPS.getUntrackedParameter<double>("stallThreshold")))} {
256  iRegistry.watchPreModuleConstruction(this, &StallMonitor::preModuleConstruction);
257  iRegistry.watchPreModuleDestruction(this, &StallMonitor::preModuleDestruction);
258  iRegistry.watchPostBeginJob(this, &StallMonitor::postBeginJob);
259  iRegistry.watchPostModuleEventPrefetching(this, &StallMonitor::postModuleEventPrefetching);
260  iRegistry.watchPreModuleEventAcquire(this, &StallMonitor::preModuleEventAcquire);
261  iRegistry.watchPreModuleEvent(this, &StallMonitor::preModuleEvent);
262  iRegistry.watchPostEndJob(this, &StallMonitor::postEndJob);
263 
264  if (validFile_) {
265  // Only enable the following callbacks if writing to a file.
266  iRegistry.watchPreSourceEvent(this, &StallMonitor::preSourceEvent);
267  iRegistry.watchPostSourceEvent(this, &StallMonitor::postSourceEvent);
268  iRegistry.watchPreEvent(this, &StallMonitor::preEvent);
269  iRegistry.watchPostModuleEventAcquire(this, &StallMonitor::postModuleEventAcquire);
270  iRegistry.watchPreEventReadFromSource(this, &StallMonitor::preEventReadFromSource);
271  iRegistry.watchPostEventReadFromSource(this, &StallMonitor::postEventReadFromSource);
272  iRegistry.watchPostModuleEvent(this, &StallMonitor::postModuleEvent);
273  iRegistry.watchPostEvent(this, &StallMonitor::postEvent);
274 
275  iRegistry.watchPreModuleStreamBeginRun(this, &StallMonitor::preModuleStreamTransition);
276  iRegistry.watchPostModuleStreamBeginRun(this, &StallMonitor::postModuleStreamTransition);
277  iRegistry.watchPreModuleStreamEndRun(this, &StallMonitor::preModuleStreamTransition);
278  iRegistry.watchPostModuleStreamEndRun(this, &StallMonitor::postModuleStreamTransition);
279 
280  iRegistry.watchPreModuleStreamBeginLumi(this, &StallMonitor::preModuleStreamTransition);
281  iRegistry.watchPostModuleStreamBeginLumi(this, &StallMonitor::postModuleStreamTransition);
282  iRegistry.watchPreModuleStreamEndLumi(this, &StallMonitor::preModuleStreamTransition);
283  iRegistry.watchPostModuleStreamEndLumi(this, &StallMonitor::postModuleStreamTransition);
284 
285  iRegistry.watchPreModuleGlobalBeginRun(this, &StallMonitor::preModuleGlobalTransition);
286  iRegistry.watchPostModuleGlobalBeginRun(this, &StallMonitor::postModuleGlobalTransition);
287  iRegistry.watchPreModuleGlobalEndRun(this, &StallMonitor::preModuleGlobalTransition);
288  iRegistry.watchPostModuleGlobalEndRun(this, &StallMonitor::postModuleGlobalTransition);
289  iRegistry.watchPreModuleWriteRun(this, &StallMonitor::preModuleGlobalTransition);
290  iRegistry.watchPostModuleWriteRun(this, &StallMonitor::postModuleGlobalTransition);
291 
292  iRegistry.watchPreModuleGlobalBeginLumi(this, &StallMonitor::preModuleGlobalTransition);
293  iRegistry.watchPostModuleGlobalBeginLumi(this, &StallMonitor::postModuleGlobalTransition);
294  iRegistry.watchPreModuleGlobalEndLumi(this, &StallMonitor::preModuleGlobalTransition);
295  iRegistry.watchPostModuleGlobalEndLumi(this, &StallMonitor::postModuleGlobalTransition);
296  iRegistry.watchPreModuleWriteLumi(this, &StallMonitor::preModuleGlobalTransition);
297  iRegistry.watchPostModuleWriteLumi(this, &StallMonitor::postModuleGlobalTransition);
298 
299  iRegistry.preallocateSignal_.connect(
300  [this](service::SystemBounds const& iBounds) { numStreams_ = iBounds.maxNumberOfStreams(); });
301 
302  std::ostringstream oss;
303  oss << "# Transition Symbol\n";
304  oss << "#----------------- ------\n";
305  oss << "# globalBeginRun " << Phase::globalBeginRun << "\n"
306  << "# streamBeginRun " << Phase::streamBeginRun << "\n"
307  << "# globalBeginLumi " << Phase::globalBeginLumi << "\n"
308  << "# streamBeginLumi " << Phase::streamBeginLumi << "\n"
309  << "# Event " << Phase::Event << "\n"
310  << "# streamEndLumi " << Phase::streamEndLumi << "\n"
311  << "# globalEndLumi " << Phase::globalEndLumi << "\n"
312  << "# streamEndRun " << Phase::streamEndRun << "\n"
313  << "# globalEndRun " << Phase::globalEndRun << "\n";
314  oss << "# Step Symbol Entries\n"
315  << "# -------------------------- ------ ------------------------------------------\n"
316  << "# preSourceEvent " << step::preSourceEvent << " <Stream ID> <Time since beginJob (ms)>\n"
317  << "# postSourceEvent " << step::postSourceEvent << " <Stream ID> <Time since beginJob (ms)>\n"
318  << "# preEvent " << step::preEvent
319  << " <Stream ID> <Run#> <LumiBlock#> <Event#> <Time since beginJob (ms)>\n"
320  << "# postModuleEventPrefetching " << step::postModuleEventPrefetching
321  << " <Stream ID> <Module ID> <Time since beginJob (ms)>\n"
322  << "# preModuleEventAcquire " << step::preModuleEventAcquire
323  << " <Stream ID> <Module ID> <Time since beginJob (ms)>\n"
324  << "# postModuleEventAcquire " << step::postModuleEventAcquire
325  << " <Stream ID> <Module ID> <Time since beginJob (ms)>\n"
326  << "# preModuleTransition " << step::preModuleEvent
327  << " <Stream ID> <Module ID> <Transition type> <Time since beginJob (ms)>\n"
328  << "# preEventReadFromSource " << step::preEventReadFromSource
329  << " <Stream ID> <Module ID> <Time since beginJob (ms)>\n"
330  << "# postEventReadFromSource " << step::postEventReadFromSource
331  << " <Stream ID> <Module ID> <Time since beginJob (ms)>\n"
332  << "# postModuleTransition " << step::postModuleEvent
333  << " <Stream ID> <Module ID> <Transition type> <Time since beginJob (ms)>\n"
334  << "# postEvent " << step::postEvent
335  << " <Stream ID> <Run#> <LumiBlock#> <Event#> <Time since beginJob (ms)>\n";
336  file_.write(oss.str());
337  }
338 }
339 
342  desc.addUntracked<std::string>("fileName", filename_default)
343  ->setComment(
344  "Name of file to which detailed timing information should be written.\n"
345  "An empty filename argument (the default) indicates that no extra\n"
346  "information will be written to a dedicated file, but only the summary\n"
347  "including stalling-modules information will be logged.");
348  desc.addUntracked<double>("stallThreshold", threshold_default)
349  ->setComment(
350  "Threshold (in seconds) used to classify modules as stalled.\n"
351  "Microsecond granularity allowed.");
352  descriptions.add("StallMonitor", desc);
353  descriptions.setComment(
354  "This service keeps track of various times in event-processing to determine which modules are stalling.");
355 }
356 
358  // Module labels are dense, so if the module id is greater than the
359  // size of moduleLabels_, grow the vector to the correct index and
360  // assign the last entry to the desired label. Note that with the
361  // current implementation, there is no module with ID '0'. In
362  // principle, the module-information vectors are therefore each one
363  // entry too large. However, since removing the entry at the front
364  // makes for awkward indexing later on, and since the sizes of these
365  // extra entries are on the order of bytes, we will leave them in
366  // and skip over them later when printing out summaries. The
367  // extraneous entries can be identified by their module labels being
368  // empty.
369  auto const mid = md.id();
370  if (mid < moduleLabels_.size()) {
371  moduleLabels_[mid] = md.moduleLabel();
372  } else {
373  moduleLabels_.resize(mid + 1);
374  moduleLabels_.back() = md.moduleLabel();
375  }
376 }
377 
379  // Reset the module label back if the module is deleted before
380  // beginJob() so that the entry is ignored in the summary printouts.
381  moduleLabels_[md.id()] = "";
382 }
383 
385  // Since a (push,emplace)_back cannot be called for a vector of a
386  // type containing atomics (like 'StallStatistics')--i.e. atomics
387  // have no copy/move-assignment operators, we must specify the size
388  // of the vector at construction time.
389  moduleStats_ = std::vector<StallStatistics>(moduleLabels_.size());
390  for (std::size_t i{}; i < moduleStats_.size(); ++i) {
391  moduleStats_[i].setLabel(moduleLabels_[i]);
392  }
393 
394  if (validFile_) {
395  std::size_t const width{std::to_string(moduleLabels_.size()).size()};
396 
397  OStreamColumn col0{"Module ID", width};
398  std::string const lastCol{"Module label"};
399 
400  std::ostringstream oss;
401  oss << "\n# " << col0 << space << lastCol << '\n';
402  oss << "# " << std::string(col0.width() + space.size() + lastCol.size(), '-') << '\n';
403 
404  for (std::size_t i{}; i < moduleLabels_.size(); ++i) {
405  auto const& label = moduleLabels_[i];
406  if (label.empty())
407  continue; // See comment in filling of moduleLabels_;
408  oss << "#M " << std::setw(width) << std::left << col0(i) << space << std::left << moduleLabels_[i] << '\n';
409  }
410  oss << '\n';
411  file_.write(oss.str());
412  }
413  // Don't need the labels anymore--info. is now part of the
414  // module-statistics objects.
415  moduleLabels_.clear();
416 
417  beginTime_ = now();
418 }
419 
421  auto const t = duration_cast<duration_t>(now() - beginTime_).count();
422  auto msg = assembleMessage<step::preSourceEvent>(sid.value(), t);
424 }
425 
427  auto const t = duration_cast<duration_t>(now() - beginTime_).count();
428  auto msg = assembleMessage<step::postSourceEvent>(sid.value(), t);
430 }
431 
433  auto const t = duration_cast<duration_t>(now() - beginTime_).count();
434  auto const& eid = sc.eventID();
435  auto msg = assembleMessage<step::preEvent>(stream_id(sc), eid.run(), eid.luminosityBlock(), eid.event(), t);
437 }
438 
440  auto const sid = stream_id(sc);
441  auto const mid = module_id(mcc);
442  auto start = stallStart_[std::make_pair(sid, mid)] = std::make_pair(now(), false);
443 
444  if (validFile_) {
445  auto const t = duration_cast<duration_t>(start.first - beginTime_).count();
446  auto msg = assembleMessage<step::postModuleEventPrefetching>(sid, mid, t);
448  }
449 }
450 
452  auto const preModEventAcquire = now();
453  auto const sid = stream_id(sc);
454  auto const mid = module_id(mcc);
455  auto& start = stallStart_[std::make_pair(sid, mid)];
456  auto startT = start.first.time_since_epoch();
457  start.second = true; // record so the preModuleEvent knows that acquire was called
458  if (validFile_) {
459  auto t = duration_cast<duration_t>(preModEventAcquire - beginTime_).count();
460  auto msg = assembleMessage<step::preModuleEventAcquire>(sid, mid, t);
462  }
463  // Check for stalls if prefetch was called
464  if (duration_t::duration::zero() != startT) {
465  auto const preFetch_to_preModEventAcquire = duration_cast<duration_t>(preModEventAcquire - start.first);
466  if (preFetch_to_preModEventAcquire < stallThreshold_)
467  return;
468  moduleStats_[mid].update(preFetch_to_preModEventAcquire);
469  }
470 }
471 
473  auto const postModEventAcquire = duration_cast<duration_t>(now() - beginTime_).count();
474  auto msg = assembleMessage<step::postModuleEventAcquire>(stream_id(sc), module_id(mcc), postModEventAcquire);
476 }
477 
479  auto const preModEvent = now();
480  auto const sid = stream_id(sc);
481  auto const mid = module_id(mcc);
482  auto const& start = stallStart_[std::make_pair(sid, mid)];
483  auto startT = start.first.time_since_epoch();
484  if (validFile_) {
485  auto t = duration_cast<duration_t>(preModEvent - beginTime_).count();
486  auto msg =
487  assembleMessage<step::preModuleEvent>(sid, mid, static_cast<std::underlying_type_t<Phase>>(Phase::Event), t);
489  }
490  // Check for stalls if prefetch was called and we did not already check before acquire
491  if (duration_t::duration::zero() != startT && !start.second) {
492  auto const preFetch_to_preModEvent = duration_cast<duration_t>(preModEvent - start.first);
493  if (preFetch_to_preModEvent < stallThreshold_)
494  return;
495  moduleStats_[mid].update(preFetch_to_preModEvent);
496  }
497 }
498 
500  auto const tNow = now();
501  auto const sid = stream_id(sc);
502  auto const mid = module_id(mcc);
503  auto t = duration_cast<duration_t>(tNow - beginTime_).count();
504  auto msg = assembleMessage<step::preModuleEvent>(sid, mid, toTransition(sc), t);
506 }
507 
509  auto const t = duration_cast<duration_t>(now() - beginTime_).count();
510  auto msg = assembleMessage<step::postModuleEvent>(stream_id(sc), module_id(mcc), toTransition(sc), t);
512 }
513 
515  auto t = duration_cast<duration_t>(now() - beginTime_).count();
516  auto msg = assembleMessage<step::preModuleEvent>(numStreams_, module_id(mcc), toTransition(gc), t);
518 }
519 
521  auto const postModTime = duration_cast<duration_t>(now() - beginTime_).count();
522  auto msg = assembleMessage<step::postModuleEvent>(numStreams_, module_id(mcc), toTransition(gc), postModTime);
524 }
525 
527  auto const t = duration_cast<duration_t>(now() - beginTime_).count();
528  auto msg = assembleMessage<step::preEventReadFromSource>(stream_id(sc), module_id(mcc), t);
530 }
531 
533  auto const t = duration_cast<duration_t>(now() - beginTime_).count();
534  auto msg = assembleMessage<step::postEventReadFromSource>(stream_id(sc), module_id(mcc), t);
536 }
537 
539  auto const postModEvent = duration_cast<duration_t>(now() - beginTime_).count();
540  auto msg = assembleMessage<step::postModuleEvent>(
541  stream_id(sc), module_id(mcc), static_cast<std::underlying_type_t<Phase>>(Phase::Event), postModEvent);
543 }
544 
546  auto const t = duration_cast<duration_t>(now() - beginTime_).count();
547  auto const& eid = sc.eventID();
548  auto msg = assembleMessage<step::postEvent>(stream_id(sc), eid.run(), eid.luminosityBlock(), eid.event(), t);
550 }
551 
553  // Prepare summary
554  std::size_t width{};
555  edm::for_all(moduleStats_, [&width](auto const& stats) {
556  if (stats.numberOfStalls() == 0u)
557  return;
558  width = std::max(width, stats.label().size());
559  });
560 
561  OStreamColumn tag{"StallMonitor>"};
562  OStreamColumn col1{"Module label", width};
563  OStreamColumn col2{"# of stalls"};
564  OStreamColumn col3{"Total stalled time"};
565  OStreamColumn col4{"Max stalled time"};
566 
567  LogAbsolute out{"StallMonitor"};
568  out << '\n';
569  out << tag << space << col1 << space << col2 << space << col3 << space << col4 << '\n';
570 
571  out << tag << space << std::setfill('-') << col1(std::string{}) << space << col2(std::string{}) << space
572  << col3(std::string{}) << space << col4(std::string{}) << '\n';
573 
574  using seconds_d = duration<double>;
575 
576  auto to_seconds_str = [](auto const& duration) {
577  std::ostringstream oss;
578  auto const time = duration_cast<seconds_d>(duration).count();
579  oss << time << " s";
580  return oss.str();
581  };
582 
583  out << std::setfill(' ');
584  for (auto const& stats : moduleStats_) {
585  if (stats.label().empty() || // See comment in filling of moduleLabels_;
586  stats.numberOfStalls() == 0u)
587  continue;
588  out << std::left << tag << space << col1(stats.label()) << space << std::right << col2(stats.numberOfStalls())
589  << space << col3(to_seconds_str(stats.totalStalledTime())) << space
590  << col4(to_seconds_str(stats.maxStalledTime())) << '\n';
591  }
592 }
593 
ConfigurationDescriptions.h
class-composition.H
H
Definition: class-composition.py:31
writedatasetfile.args
args
Definition: writedatasetfile.py:18
edm::StreamID
Definition: StreamID.h:30
edm::service::StallMonitor::preModuleConstruction
void preModuleConstruction(edm::ModuleDescription const &)
Definition: StallMonitor.cc:357
edm::ModuleDescription::moduleLabel
std::string const & moduleLabel() const
Definition: ModuleDescription.h:43
service
Definition: service.py:1
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
ModuleCallingContext.h
mps_fire.i
i
Definition: mps_fire.py:428
start
Definition: start.py:1
Phase
Phase
Definition: StallMonitor.cc:108
MessageLogger.h
edm::service::StallMonitor::postEndJob
void postEndJob()
Definition: StallMonitor.cc:552
edm::service::StallMonitor::preModuleGlobalTransition
void preModuleGlobalTransition(GlobalContext const &, ModuleCallingContext const &)
Definition: StallMonitor.cc:514
step
step
Definition: StallMonitor.cc:94
fwrapper::cs
unique_ptr< ClusterSequence > cs
Definition: fastjetfortran_madfks.cc:47
submitPVValidationJobs.now
now
Definition: submitPVValidationJobs.py:639
edm::service::StallMonitor::postModuleGlobalTransition
void postModuleGlobalTransition(GlobalContext const &, ModuleCallingContext const &)
Definition: StallMonitor.cc:520
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::Transition::Event
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: L1TUtmAlgorithmRcd.h:4
edm::service::StallMonitor::StreamID_value
decltype(std::declval< StreamID >().value()) StreamID_value
Definition: StallMonitor.cc:228
edm::service::StallMonitor::beginTime_
decltype(now()) beginTime_
Definition: StallMonitor.cc:222
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
DEFINE_FWK_SERVICE
#define DEFINE_FWK_SERVICE(type)
Definition: ServiceMaker.h:96
Algorithms.h
cms::cuda::assert
assert(be >=bs)
protons_cff.time
time
Definition: protons_cff.py:39
edm::ThreadSafeOutputFileStream
Definition: ThreadSafeOutputFileStream.h:11
edm::service::StallMonitor::ModuleID
decltype(std::declval< ModuleDescription >().id()) ModuleID
Definition: StallMonitor.cc:229
mps_check.msg
tuple msg
Definition: mps_check.py:285
edm::service::StallMonitor::postModuleEventPrefetching
void postModuleEventPrefetching(StreamContext const &, ModuleCallingContext const &)
Definition: StallMonitor.cc:439
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::StreamID::value
unsigned int value() const
Definition: StreamID.h:43
edm::service::StallMonitor::postBeginJob
void postBeginJob()
Definition: StallMonitor.cc:384
SiPixelPI::zero
Definition: SiPixelPayloadInspectorHelper.h:39
edm::ModuleCallingContext::moduleDescription
ModuleDescription const * moduleDescription() const
Definition: ModuleCallingContext.h:50
edm::service::StallMonitor::postEvent
void postEvent(StreamContext const &)
Definition: StallMonitor.cc:545
edm::service::StallMonitor::preModuleEventAcquire
void preModuleEventAcquire(StreamContext const &, ModuleCallingContext const &)
Definition: StallMonitor.cc:451
edm::GlobalContext::transition
Transition transition() const
Definition: GlobalContext.h:53
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::for_all
Func for_all(ForwardSequence &s, Func f)
wrapper for std::for_each
Definition: Algorithms.h:14
ModuleDescription.h
ActivityRegistry.h
edm::service::StallMonitor::preSourceEvent
void preSourceEvent(StreamID)
Definition: StallMonitor.cc:420
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::service::StallMonitor::validFile_
const bool validFile_
Definition: StallMonitor.cc:220
edm::service::StallMonitor::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: StallMonitor.cc:340
edm::service::StallMonitor::postModuleEventAcquire
void postModuleEventAcquire(StreamContext const &, ModuleCallingContext const &)
Definition: StallMonitor.cc:472
h
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::StreamContext
Definition: StreamContext.h:31
edm::service::StallMonitor
Definition: StallMonitor.cc:193
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
Service.h
fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::ActivityRegistry
Definition: ActivityRegistry.h:134
edm::service::StallMonitor::preModuleStreamTransition
void preModuleStreamTransition(StreamContext const &, ModuleCallingContext const &)
Definition: StallMonitor.cc:499
edm::service::StallMonitor::file_
ThreadSafeOutputFileStream file_
Definition: StallMonitor.cc:219
ParameterSetDescription.h
ServiceMaker.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
S
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:97
edm::service::StallMonitor::stallStart_
tbb::concurrent_unordered_map< std::pair< StreamID_value, ModuleID >, std::pair< decltype(beginTime_), bool > > stallStart_
Definition: StallMonitor.cc:231
edm::service::StallMonitor::postModuleEvent
void postModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: StallMonitor.cc:538
edm::GlobalContext
Definition: GlobalContext.h:29
edm::service::StallMonitor::numStreams_
unsigned int numStreams_
Definition: StallMonitor.cc:235
edm::ParameterSet
Definition: ParameterSet.h:47
edm::service::StallMonitor::moduleStats_
std::vector< StallStatistics > moduleStats_
Definition: StallMonitor.cc:234
GlobalContext.h
operator<<
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
edm::service::StallMonitor::postEventReadFromSource
void postEventReadFromSource(StreamContext const &, ModuleCallingContext const &)
Definition: StallMonitor.cc:532
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
ThreadSafeOutputFileStream.h
edm::StreamContext::transition
Transition transition() const
Definition: StreamContext.h:55
edm::ConfigurationDescriptions::setComment
void setComment(std::string const &value)
Definition: ConfigurationDescriptions.cc:48
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
cuy.rep
rep
Definition: cuy.py:1190
edm::ThreadSafeOutputFileStream::write
void write(std::string &&msg)
Definition: ThreadSafeOutputFileStream.cc:17
edm::service::StallMonitor::moduleLabels_
std::vector< std::string > moduleLabels_
Definition: StallMonitor.cc:233
edm::service::StallMonitor::preModuleDestruction
void preModuleDestruction(edm::ModuleDescription const &)
Definition: StallMonitor.cc:378
dqmMemoryStats.stats
stats
Definition: dqmMemoryStats.py:134
edm::OStreamColumn
Definition: OStreamColumn.h:53
edm::service::StallMonitor::stallThreshold_
const duration_t stallThreshold_
Definition: StallMonitor.cc:221
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::service::StallMonitor::preModuleEvent
void preModuleEvent(StreamContext const &, ModuleCallingContext const &)
Definition: StallMonitor.cc:478
eostools.move
def move(src, dest)
Definition: eostools.py:511
T
long double T
Definition: Basic3DVectorLD.h:48
relativeConstraints.value
value
Definition: relativeConstraints.py:53
OStreamColumn.h
Exception.h
edm::service::StallMonitor::preEventReadFromSource
void preEventReadFromSource(StreamContext const &, ModuleCallingContext const &)
Definition: StallMonitor.cc:526
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
ParameterSet.h
StreamContext.h
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::Log
Definition: MessageLogger.h:70
SystemBounds.h
label
const char * label
Definition: PFTauDecayModeTools.cc:11
edm::service::StallMonitor::postSourceEvent
void postSourceEvent(StreamID)
Definition: StallMonitor.cc:426
edm::StreamContext::eventID
EventID const & eventID() const
Definition: StreamContext.h:59
edm::service::StallMonitor::postModuleStreamTransition
void postModuleStreamTransition(StreamContext const &, ModuleCallingContext const &)
Definition: StallMonitor.cc:508
update
#define update(a, b)
Definition: TrackClassifier.cc:10
edm::service::StallMonitor::preEvent
void preEvent(StreamContext const &)
Definition: StallMonitor.cc:432
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
edm::ModuleDescription::id
unsigned int id() const
Definition: ModuleDescription.h:46
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29