CMS 3D CMS Logo

moduleAlloc_setupFile.cc
Go to the documentation of this file.
3 
4 #include <chrono>
5 
6 #include <sstream>
7 #include <type_traits>
8 #include <cassert>
9 #include <typeindex>
10 
12 
18 
26 
29 
31 
32 #include "ThreadAllocInfo.h"
33 
35 
36 namespace {
37  using duration_t = std::chrono::microseconds;
38  using clock_t = std::chrono::steady_clock;
39  auto const now = clock_t::now;
40 
41  enum class Step : char {
42  preSourceTransition = 'S',
43  postSourceTransition = 's',
44  preModuleEventAcquire = 'A',
45  postModuleEventAcquire = 'a',
46  preModuleTransition = 'M',
47  preEventReadFromSource = 'R',
48  postEventReadFromSource = 'r',
49  preModuleEventDelayedGet = 'D',
50  postModuleEventDelayedGet = 'd',
51  postModuleTransition = 'm',
52  preESModule = 'N',
53  postESModule = 'n',
54  preESModuleAcquire = 'B',
55  postESModuleAcquire = 'b',
56  preFrameworkTransition = 'F',
57  postFrameworkTransition = 'f'
58  };
59 
60  constexpr bool isPostTransition(Step s) {
61  switch (s) {
62  case Step::postSourceTransition:
63  case Step::postModuleEventAcquire:
64  case Step::postEventReadFromSource:
65  case Step::postModuleEventDelayedGet:
66  case Step::postModuleTransition:
67  case Step::postESModule:
68  case Step::postESModuleAcquire:
69  case Step::postFrameworkTransition:
70  return true;
71  default:
72  return false;
73  }
74  return false;
75  }
76 
77  enum class Phase : short {
78  destruction = -16,
79  endJob = -12,
80  endStream = -11,
81  writeProcessBlock = -10,
82  endProcessBlock = -9,
83  globalWriteRun = -7,
84  globalEndRun = -6,
85  streamEndRun = -5,
86  globalWriteLumi = -4,
87  globalEndLumi = -3,
88  streamEndLumi = -2,
89  clearEvent = -1,
90  Event = 0,
91  streamBeginLumi = 2,
92  globalBeginLumi = 3,
93  streamBeginRun = 5,
94  globalBeginRun = 6,
95  accessInputProcessBlock = 8,
96  beginProcessBlock = 9,
97  openFile = 10,
98  beginStream = 11,
99  beginJob = 12,
100  esSync = 13,
101  esSyncEnqueue = 14,
102  getNextTransition = 15,
103  construction = 16,
104  startTracing = 17
105  };
106 
107  std::ostream& operator<<(std::ostream& os, Step const s) {
108  os << static_cast<std::underlying_type_t<Step>>(s);
109  return os;
110  }
111 
112  std::ostream& operator<<(std::ostream& os, Phase const s) {
113  os << static_cast<std::underlying_type_t<Phase>>(s);
114  return os;
115  }
116 
117  template <Step S, typename... ARGS>
118  std::string assembleMessage(ARGS const... args) {
119  std::ostringstream oss;
120  oss << S;
121  concatenate(oss, args...);
122  oss << '\n';
123  return oss.str();
124  }
125 
126  template <Step S, typename... ARGS>
127  std::string assembleAllocMessage(edm::service::moduleAlloc::ThreadAllocInfo const& info, ARGS const... args) {
128  std::ostringstream oss;
129  oss << S;
130  concatenate(oss, args...);
131  concatenate(oss,
132  info.nAllocations_,
133  info.nDeallocations_,
134  info.presentActual_,
135  info.minActual_,
136  info.maxActual_,
137  info.maxSingleAlloc_);
138  oss << '\n';
139  return oss.str();
140  }
141 
142  Phase toTransitionImpl(edm::StreamContext const& iContext) {
143  using namespace edm;
144  switch (iContext.transition()) {
146  return Phase::beginStream;
148  return Phase::streamBeginRun;
150  return Phase::streamBeginLumi;
152  return Phase::Event;
154  return Phase::streamEndLumi;
156  return Phase::streamEndRun;
158  return Phase::endStream;
159  default:
160  break;
161  }
162  assert(false);
163  return Phase::Event;
164  }
165 
166  auto toTransition(edm::StreamContext const& iContext) -> std::underlying_type_t<Phase> {
167  return static_cast<std::underlying_type_t<Phase>>(toTransitionImpl(iContext));
168  }
169 
170  Phase toTransitionImpl(edm::GlobalContext const& iContext) {
171  using namespace edm;
172  switch (iContext.transition()) {
174  return Phase::beginProcessBlock;
176  return Phase::accessInputProcessBlock;
178  return Phase::globalBeginRun;
180  return Phase::globalBeginLumi;
182  return Phase::globalEndLumi;
184  return Phase::globalWriteLumi;
186  return Phase::globalEndRun;
188  return Phase::globalWriteRun;
190  return Phase::endProcessBlock;
192  return Phase::writeProcessBlock;
193  default:
194  break;
195  }
196  assert(false);
197  return Phase::Event;
198  }
199  auto toTransition(edm::GlobalContext const& iContext) -> std::underlying_type_t<Phase> {
200  return static_cast<std::underlying_type_t<Phase>>(toTransitionImpl(iContext));
201  }
202 
203  unsigned int toTransitionIndex(edm::GlobalContext const& iContext) {
208  return 0;
209  }
213  return iContext.runIndex();
214  }
215  return iContext.luminosityBlockIndex();
216  }
217 
218  using namespace edm::service::moduleAlloc;
219 
220  template <Step S>
221  struct ESModuleState {
222  ESModuleState(std::shared_ptr<edm::ThreadSafeOutputFileStream> logFile,
223  decltype(now()) beginTime,
224  std::shared_ptr<std::vector<std::type_index>> recordIndices,
225  Filter const* iFilter)
226  : logFile_{logFile}, recordIndices_{recordIndices}, beginTime_{beginTime}, filter_(iFilter) {}
227 
228  void operator()(edm::eventsetup::EventSetupRecordKey const& iKey,
229  edm::ESModuleCallingContext const& iContext) const {
230  using namespace edm;
231  auto const t = std::chrono::duration_cast<duration_t>(now() - beginTime_).count();
232  auto top = iContext.getTopModuleCallingContext();
233  short int phase = 0;
234  unsigned long phaseID = 0xFFFFFFFF;
235  if (top->type() == ParentContext::Type::kGlobal) {
236  auto global = top->globalContext();
237  phase = toTransition(*global);
238  phaseID = toTransitionIndex(*global);
239  } else if (top->type() == ParentContext::Type::kStream) {
240  auto stream = top->getStreamContext();
241  phase = toTransition(*stream);
242  phaseID = stream_id(*stream);
243  } else if (top->type() == ParentContext::Type::kPlaceInPath) {
244  auto stream = top->getStreamContext();
245  phase = toTransition(*stream);
246  phaseID = stream_id(*stream);
247  }
248  auto recordIndex = findRecordIndices(iKey);
249  if constexpr (isPostTransition(S)) {
250  auto info = filter_->stopOnThread(-1 * (iContext.componentDescription()->id_ + 1));
251  if (info) {
252  auto msg = assembleAllocMessage<S>(
253  *info, phase, phaseID, iContext.componentDescription()->id_ + 1, recordIndex, iContext.callID(), t);
254  logFile_->write(std::move(msg));
255  }
256  } else {
257  if (filter_->startOnThread(-1 * (iContext.componentDescription()->id_ + 1))) {
258  auto msg = assembleMessage<S>(
259  phase, phaseID, iContext.componentDescription()->id_ + 1, recordIndex, iContext.callID(), t);
260  logFile_->write(std::move(msg));
261  }
262  }
263  }
264 
265  private:
266  int findRecordIndices(edm::eventsetup::EventSetupRecordKey const& iKey) const {
267  auto index = std::type_index(iKey.type().value());
268  auto itFind = std::find(recordIndices_->begin(), recordIndices_->end(), index);
269  return itFind - recordIndices_->begin();
270  }
271 
272  std::shared_ptr<edm::ThreadSafeOutputFileStream> logFile_;
273  std::shared_ptr<std::vector<std::type_index>> recordIndices_;
274  decltype(now()) beginTime_;
275  Filter const* filter_;
276  };
277 
278  template <Step S>
279  struct GlobalEDModuleState {
280  GlobalEDModuleState(std::shared_ptr<edm::ThreadSafeOutputFileStream> logFile,
281  decltype(now()) beginTime,
282  Filter const* iFilter)
283  : logFile_{logFile}, beginTime_{beginTime}, filter_(iFilter) {}
284 
285  void operator()(edm::GlobalContext const& gc, edm::ModuleCallingContext const& mcc) {
286  using namespace edm;
287  auto const t = std::chrono::duration_cast<duration_t>(now() - beginTime_).count();
288  if constexpr (isPostTransition(S)) {
289  auto id = module_id(mcc);
290  auto info = filter_->stopOnThread(id);
291  if (info) {
292  auto msg = assembleAllocMessage<S>(*info, toTransition(gc), toTransitionIndex(gc), id, module_callid(mcc), t);
293  logFile_->write(std::move(msg));
294  }
295  } else {
296  auto id = module_id(mcc);
297  if (filter_->startOnThread(id)) {
298  auto msg = assembleMessage<S>(toTransition(gc), toTransitionIndex(gc), module_id(mcc), module_callid(mcc), t);
299  logFile_->write(std::move(msg));
300  }
301  }
302  }
303 
304  private:
305  std::shared_ptr<edm::ThreadSafeOutputFileStream> logFile_;
306  decltype(now()) beginTime_;
307  Filter const* filter_;
308  };
309 
310  template <Step S>
311  struct StreamEDModuleState {
312  StreamEDModuleState(std::shared_ptr<edm::ThreadSafeOutputFileStream> logFile,
313  decltype(now()) beginTime,
314  Filter const* iFilter)
315  : logFile_{logFile}, beginTime_{beginTime}, filter_(iFilter) {}
316 
317  void operator()(edm::StreamContext const& sc, edm::ModuleCallingContext const& mcc) {
318  using namespace edm;
319  auto const t = std::chrono::duration_cast<duration_t>(now() - beginTime_).count();
320  if constexpr (isPostTransition(S)) {
321  auto id = module_id(mcc);
322  auto info = filter_->stopOnThread(id);
323  if (info) {
324  auto msg =
325  assembleAllocMessage<S>(*info, toTransition(sc), stream_id(sc), module_id(mcc), module_callid(mcc), t);
326  logFile_->write(std::move(msg));
327  }
328  } else {
329  auto id = module_id(mcc);
330  if (filter_->startOnThread(id)) {
331  auto msg = assembleMessage<S>(toTransition(sc), stream_id(sc), id, module_callid(mcc), t);
332  logFile_->write(std::move(msg));
333  }
334  }
335  }
336 
337  private:
338  std::shared_ptr<edm::ThreadSafeOutputFileStream> logFile_;
339  decltype(now()) beginTime_;
340  Filter const* filter_;
341  };
342 
343  struct ModuleCtrDtr {
344  long long beginConstruction = 0;
345  long long endConstruction = 0;
346  edm::service::moduleAlloc::ThreadAllocInfo constructionAllocInfo;
347  long long beginDestruction = 0;
348  long long endDestruction = 0;
349  edm::service::moduleAlloc::ThreadAllocInfo destructionAllocInfo;
350  };
351 } // namespace
352 
354  void setupFile(std::string const& iFileName, edm::ActivityRegistry& iRegistry, Filter const* iFilter) {
355  auto beginModuleAlloc = now();
356  using namespace std::chrono;
357 
358  if (iFileName.empty()) {
359  return;
360  }
361 
362  auto logFile = std::make_shared<edm::ThreadSafeOutputFileStream>(iFileName);
363 
364  auto beginTime = TimingServiceBase::jobStartTime();
365 
366  auto esModuleLabelsPtr = std::make_shared<std::vector<std::string>>();
367  auto& esModuleLabels = *esModuleLabelsPtr;
368  //acquire names for all the ED and ES modules
369  iRegistry.watchPostESModuleRegistration([&esModuleLabels](auto const& iDescription) {
370  if (esModuleLabels.size() <= iDescription.id_ + 1) {
371  esModuleLabels.resize(iDescription.id_ + 2);
372  }
373  //NOTE: we want the id to start at 1 not 0
374  if (not iDescription.label_.empty()) {
375  esModuleLabels[iDescription.id_ + 1] = iDescription.label_;
376  } else {
377  esModuleLabels[iDescription.id_ + 1] = iDescription.type_;
378  }
379  });
380  auto moduleCtrDtrPtr = std::make_shared<std::vector<ModuleCtrDtr>>();
381  auto& moduleCtrDtr = *moduleCtrDtrPtr;
382  auto moduleLabelsPtr = std::make_shared<std::vector<std::string>>();
383  auto& moduleLabels = *moduleLabelsPtr;
384  iRegistry.watchPreModuleConstruction(
385  [&moduleLabels, &moduleCtrDtr, beginTime, iFilter](ModuleDescription const& md) {
386  auto const t = duration_cast<duration_t>(now() - beginTime).count();
387 
388  auto const mid = md.id();
389  if (mid < moduleLabels.size()) {
390  moduleLabels[mid] = md.moduleLabel();
391  moduleCtrDtr[mid].beginConstruction = t;
392  } else {
393  moduleLabels.resize(mid + 1);
394  moduleLabels.back() = md.moduleLabel();
395  moduleCtrDtr.resize(mid + 1);
396  moduleCtrDtr.back().beginConstruction = t;
397  }
398  iFilter->startOnThread(mid);
399  });
400  iRegistry.watchPostModuleConstruction([&moduleCtrDtr, beginTime, iFilter](auto const& md) {
401  auto const t = duration_cast<duration_t>(now() - beginTime).count();
402  moduleCtrDtr[md.id()].endConstruction = t;
403  auto alloc = iFilter->stopOnThread(md.id());
404  if (alloc) {
405  moduleCtrDtr[md.id()].constructionAllocInfo = *alloc;
406  }
407  });
408 
409  auto addDataInDtr = std::make_shared<bool>(false);
410  iRegistry.watchPreModuleDestruction([&moduleCtrDtr, beginTime, iFilter, addDataInDtr, logFile](auto const& md) {
411  auto const t = duration_cast<duration_t>(now() - beginTime).count();
412  if (*addDataInDtr) {
413  if (iFilter->keepModuleInfo(md.id())) {
414  auto bmsg = assembleMessage<Step::preModuleTransition>(
415  static_cast<std::underlying_type_t<Phase>>(Phase::destruction), 0, md.id(), 0, 0, 0, t);
416  logFile->write(std::move(bmsg));
417  }
418  } else {
419  moduleCtrDtr[md.id()].beginDestruction = t;
420  }
421  iFilter->startOnThread(md.id());
422  });
423  iRegistry.watchPostModuleDestruction([&moduleCtrDtr, beginTime, iFilter, addDataInDtr, logFile](auto const& md) {
424  auto const t = duration_cast<duration_t>(now() - beginTime).count();
425  if (not *addDataInDtr) {
426  moduleCtrDtr[md.id()].endDestruction = t;
427  }
428  auto info = iFilter->stopOnThread(md.id());
429  if (info) {
430  if (*addDataInDtr) {
431  if (iFilter->keepModuleInfo(md.id())) {
432  auto emsg = assembleAllocMessage<Step::postModuleTransition>(
433  *info, static_cast<std::underlying_type_t<Phase>>(Phase::destruction), 0, md.id(), 0, 0, 0, t);
434  logFile->write(std::move(emsg));
435  }
436 
437  } else {
438  moduleCtrDtr[md.id()].destructionAllocInfo = *info;
439  }
440  }
441  });
442 
443  auto sourceCtrPtr = std::make_shared<ModuleCtrDtr>();
444  auto& sourceCtr = *sourceCtrPtr;
445  iRegistry.watchPreSourceConstruction([&sourceCtr, beginTime, iFilter](auto const&) {
446  auto const t = duration_cast<duration_t>(now() - beginTime).count();
447  sourceCtr.beginConstruction = t;
448  iFilter->startOnThread();
449  });
450  iRegistry.watchPostSourceConstruction([&sourceCtr, beginTime, iFilter](auto const&) {
451  auto const t = duration_cast<duration_t>(now() - beginTime).count();
452  sourceCtr.endConstruction = t;
453  auto info = iFilter->stopOnThread();
454  if (info) {
455  sourceCtr.constructionAllocInfo = *info;
456  }
457  });
458 
459  auto recordIndices = std::make_shared<std::vector<std::type_index>>();
461  [logFile, recordIndices](auto const& recordsToResolvers, auto const&) mutable {
462  std::ostringstream oss;
463 
464  auto recordKeys = recordsToResolvers.recordKeys();
465  std::sort(recordKeys.begin(), recordKeys.end());
466  std::vector<std::string> recordNames;
467  //want id to start at 1 not 0
468  recordNames.reserve(recordKeys.size() + 1);
469  recordNames.emplace_back("");
470  recordIndices->reserve(recordKeys.size() + 1);
471  recordIndices->push_back(std::type_index(typeid(void)));
472  for (auto const& r : recordKeys) {
473  recordNames.push_back(r.name());
474  recordIndices->push_back(std::type_index(r.type().value()));
475  }
476 
477  moduleIdToLabel(oss, recordNames, 'R', "Record ID", "Record name");
478  logFile->write(oss.str());
479  });
480 
481  iRegistry.watchPreBeginJob([logFile,
482  iFilter,
483  moduleLabelsPtr,
484  esModuleLabelsPtr,
485  moduleCtrDtrPtr,
486  sourceCtrPtr,
487  beginTime,
488  beginModuleAlloc,
489  addDataInDtr](auto&, auto&) mutable {
490  *addDataInDtr = true;
491  {
492  std::ostringstream oss;
493  moduleIdToLabel(oss, *moduleLabelsPtr, 'M', "EDModule ID", "Module label");
494  logFile->write(oss.str());
495  moduleLabelsPtr.reset();
496  }
497  {
498  std::ostringstream oss;
499  moduleIdToLabel(oss, *esModuleLabelsPtr, 'N', "ESModule ID", "ESModule label");
500  logFile->write(oss.str());
501  esModuleLabelsPtr.reset();
502  }
503  {
504  auto const moduleAllocStart = duration_cast<duration_t>(beginModuleAlloc - beginTime).count();
505  auto msg = assembleMessage<Step::preFrameworkTransition>(
506  static_cast<std::underlying_type_t<Phase>>(Phase::startTracing), 0, 0, 0, 0, moduleAllocStart);
507  logFile->write(std::move(msg));
508  }
509  if (not iFilter->globalKeep()) {
510  auto const t = duration_cast<duration_t>(now() - beginTime).count();
511  auto msg = assembleMessage<Step::preFrameworkTransition>(
512  static_cast<std::underlying_type_t<Phase>>(Phase::beginJob), 0, 0, 0, 0, t);
513  logFile->write(std::move(msg));
514  return;
515  }
516  //NOTE: the source construction can run concurently with module construction so we need to properly
517  // interleave its timing in with the modules
518  auto srcBeginConstruction = sourceCtrPtr->beginConstruction;
519  auto srcEndConstruction = sourceCtrPtr->endConstruction;
520  auto srcAllocInfo = sourceCtrPtr->constructionAllocInfo;
521  sourceCtrPtr.reset();
522  auto handleSource =
523  [&srcBeginConstruction, &srcEndConstruction, &logFile, &srcAllocInfo](long long iTime) mutable {
524  if (srcBeginConstruction != 0 and srcBeginConstruction < iTime) {
525  auto bmsg = assembleMessage<Step::preSourceTransition>(
526  static_cast<std::underlying_type_t<Phase>>(Phase::construction), 0, srcBeginConstruction);
527  logFile->write(std::move(bmsg));
528  srcBeginConstruction = 0;
529  }
530  if (srcEndConstruction != 0 and srcEndConstruction < iTime) {
531  auto bmsg = assembleAllocMessage<Step::postSourceTransition>(
532  srcAllocInfo, static_cast<std::underlying_type_t<Phase>>(Phase::construction), 0, srcEndConstruction);
533  logFile->write(std::move(bmsg));
534  srcEndConstruction = 0;
535  }
536  };
537  {
538  std::sort(moduleCtrDtrPtr->begin(), moduleCtrDtrPtr->end(), [](auto const& l, auto const& r) {
539  return l.beginConstruction < r.beginConstruction;
540  });
541  int id = 0;
542  for (auto const& ctr : *moduleCtrDtrPtr) {
543  if (ctr.beginConstruction != 0) {
544  handleSource(ctr.beginConstruction);
545  if (iFilter->keepModuleInfo(id)) {
546  auto bmsg = assembleMessage<Step::preModuleTransition>(
547  static_cast<std::underlying_type_t<Phase>>(Phase::construction), 0, id, 0, ctr.beginConstruction);
548  logFile->write(std::move(bmsg));
549  }
550  handleSource(ctr.endConstruction);
551  if (iFilter->keepModuleInfo(id)) {
552  auto const& allocInfo = ctr.constructionAllocInfo;
553  auto emsg = assembleAllocMessage<Step::postModuleTransition>(
554  allocInfo,
555  static_cast<std::underlying_type_t<Phase>>(Phase::construction),
556  0,
557  id,
558  0,
559  ctr.endConstruction);
560  logFile->write(std::move(emsg));
561  }
562  }
563  ++id;
564  }
565  id = 0;
566  std::sort(moduleCtrDtrPtr->begin(), moduleCtrDtrPtr->end(), [](auto const& l, auto const& r) {
567  return l.beginDestruction < r.beginDestruction;
568  });
569  for (auto const& dtr : *moduleCtrDtrPtr) {
570  if (dtr.beginDestruction != 0) {
571  handleSource(dtr.beginDestruction);
572  if (iFilter->keepModuleInfo(id)) {
573  auto bmsg = assembleMessage<Step::preModuleTransition>(
574  static_cast<std::underlying_type_t<Phase>>(Phase::destruction), 0, id, 0, 0, 0, dtr.beginDestruction);
575  logFile->write(std::move(bmsg));
576  }
577  handleSource(dtr.endDestruction);
578  if (iFilter->keepModuleInfo(id)) {
579  auto emsg = assembleAllocMessage<Step::postModuleTransition>(
580  dtr.destructionAllocInfo,
581  static_cast<std::underlying_type_t<Phase>>(Phase::destruction),
582  0,
583  id,
584  0,
585  0,
586  0,
587  dtr.endDestruction);
588  logFile->write(std::move(emsg));
589  }
590  }
591  ++id;
592  }
593  moduleCtrDtrPtr.reset();
594  }
595  auto const t = duration_cast<duration_t>(now() - beginTime).count();
596  handleSource(t);
597  auto msg = assembleMessage<Step::preFrameworkTransition>(
598  static_cast<std::underlying_type_t<Phase>>(Phase::beginJob), 0, 0, 0, 0, t);
599  logFile->write(std::move(msg));
600  });
601  iRegistry.watchPostBeginJob([logFile, beginTime]() {
602  auto const t = duration_cast<duration_t>(now() - beginTime).count();
603  auto msg = assembleMessage<Step::postFrameworkTransition>(
604  static_cast<std::underlying_type_t<Phase>>(Phase::beginJob), 0, 0, 0, 0, t);
605  logFile->write(std::move(msg));
606  });
607 
608  iRegistry.watchPreEndJob([logFile, beginTime]() {
609  auto const t = duration_cast<duration_t>(now() - beginTime).count();
610  auto msg = assembleMessage<Step::preFrameworkTransition>(
611  static_cast<std::underlying_type_t<Phase>>(Phase::endJob), 0, 0, 0, 0, t);
612  logFile->write(std::move(msg));
613  });
614  iRegistry.watchPostEndJob([logFile, beginTime]() {
615  auto const t = duration_cast<duration_t>(now() - beginTime).count();
616  auto msg = assembleMessage<Step::postFrameworkTransition>(
617  static_cast<std::underlying_type_t<Phase>>(Phase::endJob), 0, 0, 0, 0, t);
618  logFile->write(std::move(msg));
619  });
620 
621  iRegistry.watchPreEvent([logFile, beginTime](auto const& sc) {
622  auto const t = duration_cast<duration_t>(now() - beginTime).count();
623  auto msg = assembleMessage<Step::preFrameworkTransition>(static_cast<std::underlying_type_t<Phase>>(Phase::Event),
624  stream_id(sc),
625  sc.eventID().run(),
626  sc.eventID().luminosityBlock(),
627  sc.eventID().event(),
628  t);
629  logFile->write(std::move(msg));
630  });
631  iRegistry.watchPostEvent([logFile, beginTime](auto const& sc) {
632  auto const t = duration_cast<duration_t>(now() - beginTime).count();
633  auto msg =
634  assembleMessage<Step::postFrameworkTransition>(static_cast<std::underlying_type_t<Phase>>(Phase::Event),
635  stream_id(sc),
636  sc.eventID().run(),
637  sc.eventID().luminosityBlock(),
638  sc.eventID().event(),
639  t);
640  logFile->write(std::move(msg));
641  });
642 
643  iRegistry.watchPreClearEvent([logFile, beginTime, iFilter](auto const& sc) {
644  if (iFilter->startOnThread()) {
645  auto const t = duration_cast<duration_t>(now() - beginTime).count();
646  auto msg =
647  assembleMessage<Step::preFrameworkTransition>(static_cast<std::underlying_type_t<Phase>>(Phase::clearEvent),
648  stream_id(sc),
649  sc.eventID().run(),
650  sc.eventID().luminosityBlock(),
651  sc.eventID().event(),
652  t);
653  logFile->write(std::move(msg));
654  }
655  });
656  iRegistry.watchPostClearEvent([logFile, beginTime, iFilter](auto const& sc) {
657  auto info = iFilter->stopOnThread();
658  if (info) {
659  auto const t = duration_cast<duration_t>(now() - beginTime).count();
660  auto msg = assembleAllocMessage<Step::postFrameworkTransition>(
661  *info,
662  static_cast<std::underlying_type_t<Phase>>(Phase::clearEvent),
663  stream_id(sc),
664  sc.eventID().run(),
665  sc.eventID().luminosityBlock(),
666  sc.eventID().event(),
667  t);
668  logFile->write(std::move(msg));
669  }
670  });
671 
672  {
673  auto preGlobal = [logFile, beginTime](GlobalContext const& gc) {
674  auto const t = duration_cast<duration_t>(now() - beginTime).count();
675  auto msg = assembleMessage<Step::preFrameworkTransition>(toTransition(gc),
676  toTransitionIndex(gc),
677  gc.luminosityBlockID().run(),
679  0,
680  t);
681  logFile->write(std::move(msg));
682  };
683  iRegistry.watchPreBeginProcessBlock(preGlobal);
684  iRegistry.watchPreEndProcessBlock(preGlobal);
685  iRegistry.watchPreWriteProcessBlock(preGlobal);
686  iRegistry.watchPreAccessInputProcessBlock(preGlobal);
687  iRegistry.watchPreGlobalBeginRun(preGlobal);
688  iRegistry.watchPreGlobalBeginLumi(preGlobal);
689  iRegistry.watchPreGlobalEndLumi(preGlobal);
690  iRegistry.watchPreGlobalWriteLumi(preGlobal);
691  iRegistry.watchPreGlobalEndRun(preGlobal);
692  iRegistry.watchPreGlobalWriteRun(preGlobal);
693  }
694  {
695  auto postGlobal = [logFile, beginTime](GlobalContext const& gc) {
696  auto const t = duration_cast<duration_t>(now() - beginTime).count();
697  auto msg = assembleMessage<Step::postFrameworkTransition>(toTransition(gc),
698  toTransitionIndex(gc),
699  gc.luminosityBlockID().run(),
701  0,
702  t);
703  logFile->write(std::move(msg));
704  };
705  iRegistry.watchPostBeginProcessBlock(postGlobal);
706  iRegistry.watchPostEndProcessBlock(postGlobal);
707  iRegistry.watchPostWriteProcessBlock(postGlobal);
708  iRegistry.watchPostAccessInputProcessBlock(postGlobal);
709  iRegistry.watchPostGlobalBeginRun(postGlobal);
710  iRegistry.watchPostGlobalBeginLumi(postGlobal);
711  iRegistry.watchPostGlobalEndLumi(postGlobal);
712  iRegistry.watchPostGlobalWriteLumi(postGlobal);
713  iRegistry.watchPostGlobalEndRun(postGlobal);
714  iRegistry.watchPostGlobalWriteRun(postGlobal);
715  }
716  {
717  auto preStream = [logFile, beginTime](StreamContext const& sc) {
718  auto const t = duration_cast<duration_t>(now() - beginTime).count();
719  auto msg = assembleMessage<Step::preFrameworkTransition>(
720  toTransition(sc), stream_id(sc), sc.eventID().run(), sc.eventID().luminosityBlock(), 0, t);
721  logFile->write(std::move(msg));
722  };
723  iRegistry.watchPreStreamBeginRun(preStream);
724  iRegistry.watchPreStreamBeginLumi(preStream);
725  iRegistry.watchPreStreamEndLumi(preStream);
726  iRegistry.watchPreStreamEndRun(preStream);
727  }
728  {
729  auto postStream = [logFile, beginTime](StreamContext const& sc) {
730  auto const t = duration_cast<duration_t>(now() - beginTime).count();
731  auto msg = assembleMessage<Step::postFrameworkTransition>(
732  toTransition(sc), stream_id(sc), sc.eventID().run(), sc.eventID().luminosityBlock(), 0, t);
733  logFile->write(std::move(msg));
734  };
735  iRegistry.watchPostStreamBeginRun(postStream);
736  iRegistry.watchPostStreamBeginLumi(postStream);
737  iRegistry.watchPostStreamEndLumi(postStream);
738  iRegistry.watchPostStreamEndRun(postStream);
739  }
740  {
741  iRegistry.watchPreOpenFile([logFile, beginTime, iFilter](std::string const&) {
742  if (iFilter->startOnThread()) {
743  auto const t = duration_cast<duration_t>(now() - beginTime).count();
744  auto msg = assembleMessage<Step::preSourceTransition>(
745  static_cast<std::underlying_type_t<Phase>>(Phase::openFile), 0, t);
746  logFile->write(std::move(msg));
747  }
748  });
749  iRegistry.watchPostOpenFile([logFile, beginTime, iFilter](std::string const&) {
750  auto info = iFilter->stopOnThread();
751  if (info) {
752  auto const t = duration_cast<duration_t>(now() - beginTime).count();
753  auto msg = assembleAllocMessage<Step::postSourceTransition>(
754  *info, static_cast<std::underlying_type_t<Phase>>(Phase::openFile), 0, t);
755  logFile->write(std::move(msg));
756  }
757  });
758  iRegistry.watchPreSourceEvent([logFile, beginTime, iFilter](StreamID id) {
759  if (iFilter->startOnThread()) {
760  auto const t = duration_cast<duration_t>(now() - beginTime).count();
761  auto msg = assembleMessage<Step::preSourceTransition>(
762  static_cast<std::underlying_type_t<Phase>>(Phase::Event), id.value(), t);
763  logFile->write(std::move(msg));
764  }
765  });
766  iRegistry.watchPostSourceEvent([logFile, beginTime, iFilter](StreamID id) {
767  auto info = iFilter->stopOnThread();
768  if (info) {
769  auto const t = duration_cast<duration_t>(now() - beginTime).count();
770  auto msg = assembleAllocMessage<Step::postSourceTransition>(
771  *info, static_cast<std::underlying_type_t<Phase>>(Phase::Event), id.value(), t);
772  logFile->write(std::move(msg));
773  }
774  });
775 
776  iRegistry.watchPreSourceRun([logFile, beginTime, iFilter](RunIndex id) {
777  if (iFilter->startOnThread()) {
778  auto const t = duration_cast<duration_t>(now() - beginTime).count();
779  auto msg = assembleMessage<Step::preSourceTransition>(
780  static_cast<std::underlying_type_t<Phase>>(Phase::globalBeginRun), id.value(), t);
781  logFile->write(std::move(msg));
782  }
783  });
784  iRegistry.watchPostSourceRun([logFile, beginTime, iFilter](RunIndex id) {
785  auto info = iFilter->stopOnThread();
786  if (info) {
787  auto const t = duration_cast<duration_t>(now() - beginTime).count();
788  auto msg = assembleAllocMessage<Step::postSourceTransition>(
789  *info, static_cast<std::underlying_type_t<Phase>>(Phase::globalBeginRun), id.value(), t);
790  logFile->write(std::move(msg));
791  }
792  });
793 
794  iRegistry.watchPreSourceLumi([logFile, beginTime, iFilter](auto id) {
795  if (iFilter->startOnThread()) {
796  auto const t = duration_cast<duration_t>(now() - beginTime).count();
797  auto msg = assembleMessage<Step::preSourceTransition>(
798  static_cast<std::underlying_type_t<Phase>>(Phase::globalBeginLumi), id.value(), t);
799  logFile->write(std::move(msg));
800  }
801  });
802  iRegistry.watchPostSourceLumi([logFile, beginTime, iFilter](auto id) {
803  auto info = iFilter->stopOnThread();
804  if (info) {
805  auto const t = duration_cast<duration_t>(now() - beginTime).count();
806  auto msg = assembleAllocMessage<Step::postSourceTransition>(
807  *info, static_cast<std::underlying_type_t<Phase>>(Phase::globalBeginLumi), id.value(), t);
808  logFile->write(std::move(msg));
809  }
810  });
811 
812  iRegistry.watchPreSourceNextTransition([logFile, beginTime, iFilter]() {
813  if (iFilter->startOnThread()) {
814  auto const t = duration_cast<duration_t>(now() - beginTime).count();
815  auto msg = assembleMessage<Step::preSourceTransition>(
816  static_cast<std::underlying_type_t<Phase>>(Phase::getNextTransition), t);
817  logFile->write(std::move(msg));
818  }
819  });
820  iRegistry.watchPostSourceNextTransition([logFile, beginTime, iFilter]() {
821  auto info = iFilter->stopOnThread();
822  if (info) {
823  auto const t = duration_cast<duration_t>(now() - beginTime).count();
824  auto msg = assembleAllocMessage<Step::postSourceTransition>(
825  *info, static_cast<std::underlying_type_t<Phase>>(Phase::getNextTransition), t);
826  logFile->write(std::move(msg));
827  }
828  });
829 
830  //ED Modules
831  iRegistry.watchPreModuleBeginJob([logFile, beginTime, iFilter](auto const& md) {
832  if (iFilter->startOnThread(md.id())) {
833  auto const t = duration_cast<duration_t>(now() - beginTime).count();
834  auto msg = assembleMessage<Step::preModuleTransition>(
835  static_cast<std::underlying_type_t<Phase>>(Phase::beginJob), 0, md.id(), 0, t);
836  logFile->write(std::move(msg));
837  }
838  });
839  iRegistry.watchPostModuleBeginJob([logFile, beginTime, iFilter](auto const& md) {
840  auto info = iFilter->stopOnThread(md.id());
841  if (info) {
842  auto const t = duration_cast<duration_t>(now() - beginTime).count();
843  auto msg = assembleAllocMessage<Step::postModuleTransition>(
844  *info, static_cast<std::underlying_type_t<Phase>>(Phase::beginJob), 0, md.id(), 0, t);
845  logFile->write(std::move(msg));
846  }
847  });
848 
849  iRegistry.watchPreModuleBeginStream(StreamEDModuleState<Step::preModuleTransition>(logFile, beginTime, iFilter));
850  iRegistry.watchPostModuleBeginStream(
851  StreamEDModuleState<Step::postModuleTransition>(logFile, beginTime, iFilter));
852 
853  iRegistry.watchPreModuleEndStream(StreamEDModuleState<Step::preModuleTransition>(logFile, beginTime, iFilter));
854  iRegistry.watchPostModuleEndStream(StreamEDModuleState<Step::postModuleTransition>(logFile, beginTime, iFilter));
855 
856  iRegistry.watchPreModuleEndJob([logFile, beginTime, iFilter](auto const& md) {
857  if (iFilter->startOnThread(md.id())) {
858  auto const t = duration_cast<duration_t>(now() - beginTime).count();
859  auto msg = assembleMessage<Step::preModuleTransition>(
860  static_cast<std::underlying_type_t<Phase>>(Phase::endJob), 0, md.id(), 0, t);
861  logFile->write(std::move(msg));
862  }
863  });
864  iRegistry.watchPostModuleEndJob([logFile, beginTime, iFilter](auto const& md) {
865  auto info = iFilter->stopOnThread(md.id());
866  if (info) {
867  auto const t = duration_cast<duration_t>(now() - beginTime).count();
868  auto msg = assembleAllocMessage<Step::postModuleTransition>(
869  *info, static_cast<std::underlying_type_t<Phase>>(Phase::endJob), 0, md.id(), 0, t);
870  logFile->write(std::move(msg));
871  }
872  });
873 
874  iRegistry.watchPreModuleEvent(StreamEDModuleState<Step::preModuleTransition>(logFile, beginTime, iFilter));
875  iRegistry.watchPostModuleEvent(StreamEDModuleState<Step::postModuleTransition>(logFile, beginTime, iFilter));
876  iRegistry.watchPreModuleEventAcquire(
877  StreamEDModuleState<Step::preModuleEventAcquire>(logFile, beginTime, iFilter));
878  iRegistry.watchPostModuleEventAcquire(
879  StreamEDModuleState<Step::postModuleEventAcquire>(logFile, beginTime, iFilter));
881  StreamEDModuleState<Step::preModuleEventDelayedGet>(logFile, beginTime, iFilter));
883  StreamEDModuleState<Step::postModuleEventDelayedGet>(logFile, beginTime, iFilter));
884  iRegistry.watchPreEventReadFromSource(
885  StreamEDModuleState<Step::preEventReadFromSource>(logFile, beginTime, iFilter));
887  StreamEDModuleState<Step::postEventReadFromSource>(logFile, beginTime, iFilter));
888 
889  iRegistry.watchPreModuleTransform(StreamEDModuleState<Step::preModuleTransition>(logFile, beginTime, iFilter));
890  iRegistry.watchPostModuleTransform(StreamEDModuleState<Step::postModuleTransition>(logFile, beginTime, iFilter));
892  StreamEDModuleState<Step::preModuleEventAcquire>(logFile, beginTime, iFilter));
894  StreamEDModuleState<Step::postModuleEventAcquire>(logFile, beginTime, iFilter));
895 
897  StreamEDModuleState<Step::preModuleTransition>(logFile, beginTime, iFilter));
899  StreamEDModuleState<Step::postModuleTransition>(logFile, beginTime, iFilter));
900  iRegistry.watchPreModuleStreamEndRun(StreamEDModuleState<Step::preModuleTransition>(logFile, beginTime, iFilter));
901  iRegistry.watchPostModuleStreamEndRun(
902  StreamEDModuleState<Step::postModuleTransition>(logFile, beginTime, iFilter));
903 
905  StreamEDModuleState<Step::preModuleTransition>(logFile, beginTime, iFilter));
907  StreamEDModuleState<Step::postModuleTransition>(logFile, beginTime, iFilter));
908  iRegistry.watchPreModuleStreamEndLumi(
909  StreamEDModuleState<Step::preModuleTransition>(logFile, beginTime, iFilter));
911  StreamEDModuleState<Step::postModuleTransition>(logFile, beginTime, iFilter));
912 
914  GlobalEDModuleState<Step::preModuleTransition>(logFile, beginTime, iFilter));
916  GlobalEDModuleState<Step::postModuleTransition>(logFile, beginTime, iFilter));
918  GlobalEDModuleState<Step::preModuleTransition>(logFile, beginTime, iFilter));
920  GlobalEDModuleState<Step::postModuleTransition>(logFile, beginTime, iFilter));
922  GlobalEDModuleState<Step::preModuleTransition>(logFile, beginTime, iFilter));
924  GlobalEDModuleState<Step::postModuleTransition>(logFile, beginTime, iFilter));
925 
927  GlobalEDModuleState<Step::preModuleTransition>(logFile, beginTime, iFilter));
929  GlobalEDModuleState<Step::postModuleTransition>(logFile, beginTime, iFilter));
930  iRegistry.watchPreModuleGlobalEndRun(GlobalEDModuleState<Step::preModuleTransition>(logFile, beginTime, iFilter));
931  iRegistry.watchPostModuleGlobalEndRun(
932  GlobalEDModuleState<Step::postModuleTransition>(logFile, beginTime, iFilter));
933 
935  GlobalEDModuleState<Step::preModuleTransition>(logFile, beginTime, iFilter));
937  GlobalEDModuleState<Step::postModuleTransition>(logFile, beginTime, iFilter));
938  iRegistry.watchPreModuleGlobalEndLumi(
939  GlobalEDModuleState<Step::preModuleTransition>(logFile, beginTime, iFilter));
941  GlobalEDModuleState<Step::postModuleTransition>(logFile, beginTime, iFilter));
942 
944  GlobalEDModuleState<Step::preModuleTransition>(logFile, beginTime, iFilter));
946  GlobalEDModuleState<Step::postModuleTransition>(logFile, beginTime, iFilter));
947 
948  iRegistry.watchPreModuleWriteRun(GlobalEDModuleState<Step::preModuleTransition>(logFile, beginTime, iFilter));
949  iRegistry.watchPostModuleWriteRun(GlobalEDModuleState<Step::postModuleTransition>(logFile, beginTime, iFilter));
950 
951  iRegistry.watchPreModuleWriteLumi(GlobalEDModuleState<Step::preModuleTransition>(logFile, beginTime, iFilter));
952  iRegistry.watchPostModuleWriteLumi(GlobalEDModuleState<Step::postModuleTransition>(logFile, beginTime, iFilter));
953 
954  //ES Modules
955  iRegistry.watchPreESModule(ESModuleState<Step::preESModule>(logFile, beginTime, recordIndices, iFilter));
956  iRegistry.watchPostESModule(ESModuleState<Step::postESModule>(logFile, beginTime, recordIndices, iFilter));
957  iRegistry.watchPreESModuleAcquire(
958  ESModuleState<Step::preESModuleAcquire>(logFile, beginTime, recordIndices, iFilter));
959  iRegistry.watchPostESModuleAcquire(
960  ESModuleState<Step::postESModuleAcquire>(logFile, beginTime, recordIndices, iFilter));
961  }
962 
963  std::ostringstream oss;
964  oss << "# Transition Type Symbol\n";
965  oss << "#------------------------ ------\n";
966  oss << "# startTracing " << Phase::startTracing << "\n"
967  << "# construction " << Phase::construction << "\n"
968  << "# getNextTransition " << Phase::getNextTransition << "\n"
969  << "# beginJob " << Phase::beginJob << "\n"
970  << "# beginStream " << Phase::beginStream << "\n"
971  << "# openFile " << Phase::openFile << "\n"
972  << "# beginProcessBlock " << Phase::beginProcessBlock << "\n"
973  << "# accessInputProcessBlock " << Phase::accessInputProcessBlock << "\n"
974  << "# globalBeginRun " << Phase::globalBeginRun << "\n"
975  << "# streamBeginRun " << Phase::streamBeginRun << "\n"
976  << "# globalBeginLumi " << Phase::globalBeginLumi << "\n"
977  << "# streamBeginLumi " << Phase::streamBeginLumi << "\n"
978  << "# Event " << Phase::Event << "\n"
979  << "# clearEvent " << Phase::clearEvent << "\n"
980  << "# streamEndLumi " << Phase::streamEndLumi << "\n"
981  << "# globalEndLumi " << Phase::globalEndLumi << "\n"
982  << "# globalWriteLumi " << Phase::globalWriteLumi << "\n"
983  << "# streamEndRun " << Phase::streamEndRun << "\n"
984  << "# globalEndRun " << Phase::globalEndRun << "\n"
985  << "# globalWriteRun " << Phase::globalWriteRun << "\n"
986  << "# endProcessBlock " << Phase::endProcessBlock << "\n"
987  << "# writeProcessBlock " << Phase::writeProcessBlock << "\n"
988  << "# endStream " << Phase::endStream << "\n"
989  << "# endJob " << Phase::endJob << "\n"
990  << "# destruction " << Phase::destruction << "\n\n";
991  constexpr std::string_view kTransition = " <Transition type> <Transition ID>";
992  constexpr std::string_view kTransitionInfo = " <Run #> <LumiBlock #> <Event #>";
993  constexpr std::string_view kTime = " <Time since begin of cmsRun (us)>";
994  constexpr std::string_view kEDModule = " <EDModule ID> <Call ID>";
995  constexpr std::string_view kESModule = " <ESModule ID> <Record ID> <Call ID>";
996  constexpr std::string_view kAllocInfo =
997  " <# allocs> <# deallocs> <additional bytes> <min bytes> <max bytes> <max allocation bytes>";
998 
999  oss << "# Step Symbol Entries\n"
1000  << "# -------------------------- ------ ------------------------------------------\n"
1001  << "# preSourceTransition " << Step::preSourceTransition << kTransition << kTime << "\n"
1002  << "# postSourceTransition " << Step::postSourceTransition << kTransition << kTime << " " << kAllocInfo
1003  << "\n"
1004  << "# preModuleEventAcquire " << Step::preModuleEventAcquire << kTransition << kEDModule << kTime
1005  << "\n"
1006  << "# postModuleEventAcquire " << Step::postModuleEventAcquire << kTransition << kEDModule << kTime
1007  << kAllocInfo << "\n"
1008  << "# preModuleTransition " << Step::preModuleTransition << kTransition << kEDModule << kTime << "\n"
1009  << "# preEventReadFromSource " << Step::preEventReadFromSource << kTransition << kEDModule << kTime
1010  << "\n"
1011  << "# postEventReadFromSource " << Step::postEventReadFromSource << kTransition << kEDModule << kTime
1012  << kAllocInfo << "\n"
1013  << "# postModuleTransition " << Step::postModuleTransition << kTransition << kEDModule << kTime
1014  << kAllocInfo << "\n"
1015  << "# preESModuleTransition " << Step::preESModule << kTransition << kESModule << kTime << "\n"
1016  << "# postESModuleTransition " << Step::postESModule << kTransition << kESModule << kTime << kAllocInfo
1017  << "\n"
1018  << "# preFrameworkTransition " << Step::preFrameworkTransition << kTransition << kTransitionInfo << kTime
1019  << "\n"
1020  << "# preFrameworkTransition " << Step::preFrameworkTransition << " "
1021  << Phase::clearEvent << " <Transition ID>" << kTransitionInfo << kTime << kAllocInfo << "\n"
1022  << "# postFrameworkTransition " << Step::postFrameworkTransition << kTransition << kTransitionInfo
1023  << kTime << "\n";
1024  logFile->write(oss.str());
1025  return;
1026  }
1027 } // namespace edm::service::moduleAlloc
void watchPostModuleGlobalEndLumi(PostModuleGlobalEndLumi::slot_type const &iSlot)
void watchPostModuleConstruction(PostModuleConstruction::slot_type const &iSlot)
void watchPreModuleGlobalBeginRun(PreModuleGlobalBeginRun::slot_type const &iSlot)
void watchPreEvent(PreEvent::slot_type const &iSlot)
void watchPostESModuleRegistration(PostESModuleRegistration::slot_type const &iSlot)
void watchPreAccessInputProcessBlock(PreAccessInputProcessBlock::slot_type const &iSlot)
LuminosityBlockNumber_t luminosityBlock() const
static const TGPicture * info(bool iBackgroundIsBlack)
void watchPostModuleEndProcessBlock(PostModuleEndProcessBlock::slot_type const &iSlot)
void watchPostModuleTransformAcquiring(PostModuleTransformAcquiring::slot_type const &iSlot)
void watchPreESModule(PreESModule::slot_type const &iSlot)
void watchPreModuleEventAcquire(PreModuleEventAcquire::slot_type const &iSlot)
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
void watchPostModuleEndStream(PostModuleEndStream::slot_type const &iSlot)
void watchPreModuleEvent(PreModuleEvent::slot_type const &iSlot)
const ThreadAllocInfo * stopOnThread(int moduleID) const
void watchPreModuleConstruction(PreModuleConstruction::slot_type const &iSlot)
void watchPreModuleEndProcessBlock(PreModuleEndProcessBlock::slot_type const &iSlot)
void watchPreGlobalEndLumi(PreGlobalEndLumi::slot_type const &iSlot)
void watchPostESModuleAcquire(PostESModuleAcquire::slot_type const &iSlot)
ModuleCallingContext const * getTopModuleCallingContext() const
void watchPostEvent(PostEvent::slot_type const &iSlot)
bool startOnThread(int moduleID) const
void watchPreStreamEndRun(PreStreamEndRun::slot_type const &iSlot)
void watchPreSourceConstruction(PreSourceConstruction::slot_type const &iSlot)
void watchPostSourceConstruction(PostSourceConstruction::slot_type const &iSlot)
void watchPostStreamEndLumi(PostStreamEndLumi::slot_type const &iSlot)
void watchPreGlobalBeginLumi(PreGlobalBeginLumi::slot_type const &iSlot)
void watchPostSourceNextTransition(PostSourceNextTransition::slot_type const &iSlot)
void watchPostEndProcessBlock(PostEndProcessBlock::slot_type const &iSlot)
void watchPreEventReadFromSource(PreEventReadFromSource::slot_type const &iSlot)
void watchPreModuleDestruction(PreModuleDestruction::slot_type const &iSlot)
void watchPostModuleEvent(PostModuleEvent::slot_type const &iSlot)
void watchPostModuleGlobalBeginLumi(PostModuleGlobalBeginLumi::slot_type const &iSlot)
void watchPostModuleStreamEndLumi(PostModuleStreamEndLumi::slot_type const &iSlot)
Phase
void watchPostGlobalBeginLumi(PostGlobalBeginLumi::slot_type const &iSlot)
void watchPostModuleStreamBeginRun(PostModuleStreamBeginRun::slot_type const &iSlot)
void watchPostSourceEvent(PostSourceEvent::slot_type const &iSlot)
void watchPreModuleAccessInputProcessBlock(PreModuleAccessInputProcessBlock::slot_type const &iSlot)
void watchPreBeginProcessBlock(PreBeginProcessBlock::slot_type const &iSlot)
void watchPreEndProcessBlock(PreEndProcessBlock::slot_type const &iSlot)
void watchPostModuleTransform(PostModuleTransform::slot_type const &iSlot)
void watchPreModuleBeginStream(PreModuleBeginStream::slot_type const &iSlot)
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
void watchPostESModule(PostESModule::slot_type const &iSlot)
assert(be >=bs)
void watchPreStreamEndLumi(PreStreamEndLumi::slot_type const &iSlot)
void watchPreModuleGlobalEndRun(PreModuleGlobalEndRun::slot_type const &iSlot)
void watchPostModuleWriteRun(PostModuleWriteRun::slot_type const &iSlot)
void watchPostModuleWriteProcessBlock(PostModuleWriteProcessBlock::slot_type const &iSlot)
void watchPostModuleWriteLumi(PostModuleWriteLumi::slot_type const &iSlot)
void beginJob()
Definition: Breakpoints.cc:14
LuminosityBlockNumber_t luminosityBlock() const
Definition: EventID.h:39
auto stream_id(edm::StreamContext const &cs)
auto module_callid(edm::ModuleCallingContext const &mcc)
void moduleIdToLabel(std::ostream &oStream, std::vector< std::string > const &iModuleLabels, char moduleIdSymbol, std::string const &iIDHeader, std::string const &iLabelHeader)
void watchPreOpenFile(PreOpenFile::slot_type const &iSlot)
std::type_info const & value() const
Definition: HCTypeTag.h:45
void watchPostGlobalBeginRun(PostGlobalBeginRun::slot_type const &iSlot)
std::enable_if_t< std::is_integral< T >::value > concatenate(std::ostream &os, T const t)
void watchPreGlobalEndRun(PreGlobalEndRun::slot_type const &iSlot)
void setupFile(std::string const &iFileName, edm::ActivityRegistry &iRegistry, Filter const *iFilter)
unsigned int id() const
void watchPostBeginProcessBlock(PostBeginProcessBlock::slot_type const &iSlot)
void watchEventSetupConfiguration(EventSetupConfiguration::slot_type const &iSlot)
void watchPostSourceRun(PostSourceRun::slot_type const &iSlot)
void watchPostStreamBeginLumi(PostStreamBeginLumi::slot_type const &iSlot)
void watchPreSourceLumi(PreSourceLumi::slot_type const &iSlot)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
void watchPreModuleEventDelayedGet(PreModuleEventDelayedGet::slot_type const &iSlot)
bool keepModuleInfo(int moduleID) const
void watchPreModuleBeginProcessBlock(PreModuleBeginProcessBlock::slot_type const &iSlot)
void watchPostModuleEventAcquire(PostModuleEventAcquire::slot_type const &iSlot)
void watchPreModuleEndJob(PreModuleEndJob::slot_type const &iSlot)
def template(fileName, svg, replaceme="REPLACEME")
Definition: svgfig.py:521
void watchPostGlobalEndLumi(PostGlobalEndLumi::slot_type const &iSlot)
void watchPreSourceNextTransition(PreSourceNextTransition::slot_type const &iSlot)
void watchPreWriteProcessBlock(PreWriteProcessBlock::slot_type const &iSlot)
Transition transition() const
Definition: StreamContext.h:56
void watchPreSourceRun(PreSourceRun::slot_type const &iSlot)
LuminosityBlockIndex const & luminosityBlockIndex() const
Definition: GlobalContext.h:68
void watchPreModuleBeginJob(PreModuleBeginJob::slot_type const &iSlot)
void watchPreModuleTransformAcquiring(PreModuleTransformAcquiring::slot_type const &iSlot)
void watchPostStreamEndRun(PostStreamEndRun::slot_type const &iSlot)
LuminosityBlockID const & luminosityBlockID() const
Definition: GlobalContext.h:66
RunNumber_t run() const
void watchPreModuleGlobalBeginLumi(PreModuleGlobalBeginLumi::slot_type const &iSlot)
void watchPostModuleStreamEndRun(PostModuleStreamEndRun::slot_type const &iSlot)
void watchPostModuleBeginProcessBlock(PostModuleBeginProcessBlock::slot_type const &iSlot)
void watchPreGlobalBeginRun(PreGlobalBeginRun::slot_type const &iSlot)
void watchPreModuleStreamBeginLumi(PreModuleStreamBeginLumi::slot_type const &iSlot)
void watchPreGlobalWriteLumi(PreGlobalWriteLumi::slot_type const &iSlot)
RunNumber_t run() const
Definition: EventID.h:38
void watchPostModuleBeginStream(PostModuleBeginStream::slot_type const &iSlot)
void watchPreModuleTransform(PreModuleTransform::slot_type const &iSlot)
void watchPostAccessInputProcessBlock(PostAccessInputProcessBlock::slot_type const &iSlot)
void watchPostSourceLumi(PostSourceLumi::slot_type const &iSlot)
void watchPostModuleEventDelayedGet(PostModuleEventDelayedGet::slot_type const &iSlot)
void watchPostModuleGlobalEndRun(PostModuleGlobalEndRun::slot_type const &iSlot)
void watchPostGlobalWriteRun(PostGlobalWriteRun::slot_type const &iSlot)
void watchPostModuleStreamBeginLumi(PostModuleStreamBeginLumi::slot_type const &iSlot)
void watchPreModuleStreamEndLumi(PreModuleStreamEndLumi::slot_type const &iSlot)
void watchPreModuleStreamBeginRun(PreModuleStreamBeginRun::slot_type const &iSlot)
void watchPostClearEvent(PostClearEvent::slot_type const &iSlot)
void watchPostGlobalEndRun(PostGlobalEndRun::slot_type const &iSlot)
void watchPreStreamBeginLumi(PreStreamBeginLumi::slot_type const &iSlot)
void watchPostOpenFile(PostOpenFile::slot_type const &iSlot)
tuple msg
Definition: mps_check.py:286
void watchPreModuleEndStream(PreModuleEndStream::slot_type const &iSlot)
void watchPreBeginJob(PreBeginJob::slot_type const &iSlot)
convenience function for attaching to signal
void watchPreModuleWriteRun(PreModuleWriteRun::slot_type const &iSlot)
void watchPreEndJob(PreEndJob::slot_type const &iSlot)
Transition transition() const
Definition: GlobalContext.h:59
auto module_id(edm::ModuleCallingContext const &mcc)
void watchPostStreamBeginRun(PostStreamBeginRun::slot_type const &iSlot)
void watchPreClearEvent(PreClearEvent::slot_type const &iSlot)
Definition: Filter.py:1
void watchPostGlobalWriteLumi(PostGlobalEndLumi::slot_type const &iSlot)
RunIndex const & runIndex() const
Definition: GlobalContext.h:67
HLT enums.
void watchPreStreamBeginRun(PreStreamBeginRun::slot_type const &iSlot)
void watchPostModuleAccessInputProcessBlock(PostModuleAccessInputProcessBlock::slot_type const &iSlot)
void watchPostModuleDestruction(PostModuleDestruction::slot_type const &iSlot)
void watchPreModuleStreamEndRun(PreModuleStreamEndRun::slot_type const &iSlot)
void watchPreModuleWriteProcessBlock(PreModuleWriteProcessBlock::slot_type const &iSlot)
EventID const & eventID() const
Definition: StreamContext.h:60
void watchPostModuleBeginJob(PostModuleBeginJob::slot_type const &iSlot)
void watchPostEventReadFromSource(PostEventReadFromSource::slot_type const &iSlot)
void watchPostModuleGlobalBeginRun(PostModuleGlobalBeginRun::slot_type const &iSlot)
void watchPreModuleWriteLumi(PreModuleWriteLumi::slot_type const &iSlot)
void watchPreSourceEvent(PreSourceEvent::slot_type const &iSlot)
static std::chrono::steady_clock::time_point jobStartTime()
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger table.
std::string const & moduleLabel() const
void watchPreGlobalWriteRun(PreGlobalWriteRun::slot_type const &iSlot)
void watchPostModuleEndJob(PostModuleEndJob::slot_type const &iSlot)
def move(src, dest)
Definition: eostools.py:511
edm::eventsetup::ComponentDescription const * componentDescription() const
EventNumber_t event() const
Definition: EventID.h:40
void watchPreModuleGlobalEndLumi(PreModuleGlobalEndLumi::slot_type const &iSlot)
void watchPreESModuleAcquire(PreESModuleAcquire::slot_type const &iSlot)
void watchPostBeginJob(PostBeginJob::slot_type const &iSlot)
convenience function for attaching to signal
void watchPostWriteProcessBlock(PostWriteProcessBlock::slot_type const &iSlot)