CMS 3D CMS Logo

MessageLogger.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: Services
4 // Class : MessageLogger
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: W. Brown, M. Fischler
10 // Created: Fri Nov 11 16:42:39 CST 2005
11 //
12 // Change log
13 //
14 // 1 mf 5/12/06 In ctor, MessageDrop::debugEnabled is set to a
15 // sensible value in case action happens before modules
16 // are entered. If any modules enable debugs, such
17 // LogDebug messages are not immediately discarded
18 // (though they might be filtered at the server side).
19 //
20 // 2 mf 5/27/06 In preEventProcessing, change the syntax for
21 // runEvent from 1/23 to Run: 1 Event: 23
22 //
23 // 3 mf 6/27/06 PreModuleConstruction and PreSourceConstruction get
24 // correct module name
25 //
26 // 4 mf 6/27/06 Between events the run/event is previous one
27 //
28 // 5 mf 3/30/07 Support for --jobreport option
29 //
30 // 6 mf 6/6/07 Remove the catches for forgiveness of tracked
31 // parameters
32 //
33 // 7 mf 6/19/07 Support for --jobreport option
34 //
35 // 8 wmtan 6/25/07 Enable suppression for sources, just as for modules
36 //
37 // 9 mf 7/25/07 Modify names of the MessageLoggerQ methods, eg MLqLOG
38 //
39 //10 mf 6/18/07 Insert into the PostEndJob a possible SummarizeInJobReport
40 //
41 //11 mf 3/18/09 Fix wrong-sense test establishing anyDebugEnabled_
42 //
43 //12 mf 5/19/09 MessageService PSet Validation
44 //
45 //13 mf 5/26/09 Get parameters without throwing since validation
46 // will point out any problems and throw at that point
47 //
48 //14 mf 7/1/09 Establish module name and set up enables/suppresses
49 // for all possible calls supplying module descriptor
50 //
51 //14 mf 7/1/09 Establish pseudo-module name and set up
52 // enables/suppresses for other calls from framework
53 //15 mf 9/8/09 Clean up erroneous assignments of some callbacks
54 // for specific watch routines (eg PreXYZ called postXYZ)
55 //
56 //16 mf 9/8/09 Eliminate caching by descriptor address during ctor
57 // phases (since addresses are not yet permanent then)
58 //
59 //17 mf 11/2/10 Move preparation of module out to MessageDrop methods
60 // crj which will only be called if a message is actually
61 // issued. Caching of the work is done within MessageDrop
62 // so that case of many messages in a module is still fast.
63 //
64 //18 mf 11/2/10 Eliminated curr_module, since it was only being used
65 // as a local variable for preparation of name (never
66 // used to transfer info between functions) and change
67 // 17 obviates its need.
68 //
69 // 19 mf 11/30/10 Add a messageDrop->snapshot() when establishing
70 // crj module ctors, to cure bug 75836.
71 //
72 // 20 fwyzard 7/06/11 Add support fro dropping LogError messages
73 // on a per-module basis (needed at HLT)
74 
75 // system include files
76 // user include files
77 
79 
82 
85 
87 
97 
98 #include <sstream>
99 #include <limits>
100 #include <algorithm>
101 #include <type_traits>
102 #include <cstring>
103 #include <charconv>
104 #include <cassert>
105 
106 using namespace edm;
107 using namespace edm::service;
108 
109 namespace {
110  char const* const s_globalTransitionNames[] = {
111  "@beginJob", "@beginRun", "@beginLumi", "@endLumi", "@endRun", "@endJob", "@writeRun", "@writeLumi"};
112 
113  char const* const s_streamTransitionNames[] = {
114  "@beginStream",
115  "@streamBeginRun",
116  "@streamBeginLumi",
117  "", //event
118  "@streamEndLumi",
119  "@streamEndRun",
120  "@endStream",
121  };
122 
123  char* fill_buffer(char* p, char*) { return p; }
124 
125  template <typename T, typename... U>
126  char* fill_buffer(char* first, char* last, T value, U... u) {
128  auto v = std::to_chars(first, last, value);
129  assert(v.ec == std::errc{});
130  return fill_buffer(v.ptr, last, std::forward<U>(u)...);
131  } else {
132  auto l = strlen(value);
133  assert(first + l < last);
134  std::copy(value, value + l, first);
135  return fill_buffer(first + l, last, std::forward<U>(u)...);
136  }
137  }
138 
139  template <typename... T>
140  std::string_view fill_buffer(std::array<char, 64>& buffer, T... t) {
141  auto e = fill_buffer(buffer.begin(), buffer.end(), std::forward<T>(t)...);
142  assert(e < buffer.end());
143  *e = 0;
144  return std::string_view(buffer.begin(), e - buffer.begin() + 1);
145  }
146 
147 } // namespace
148 
149 namespace edm {
150  //Forward declare here
151  // Only the MessageLogger::postEVent function is allowed to call this function.
152  // So although the function is defined in MessageSender.cc this is the
153  // only place where we want it declared.
154  void clearLoggedErrorsSummary(unsigned int);
155  void setMaxLoggedErrorsSummaryIndicies(unsigned int iMax);
156 
157  namespace service {
158 
162 
163  //
164  // constructors and destructor
165  //
167  : debugEnabled_(false),
168  messageServicePSetHasBeenValidated_(false),
169  messageServicePSetValidatationResults_(),
170  nonModule_debugEnabled(false),
171  nonModule_infoEnabled(true),
172  nonModule_warningEnabled(true),
173  nonModule_errorEnabled(true) // change log 20
174  {
175  // prepare cfg validation string for later use
177  messageServicePSetValidatationResults_ = validator(iPS); // change log 12
178 
179  typedef std::vector<std::string> vString;
180  vString empty_vString;
181  vString debugModules;
182  vString suppressDebug;
183  vString suppressInfo;
184  vString suppressWarning;
185  vString suppressError; // change log 20
186 
187  try { // change log 13
188  // decide whether a summary should be placed in job report
189  fjrSummaryRequested_ = iPS.getUntrackedParameter<bool>("messageSummaryToJobReport", false);
190 
191  // grab list of debug-enabled modules
192  debugModules = iPS.getUntrackedParameter<vString>("debugModules", empty_vString);
193 
194  // grab lists of suppressLEVEL modules
195  suppressDebug = iPS.getUntrackedParameter<vString>("suppressDebug", empty_vString);
196 
197  suppressInfo = iPS.getUntrackedParameter<vString>("suppressInfo", empty_vString);
198 
199  suppressWarning = iPS.getUntrackedParameter<vString>("suppressWarning", empty_vString);
200 
201  suppressError = // change log 20
202  iPS.getUntrackedParameter<vString>("suppressError", empty_vString);
203  } catch (cms::Exception& e) { // change log 13
204  }
205 
206  // Use these lists to prepare a map to use in tracking suppression
207 
208  // Do suppressDebug first and suppressError last to get proper order
209  for (vString::const_iterator it = suppressDebug.begin(); it != suppressDebug.end(); ++it) {
211  }
212 
213  for (vString::const_iterator it = suppressInfo.begin(); it != suppressInfo.end(); ++it) {
215  }
216 
217  for (vString::const_iterator it = suppressWarning.begin(); it != suppressWarning.end(); ++it) {
219  }
220 
221  for (vString::const_iterator it = suppressError.begin(); // change log 20
222  it != suppressError.end();
223  ++it) {
225  }
226 
227  // set up for tracking whether current module is debug-enabled
228  // (and info-enabled and warning-enabled)
229  if (debugModules.empty()) {
230  anyDebugEnabled_ = false; // change log 11
231  MessageDrop::instance()->debugEnabled = false; // change log 1
232  } else {
233  anyDebugEnabled_ = true; // change log 11
235  // this will be over-ridden when specific modules are entered
236  }
237 
238  // if ( debugModules.empty()) anyDebugEnabled_ = true; // wrong; change log 11
239  for (vString::const_iterator it = debugModules.begin(); it != debugModules.end(); ++it) {
240  if (*it == "*") {
241  everyDebugEnabled_ = true;
242  } else {
243  debugEnabledModules_.insert(*it);
244  }
245  }
246 
247  // change log 7
249  std::string* jm_p = new std::string(jm);
250  MessageLoggerQ::MLqMOD(jm_p); // change log 9
251 
252  MessageLoggerQ::MLqCFG(new ParameterSet(iPS)); // change log 9
253 
254  iRegistry.watchPreallocate([this](edm::service::SystemBounds const& iBounds) {
255  //reserve the proper amount of space to record the transition info
256  this->transitionInfoCache_.resize(iBounds.maxNumberOfStreams() +
258  iBounds.maxNumberOfConcurrentRuns());
261 
263  });
264 
266  iRegistry.watchPreEndJob(this, &MessageLogger::preEndJob);
267  iRegistry.watchPostEndJob(this, &MessageLogger::postEndJob);
268  iRegistry.watchJobFailure(this, &MessageLogger::jobFailure); // change log 14
269 
272  // change log 3
273 
276  // change log 3
277 
280 
283 
286  // change log 14:
287  iRegistry.watchPreSourceRun([this](RunIndex) { preSourceRunLumi(); });
288  iRegistry.watchPostSourceRun([this](RunIndex) { postSourceRunLumi(); });
289  iRegistry.watchPreSourceLumi([this](LuminosityBlockIndex) { preSourceRunLumi(); });
291  iRegistry.watchPreOpenFile(this, &MessageLogger::preFile);
292  iRegistry.watchPostOpenFile(this, &MessageLogger::postFile);
295 
296  // change log 13:
297  // change log 15
302 
307 
316 
325 
326  iRegistry.watchPreEvent(this, &MessageLogger::preEvent);
327  iRegistry.watchPostEvent(this, &MessageLogger::postEvent);
328 
337 
346 
349 
350  MessageDrop* messageDrop = MessageDrop::instance();
351  nonModule_debugEnabled = messageDrop->debugEnabled;
352  nonModule_infoEnabled = messageDrop->infoEnabled;
354  nonModule_errorEnabled = messageDrop->errorEnabled;
355  } // ctor
356 
357  //
358  // Shared helper routines for establishing module name and enabling behavior
359  //
360 
362  const char* whichPhase) // ChangeLog 13, 17
363  {
364  MessageDrop* messageDrop = MessageDrop::instance();
365 
366  // std::cerr << "establishModule( " << desc.moduleName() << ")\n";
367  // Change Log 17
368  messageDrop->setModuleWithPhase(desc.moduleName(), desc.moduleLabel(), desc.id(), whichPhase);
369  // Removed caching per change 17 - caching is now done in MessageDrop.cc
370  // in theContext() method, and only happens if a message is actually issued.
371 
372  if (!anyDebugEnabled_) {
373  messageDrop->debugEnabled = false;
374  } else if (everyDebugEnabled_) {
375  messageDrop->debugEnabled = true;
376  } else {
377  messageDrop->debugEnabled = debugEnabledModules_.count(desc.moduleLabel());
378  }
379 
380  auto it = suppression_levels_.find(desc.moduleLabel());
381  if (it != suppression_levels_.end()) {
382  messageDrop->debugEnabled = messageDrop->debugEnabled && (it->second < ELseverityLevel::ELsev_success);
383  messageDrop->infoEnabled = (it->second < ELseverityLevel::ELsev_info);
384  messageDrop->warningEnabled = (it->second < ELseverityLevel::ELsev_warning);
385  messageDrop->errorEnabled = (it->second < ELseverityLevel::ELsev_error);
386  } else {
387  messageDrop->infoEnabled = true;
388  messageDrop->warningEnabled = true;
389  messageDrop->errorEnabled = true;
390  }
391  } // establishModule
392 
393  void MessageLogger::establishModule(unsigned int transitionIndex,
394  ModuleCallingContext const& mod,
395  const char* whichPhase) // ChangeLog 13, 17
396  {
397  MessageDrop* messageDrop = MessageDrop::instance();
398 
399  // std::cerr << "establishModule( " << desc.moduleName() << ")\n";
400  // Change Log 17
401  auto const desc = mod.moduleDescription();
402  messageDrop->runEvent = transitionInfoCache_[transitionIndex].begin();
403  messageDrop->setModuleWithPhase(desc->moduleName(), desc->moduleLabel(), desc->id(), whichPhase);
404  messageDrop->streamID = transitionIndex;
405  if (transitionIndex >= lumiInfoBegin_) {
407  }
408  // Removed caching per change 17 - caching is now done in MessageDrop.cc
409  // in theContext() method, and only happens if a message is actually issued.
410 
411  if (!anyDebugEnabled_) {
412  messageDrop->debugEnabled = false;
413  } else if (everyDebugEnabled_) {
414  messageDrop->debugEnabled = true;
415  } else {
416  messageDrop->debugEnabled = debugEnabledModules_.count(desc->moduleLabel());
417  }
418 
419  auto it = suppression_levels_.find(desc->moduleLabel());
420  if (it != suppression_levels_.end()) {
421  messageDrop->debugEnabled = messageDrop->debugEnabled && (it->second < ELseverityLevel::ELsev_success);
422  messageDrop->infoEnabled = (it->second < ELseverityLevel::ELsev_info);
423  messageDrop->warningEnabled = (it->second < ELseverityLevel::ELsev_warning);
424  messageDrop->errorEnabled = (it->second < ELseverityLevel::ELsev_error);
425  } else {
426  messageDrop->infoEnabled = true;
427  messageDrop->warningEnabled = true;
428  messageDrop->errorEnabled = true;
429  }
430  } // establishModule
431 
432  void MessageLogger::unEstablishModule(ModuleDescription const& /*unused*/, const char* state) {
433  // std::cerr << "unestablishModule( " << desc.moduleName() << ") "
434  // << "state = " << *state << "\n";
435 
436  MessageDrop* messageDrop = MessageDrop::instance();
437  messageDrop->setSinglet(state); // Change Log 17
438  messageDrop->debugEnabled = nonModule_debugEnabled;
439  messageDrop->infoEnabled = nonModule_infoEnabled;
441  messageDrop->errorEnabled = nonModule_errorEnabled; // change log 20
442  }
443 
444  void MessageLogger::unEstablishModule(ModuleCallingContext const& mod, const char* state) {
445  //Need to reset to what was previously being used on this thread
446  auto previous = mod.previousModuleOnThread();
447  if (previous) {
448  //need to know if we are in a global or stream context
449  auto top = previous->getTopModuleCallingContext();
450  assert(nullptr != top);
451  if (ParentContext::Type::kGlobal == top->type()) {
452  auto globalContext = top->globalContext();
453  assert(nullptr != globalContext);
454  auto tran = globalContext->transition();
457  establishModule(lumiInfoBegin_ + globalContext->luminosityBlockIndex(),
458  *previous,
459  s_globalTransitionNames[static_cast<int>(tran)]);
460  } else {
462  runInfoBegin_ + globalContext->runIndex(), *previous, s_globalTransitionNames[static_cast<int>(tran)]);
463  }
464  } else {
465  auto stream = previous->getStreamContext();
467  stream->streamID().value(), *previous, s_streamTransitionNames[static_cast<int>(stream->transition())]);
468  }
469  } else {
470  MessageDrop* messageDrop = MessageDrop::instance();
472  messageDrop->setSinglet(state); // Change Log 17
473  messageDrop->debugEnabled = nonModule_debugEnabled;
474  messageDrop->infoEnabled = nonModule_infoEnabled;
476  messageDrop->errorEnabled = nonModule_errorEnabled; // change log 20
477  }
478 
479  // std::cerr << "unestablishModule( " << desc.moduleName() << ") "
480  // << "state = " << *state << "\n";
481  }
482 
483  void MessageLogger::establish(const char* state) {
484  MessageDrop* messageDrop = MessageDrop::instance();
485  messageDrop->setSinglet(state); // Change Log 17
486  if (!anyDebugEnabled_) {
487  messageDrop->debugEnabled = false;
488  } else if (everyDebugEnabled_) {
489  messageDrop->debugEnabled = true;
490  } else {
491  messageDrop->debugEnabled = debugEnabledModules_.count(state); // change log 8
492  }
493  std::map<const std::string, ELseverityLevel>::const_iterator it =
494  suppression_levels_.find(state); // change log 8
495  if (it != suppression_levels_.end()) {
496  messageDrop->debugEnabled = messageDrop->debugEnabled && (it->second < ELseverityLevel::ELsev_success);
497  messageDrop->infoEnabled = (it->second < ELseverityLevel::ELsev_info);
498  messageDrop->warningEnabled = (it->second < ELseverityLevel::ELsev_warning);
499  messageDrop->errorEnabled = (it->second < ELseverityLevel::ELsev_error);
500  } else {
501  messageDrop->infoEnabled = true;
502  messageDrop->warningEnabled = true;
503  messageDrop->errorEnabled = true;
504  }
505  }
506 
507  void MessageLogger::unEstablish(const char* state) {
508  MessageDrop::instance()->setSinglet(state); // Change Log 17
509  }
510 
511  //
512  // callbacks that need to establish the module, and their counterparts
513  //
514 
516  if (!messageServicePSetHasBeenValidated_) { // change log 12
519  }
521  }
522  establishModule(desc, "@ctor"); // ChangeLog 16
523  }
525  const ModuleDescription&
526  iDescription) { //it is now guaranteed that this will be called even if the module throws
527  unEstablishModule(iDescription, "AfterModConstruction");
528  }
529 
531  establishModule(desc, "@beginJob"); // ChangeLog 13
532  }
534  unEstablishModule(iDescription, "AfterModBeginJob");
535  }
536 
538  if (!messageServicePSetHasBeenValidated_) { // change log 12
541  }
543  }
544  establishModule(desc, "@sourceConstruction"); // ChangeLog 16
545  }
547  unEstablishModule(iDescription, "AfterSourceConstruction");
548  }
549 
551  ModuleDescription const& desc = *mcc.moduleDescription();
552  establishModule(desc, "@beginStream"); // ChangeLog 13
553  }
555  ModuleDescription const& desc = *mcc.moduleDescription();
556  unEstablishModule(desc, "AfterModBeginStream");
557  }
558 
560  establishModule(stream.streamID().value(),
561  mod,
562  s_streamTransitionNames[static_cast<int>(StreamContext::Transition::kBeginRun)]);
563  }
565  unEstablishModule(mod, "AfterModStreamBeginRun");
566  }
567 
569  establishModule(stream.streamID().value(),
570  mod,
571  s_streamTransitionNames[static_cast<int>(StreamContext::Transition::kBeginLuminosityBlock)]);
572  }
574  unEstablishModule(mod, "AfterModStreamBeginLumi");
575  }
576 
579  stream.streamID().value(), mod, s_streamTransitionNames[static_cast<int>(StreamContext::Transition::kEvent)]);
580  }
581 
583  unEstablishModule(mod, "PostModuleEvent");
584  }
585 
588  stream.streamID().value(), mod, s_streamTransitionNames[static_cast<int>(StreamContext::Transition::kEvent)]);
589  }
590 
592  unEstablishModule(mod, "PostModuleEventAcquire");
593  }
594 
596  establishModule(stream.streamID().value(),
597  mod,
598  s_streamTransitionNames[static_cast<int>(StreamContext::Transition::kEndLuminosityBlock)]);
599  }
601  unEstablishModule(mod, "AfterModStreamEndLumi");
602  }
603 
605  establishModule(stream.streamID().value(),
606  mod,
607  s_streamTransitionNames[static_cast<int>(StreamContext::Transition::kEndRun)]); // ChangeLog 13
608  }
610  unEstablishModule(mod, "AfterModStreamEndRun");
611  }
612 
613  //Global
616  mod,
617  s_globalTransitionNames[static_cast<int>(GlobalContext::Transition::kBeginRun)]);
618  }
620  unEstablishModule(mod, "AfterModGlobalBeginRun");
621  }
622 
625  mod,
626  s_globalTransitionNames[static_cast<int>(GlobalContext::Transition::kBeginLuminosityBlock)]);
627  }
629  unEstablishModule(mod, "AfterModGlobalBeginLumi");
630  }
631 
634  mod,
635  s_globalTransitionNames[static_cast<int>(GlobalContext::Transition::kEndLuminosityBlock)]);
636  }
638  unEstablishModule(mod, "AfterModGlobalEndLumi");
639  }
640 
643  mod,
644  s_globalTransitionNames[static_cast<int>(GlobalContext::Transition::kEndRun)]); // ChangeLog 13
645  }
647  unEstablishModule(mod, "AfterModGlobalEndRun");
648  }
649 
651  ModuleDescription const& desc = *mcc.moduleDescription();
652  establishModule(desc, "@endStream"); // ChangeLog 13
653  }
654 
656  ModuleDescription const& desc = *mcc.moduleDescription();
657  unEstablishModule(desc, "AfterModEndStream");
658  }
659 
661  establishModule(desc, "@endJob"); // ChangeLog 13
662  }
664  unEstablishModule(iDescription, "AfterModEndJob");
665  }
666 
667  //
668  // callbacks that don't know about the module
669  //
670 
672  MessageDrop::instance()->runEvent = "BeforeEvents";
673  MessageDrop::instance()->setSinglet("AfterBeginJob"); // Change Log 17
674  }
675 
678  unEstablish("AfterSource");
679  MessageDrop::instance()->runEvent = "AfterSource";
680  }
683 
684  void MessageLogger::preFile(std::string const&, bool) { establish("file_open"); }
685  void MessageLogger::preFileClose(std::string const&, bool) { establish("file_close"); }
686  void MessageLogger::postFile(std::string const&, bool) { unEstablish("AfterFile"); }
687 
688  void MessageLogger::preEvent(StreamContext const& iContext) {
689  assert(iContext.streamID().value() < transitionInfoCache_.size());
690  auto& buffer = transitionInfoCache_[iContext.streamID().value()];
691  auto const& id = iContext.eventID();
692  auto v = fill_buffer(buffer, "Run: ", id.run(), " Event: ", id.event());
694  edm::MessageDrop::instance()->setSinglet("PreEventProcessing"); // changelog 17
695  // Note - module name had not been set here Similarly in other places where
696  // RunEvent carries the new information; we add setSinglet for module name.
697  }
698 
699  void MessageLogger::postEvent(StreamContext const& iContext) {
700  edm::MessageDrop::instance()->runEvent = "PostProcessEvent";
702  }
703 
704  void MessageLogger::preStreamBeginRun(StreamContext const& iContext) // change log 14
705  {
706  auto& buffer = transitionInfoCache_[iContext.streamID().value()];
707  auto v = fill_buffer(buffer, "Run: ", iContext.eventID().run(), " Stream: ", iContext.streamID().value());
708 
710  edm::MessageDrop::instance()->setSinglet("PreStreamBeginRun"); // changelog 17
711  }
713  edm::MessageDrop::instance()->runEvent = "PostStreamBeginRun";
714  edm::MessageDrop::instance()->setSinglet("PostStreamBeginRun"); // changelog 17
715  // Note - module name had not been set here
716  }
717 
719  auto& buffer = transitionInfoCache_[iContext.streamID().value()];
720  auto v = fill_buffer(buffer, "End Run: ", iContext.eventID().run(), " Stream: ", iContext.streamID().value());
721 
723  edm::MessageDrop::instance()->setSinglet("PreStreamEndRun"); // changelog 17
724  }
725 
727  edm::MessageDrop::instance()->runEvent = "PostStreamEndRun";
728  edm::MessageDrop::instance()->setSinglet("PostStreaEndRun"); // changelog 17
729  }
730 
732  auto& buffer = transitionInfoCache_[iContext.streamID().value()];
733  auto const& id = iContext.eventID();
734  auto v = fill_buffer(
735  buffer, "Run: ", id.run(), " Lumi: ", id.luminosityBlock(), " Stream: ", iContext.streamID().value());
737  edm::MessageDrop::instance()->setSinglet("PreStreamBeginLumi"); // changelog 17
738  }
739 
741  edm::MessageDrop::instance()->runEvent = "PostStreamBeginLumi";
742  edm::MessageDrop::instance()->setSinglet("PostStreamBeginLumi"); // changelog 17
743  }
744 
746  auto& buffer = transitionInfoCache_[iContext.streamID().value()];
747  auto const& id = iContext.eventID();
748  auto v = fill_buffer(
749  buffer, "Run: ", id.run(), " Lumi: ", id.luminosityBlock(), " Stream: ", iContext.streamID().value());
750 
752  edm::MessageDrop::instance()->setSinglet("PreStreamEndLumi"); // changelog 17
753  }
755  edm::MessageDrop::instance()->runEvent = "PostStreamEndLumi";
756  edm::MessageDrop::instance()->setSinglet("PostStreamEndLumi"); // changelog 17
757  }
758 
759  void MessageLogger::preGlobalBeginRun(GlobalContext const& iContext) // change log 14
760  {
761  auto& buffer = transitionInfoCache_[runInfoBegin_ + iContext.runIndex()];
762  auto v = fill_buffer(buffer, "Run: ", iContext.luminosityBlockID().run());
764  edm::MessageDrop::instance()->setSinglet("PreGlobalBeginRun"); // changelog 17
765  }
767  edm::MessageDrop::instance()->runEvent = "PostGlobalBeginRun";
768  edm::MessageDrop::instance()->setSinglet("PostGlobalBeginRun"); // changelog 17
769  // Note - module name had not been set here
770  }
771 
772  void MessageLogger::prePathEvent(StreamContext const& stream, PathContext const& iPath) // change log 14
773  {
774  auto messageDrop = edm::MessageDrop::instance();
775  messageDrop->runEvent = transitionInfoCache_[stream.streamID().value()].begin();
776  messageDrop->setPath("PreProcPath ", iPath.pathName());
777  // change log 17
778  }
779 
781  edm::MessageDrop::instance()->setSinglet("PostProcessPath"); // changelog 17
782  }
783 
785  auto& buffer = transitionInfoCache_[runInfoBegin_ + iContext.runIndex()];
786  auto v = fill_buffer(buffer, "End Run: ", iContext.luminosityBlockID().run());
788  edm::MessageDrop::instance()->setSinglet("PreGlobalEndRun"); // changelog 17
789  }
790 
792  edm::MessageDrop::instance()->runEvent = "PostGlobalEndRun";
793  edm::MessageDrop::instance()->setSinglet("PostGlobalEndRun"); // changelog 17
794  }
795 
797  auto& buffer = transitionInfoCache_[lumiInfoBegin_ + iContext.luminosityBlockIndex()];
798  auto const& id = iContext.luminosityBlockID();
799  auto v = fill_buffer(buffer, "Run: ", id.run(), " Lumi: ", id.luminosityBlock());
801  edm::MessageDrop::instance()->setSinglet("PreGlobalBeginLumi"); // changelog 17
802  }
803 
805  edm::MessageDrop::instance()->runEvent = "PostGlobalBeginLumi";
806  edm::MessageDrop::instance()->setSinglet("PostGlobalBeginLumi"); // changelog 17
807  }
808 
810  auto& buffer = transitionInfoCache_[lumiInfoBegin_ + iContext.luminosityBlockIndex()];
811  auto const& id = iContext.luminosityBlockID();
812  auto v = fill_buffer(buffer, "Run: ", id.run(), " Lumi: ", id.luminosityBlock());
814  edm::MessageDrop::instance()->setSinglet("PreGlobalEndLumi"); // changelog 17
815  }
817  edm::MessageDrop::instance()->runEvent = "PostGlobalEndLumi";
818  edm::MessageDrop::instance()->setSinglet("PostGlobalEndLumi"); // changelog 17
819  }
820 
822  edm::MessageDrop::instance()->runEvent = "EndJob";
823  edm::MessageDrop::instance()->setSinglet("EndJob"); // changelog
824  }
825 
827  SummarizeInJobReport(); // Put summary info into Job Rep // change log 10
828  MessageLoggerQ::MLqSUM(); // trigger summary info. // change log 9
829  }
830 
832  MessageDrop* messageDrop = MessageDrop::instance();
833  messageDrop->setSinglet("jobFailure");
834  SummarizeInJobReport(); // Put summary info into Job Rep // change log 10
835  MessageLoggerQ::MLqSUM(); // trigger summary info. // change log 9
836  }
837 
838  //
839  // Other methods
840  //
841 
843  if (fjrSummaryRequested_) {
844  std::map<std::string, double>* smp = new std::map<std::string, double>();
846  Service<JobReport> reportSvc;
847  reportSvc->reportMessageInfo(*smp);
848  delete smp;
849  }
850  }
851 
852  } // end of namespace service
853 } // end of namespace edm
void preModuleStreamEndLumi(StreamContext const &, ModuleCallingContext const &)
void preModuleEvent(StreamContext const &, ModuleCallingContext const &)
RunNumber_t run() const
Definition: EventID.h:38
std::vector< std::array< char, 64 > > transitionInfoCache_
void watchPostModuleGlobalEndLumi(PostModuleGlobalEndLumi::slot_type const &iSlot)
void watchPostModuleConstruction(PostModuleConstruction::slot_type const &iSlot)
std::string const & pathName() const
Definition: PathContext.h:30
void watchPreModuleGlobalBeginRun(PreModuleGlobalBeginRun::slot_type const &iSlot)
T getUntrackedParameter(std::string const &, T const &) const
void postModuleEvent(StreamContext const &, ModuleCallingContext const &)
void preModuleEndJob(ModuleDescription const &)
void postGlobalEndRun(GlobalContext const &)
void watchPreEvent(PreEvent::slot_type const &iSlot)
void postStreamBeginLumi(StreamContext const &)
void preStreamEndLumi(StreamContext const &)
void preStreamBeginLumi(StreamContext const &)
void preModuleGlobalBeginLumi(GlobalContext const &, ModuleCallingContext const &)
void watchPrePathEvent(PrePathEvent::slot_type const &iSlot)
void watchPreallocate(Preallocate::slot_type const &iSlot)
void postModuleConstruction(ModuleDescription const &)
void watchPreModuleEventAcquire(PreModuleEventAcquire::slot_type const &iSlot)
void watchPostEndJob(PostEndJob::slot_type const &iSlot)
ModuleCallingContext const * getTopModuleCallingContext() const
void postModuleGlobalBeginLumi(GlobalContext const &, ModuleCallingContext const &)
void watchPostModuleEndStream(PostModuleEndStream::slot_type const &iSlot)
void watchPreModuleEvent(PreModuleEvent::slot_type const &iSlot)
void watchPreModuleConstruction(PreModuleConstruction::slot_type const &iSlot)
void preModuleEventAcquire(StreamContext const &, ModuleCallingContext const &)
void postGlobalBeginLumi(GlobalContext const &)
void watchPreGlobalEndLumi(PreGlobalEndLumi::slot_type const &iSlot)
void preModuleBeginJob(ModuleDescription const &)
void postModuleGlobalBeginRun(GlobalContext const &, ModuleCallingContext const &)
void watchPostEvent(PostEvent::slot_type const &iSlot)
void postGlobalBeginRun(GlobalContext const &)
LuminosityBlockID const & luminosityBlockID() const
Definition: GlobalContext.h:55
void watchPreStreamEndRun(PreStreamEndRun::slot_type const &iSlot)
void watchPreSourceConstruction(PreSourceConstruction::slot_type const &iSlot)
void setModuleWithPhase(std::string const &name, std::string const &label, unsigned int moduleID, const char *phase)
Definition: MessageDrop.cc:177
void watchPostSourceConstruction(PostSourceConstruction::slot_type const &iSlot)
static MessageDrop * instance()
Definition: MessageDrop.cc:59
void watchPreGlobalBeginLumi(PreGlobalBeginLumi::slot_type const &iSlot)
void watchPostStreamEndLumi(PostStreamEndLumi::slot_type const &iSlot)
void preGlobalEndLumi(GlobalContext const &)
std::string const & moduleName() const
void watchPostPathEvent(PostPathEvent::slot_type const &iSlot)
void watchPostModuleEvent(PostModuleEvent::slot_type const &iSlot)
void watchPostModuleGlobalBeginLumi(PostModuleGlobalBeginLumi::slot_type const &iSlot)
unsigned int value() const
Definition: RunIndex.h:44
void watchPostModuleStreamEndLumi(PostModuleStreamEndLumi::slot_type const &iSlot)
static std::string jobMode
Definition: MessageDrop.h:108
void watchPostGlobalBeginLumi(PostGlobalBeginLumi::slot_type const &iSlot)
void watchPostModuleStreamBeginRun(PostModuleStreamBeginRun::slot_type const &iSlot)
void watchPostSourceEvent(PostSourceEvent::slot_type const &iSlot)
void preSourceConstruction(ModuleDescription const &)
MessageLogger(ParameterSet const &, ActivityRegistry &)
void clearLoggedErrorsSummary(unsigned int iStreamID)
void establishModule(const ModuleDescription &desc, const char *whichPhase)
void setMaxLoggedErrorsSummaryIndicies(unsigned int iMax)
void watchPreModuleBeginStream(PreModuleBeginStream::slot_type const &iSlot)
void watchPreStreamEndLumi(PreStreamEndLumi::slot_type const &iSlot)
void preGlobalBeginLumi(GlobalContext const &)
std::string const & moduleLabel() const
void watchPreModuleGlobalEndRun(PreModuleGlobalEndRun::slot_type const &iSlot)
void postModuleEventAcquire(StreamContext const &, ModuleCallingContext const &)
void postStreamEndRun(StreamContext const &)
void setSinglet(const char *sing)
Definition: MessageDrop.cc:190
void preModuleBeginStream(StreamContext const &, ModuleCallingContext const &)
void preGlobalBeginRun(GlobalContext const &)
void postModuleGlobalEndLumi(GlobalContext const &, ModuleCallingContext const &)
void watchJobFailure(JobFailure::slot_type const &iSlot)
convenience function for attaching to signal
RunIndex const & runIndex() const
Definition: GlobalContext.h:56
unsigned int maxNumberOfStreams() const
Definition: SystemBounds.h:35
void watchPreOpenFile(PreOpenFile::slot_type const &iSlot)
void preModuleGlobalEndRun(GlobalContext const &, ModuleCallingContext const &)
void watchPostGlobalBeginRun(PostGlobalBeginRun::slot_type const &iSlot)
void postEvent(StreamContext const &)
void watchPostCloseFile(PostCloseFile::slot_type const &iSlot)
void watchPreGlobalEndRun(PreGlobalEndRun::slot_type const &iSlot)
void postModuleStreamEndRun(StreamContext const &, ModuleCallingContext const &)
unsigned int streamID
Definition: MessageDrop.h:102
void watchPostSourceRun(PostSourceRun::slot_type const &iSlot)
LuminosityBlockIndex const & luminosityBlockIndex() const
Definition: GlobalContext.h:57
void preFileClose(std::string const &, bool)
void watchPostStreamBeginLumi(PostStreamBeginLumi::slot_type const &iSlot)
static void MLqCFG(ParameterSet *p)
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
ModuleDescription const * moduleDescription() const
void prePathEvent(StreamContext const &, PathContext const &)
RunNumber_t run() const
void watchPostModuleEventAcquire(PostModuleEventAcquire::slot_type const &iSlot)
void watchPreModuleEndJob(PreModuleEndJob::slot_type const &iSlot)
unsigned int value() const
void preModuleStreamEndRun(StreamContext const &, ModuleCallingContext const &)
void watchPostGlobalEndLumi(PostGlobalEndLumi::slot_type const &iSlot)
Definition: value.py:1
void postModuleStreamBeginRun(StreamContext const &, ModuleCallingContext const &)
void watchPreSourceRun(PreSourceRun::slot_type const &iSlot)
void preModuleConstruction(ModuleDescription const &)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void postStreamBeginRun(StreamContext const &)
void watchPreModuleBeginJob(PreModuleBeginJob::slot_type const &iSlot)
void watchPostStreamEndRun(PostStreamEndRun::slot_type const &iSlot)
void postModuleStreamEndLumi(StreamContext const &, ModuleCallingContext const &)
void watchPreModuleGlobalBeginLumi(PreModuleGlobalBeginLumi::slot_type const &iSlot)
void watchPostModuleStreamEndRun(PostModuleStreamEndRun::slot_type const &iSlot)
StreamID const & streamID() const
Definition: StreamContext.h:54
void watchPreGlobalBeginRun(PreGlobalBeginRun::slot_type const &iSlot)
void watchPreModuleStreamBeginLumi(PreModuleStreamBeginLumi::slot_type const &iSlot)
void postStreamEndLumi(StreamContext const &)
void postPathEvent(StreamContext const &, PathContext const &, HLTPathStatus const &)
void postModuleBeginStream(StreamContext const &, ModuleCallingContext const &)
void watchPostModuleBeginStream(PostModuleBeginStream::slot_type const &iSlot)
std::map< std::string, ELseverityLevel > suppression_levels_
unsigned int value() const
Definition: StreamID.h:42
unsigned int maxNumberOfConcurrentLuminosityBlocks() const
Definition: SystemBounds.h:37
std::set< std::string > debugEnabledModules_
void watchPostSourceLumi(PostSourceLumi::slot_type const &iSlot)
void watchPreCloseFile(PreCloseFile::slot_type const &iSlot)
void watchPostModuleGlobalEndRun(PostModuleGlobalEndRun::slot_type const &iSlot)
void establish(const char *whichPhase)
void watchPostModuleStreamBeginLumi(PostModuleStreamBeginLumi::slot_type const &iSlot)
void postSourceConstruction(ModuleDescription const &)
void watchPreModuleStreamEndLumi(PreModuleStreamEndLumi::slot_type const &iSlot)
void watchPreModuleStreamBeginRun(PreModuleStreamBeginRun::slot_type const &iSlot)
static void MLqJRS(std::map< std::string, double > *sum_p)
static void MLqMOD(std::string *jm)
void reportMessageInfo(std::map< std::string, double > const &messageData)
Definition: JobReport.cc:555
void unEstablishModule(const ModuleDescription &desc, const char *whichPhase)
void watchPostGlobalEndRun(PostGlobalEndRun::slot_type const &iSlot)
void watchPreStreamBeginLumi(PreStreamBeginLumi::slot_type const &iSlot)
void watchPostOpenFile(PostOpenFile::slot_type const &iSlot)
void watchPreModuleEndStream(PreModuleEndStream::slot_type const &iSlot)
void postModuleEndJob(ModuleDescription const &)
void preStreamEndRun(StreamContext const &)
void watchPreEndJob(PreEndJob::slot_type const &iSlot)
void watchPostStreamBeginRun(PostStreamBeginRun::slot_type const &iSlot)
void unEstablish(const char *whichPhase)
ModuleCallingContext const * previousModuleOnThread() const
HLT enums.
void postModuleBeginJob(ModuleDescription const &)
void watchPreStreamBeginRun(PreStreamBeginRun::slot_type const &iSlot)
void preModuleEndStream(StreamContext const &, ModuleCallingContext const &)
void watchPreModuleStreamEndRun(PreModuleStreamEndRun::slot_type const &iSlot)
static void SummarizeInJobReport()
void watchPostModuleBeginJob(PostModuleBeginJob::slot_type const &iSlot)
std::string_view runEvent
Definition: MessageDrop.h:101
void watchPostModuleGlobalBeginRun(PostModuleGlobalBeginRun::slot_type const &iSlot)
unsigned int maxNumberOfConcurrentRuns() const
Definition: SystemBounds.h:36
void preModuleGlobalEndLumi(GlobalContext const &, ModuleCallingContext const &)
void preFile(std::string const &, bool)
void postGlobalEndLumi(GlobalContext const &)
static void MLqSUM()
void postModuleStreamBeginLumi(StreamContext const &, ModuleCallingContext const &)
EventID const & eventID() const
Definition: StreamContext.h:59
void watchPreSourceEvent(PreSourceEvent::slot_type const &iSlot)
void postModuleGlobalEndRun(GlobalContext const &, ModuleCallingContext const &)
void preModuleStreamBeginLumi(StreamContext const &, ModuleCallingContext const &)
T first(std::pair< T, U > const &p)
void preGlobalEndRun(GlobalContext const &)
void preEvent(StreamContext const &)
long double T
std::string messageServicePSetValidatationResults_
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void watchPostModuleEndJob(PostModuleEndJob::slot_type const &iSlot)
void preModuleGlobalBeginRun(GlobalContext const &, ModuleCallingContext const &)
#define constexpr
void preStreamBeginRun(StreamContext const &)
void postModuleEndStream(StreamContext const &, ModuleCallingContext const &)
void watchPreModuleGlobalEndLumi(PreModuleGlobalEndLumi::slot_type const &iSlot)
unsigned int id() const
void preModuleStreamBeginRun(StreamContext const &, ModuleCallingContext const &)
void watchPostBeginJob(PostBeginJob::slot_type const &iSlot)
convenience function for attaching to signal
void postFile(std::string const &, bool)