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 
99 #include <sstream>
100 #include <limits>
101 
102 using namespace edm;
103 using namespace edm::service;
104 
105 namespace {
106  char const* const s_globalTransitionNames[] = {
107  "@beginJob",
108  "@beginRun",
109  "@beginLumi",
110  "@endLumi",
111  "@endRun",
112  "@endJob",
113  "@writeRun",
114  "@writeLumi"
115  };
116 
117  char const* const s_streamTransitionNames[] = {
118  "@beginStream",
119  "@streamBeginRun",
120  "@streamBeginLumi",
121  "",//event
122  "@streamEndLumi",
123  "@streamEndRun",
124  "@endStream",
125  };
126 }
127 
128 namespace edm {
129  //Forward declare here
130  // Only the MessageLogger::postEVent function is allowed to call this function.
131  // So although the function is defined in MessageSender.cc this is the
132  // only place where we want it declared.
133  void clearLoggedErrorsSummary(unsigned int);
134  void setMaxLoggedErrorsSummaryIndicies(unsigned int iMax);
135 
136  namespace service {
137 
141 
142  //
143  // constructors and destructor
144  //
147  , ActivityRegistry & iRegistry
148  )
149  : debugEnabled_(false)
150  , messageServicePSetHasBeenValidated_(false)
151  , messageServicePSetValidatationResults_()
152  , nonModule_debugEnabled(false)
153  , nonModule_infoEnabled(true)
154  , nonModule_warningEnabled(true)
155  , nonModule_errorEnabled(true) // change log 20
156  {
157  // prepare cfg validation string for later use
159  messageServicePSetValidatationResults_ = validator(iPS); // change log 12
160 
161  typedef std::vector<std::string> vString;
162  vString empty_vString;
163  vString debugModules;
164  vString suppressDebug;
165  vString suppressInfo;
166  vString suppressWarning;
167  vString suppressError; // change log 20
168 
169  try { // change log 13
170  // decide whether a summary should be placed in job report
172  iPS.getUntrackedParameter<bool>("messageSummaryToJobReport", false);
173 
174  // grab list of debug-enabled modules
175  debugModules =
176  iPS.getUntrackedParameter<vString>("debugModules", empty_vString);
177 
178  // grab lists of suppressLEVEL modules
179  suppressDebug =
180  iPS.getUntrackedParameter<vString>("suppressDebug", empty_vString);
181 
182  suppressInfo =
183  iPS.getUntrackedParameter<vString>("suppressInfo", empty_vString);
184 
185  suppressWarning =
186  iPS.getUntrackedParameter<vString>("suppressWarning", empty_vString);
187 
188  suppressError = // change log 20
189  iPS.getUntrackedParameter<vString>("suppressError", empty_vString);
190  } catch (cms::Exception& e) { // change log 13
191  }
192 
193  // Use these lists to prepare a map to use in tracking suppression
194 
195  // Do suppressDebug first and suppressError last to get proper order
196  for( vString::const_iterator it = suppressDebug.begin();
197  it != suppressDebug.end(); ++it ) {
199  }
200 
201  for( vString::const_iterator it = suppressInfo.begin();
202  it != suppressInfo.end(); ++it ) {
204  }
205 
206  for( vString::const_iterator it = suppressWarning.begin();
207  it != suppressWarning.end(); ++it ) {
209  }
210 
211  for( vString::const_iterator it = suppressError.begin(); // change log 20
212  it != suppressError.end(); ++it ) {
214  }
215 
216  // set up for tracking whether current module is debug-enabled
217  // (and info-enabled and warning-enabled)
218  if ( debugModules.empty()) {
219  anyDebugEnabled_ = false; // change log 11
220  MessageDrop::instance()->debugEnabled = false; // change log 1
221  } else {
222  anyDebugEnabled_ = true; // change log 11
224  // this will be over-ridden when specific modules are entered
225  }
226 
227  // if ( debugModules.empty()) anyDebugEnabled_ = true; // wrong; change log 11
228  for( vString::const_iterator it = debugModules.begin();
229  it != debugModules.end(); ++it ) {
230  if (*it == "*") {
231  everyDebugEnabled_ = true;
232  } else {
233  debugEnabledModules_.insert(*it);
234  }
235  }
236 
237  // change log 7
239  std::string * jm_p = new std::string(jm);
240  MessageLoggerQ::MLqMOD( jm_p ); // change log 9
241 
242  MessageLoggerQ::MLqCFG( new ParameterSet(iPS) ); // change log 9
243 
244  iRegistry.watchPreallocate([this](edm::service::SystemBounds const& iBounds){
245  //reserve the proper amount of space to record the transition info
246  this->transitionInfoCache_.resize(iBounds.maxNumberOfStreams()
248  +iBounds.maxNumberOfConcurrentRuns());
251 
253  });
254 
257  iRegistry.watchJobFailure(this,&MessageLogger::jobFailure); // change log 14
258 
261  // change log 3
262 
265  // change log 3
266 
269 
272  // change log 14:
277  iRegistry.watchPreOpenFile(this,&MessageLogger::preFile);
281 
282  // change log 13:
283  // change log 15
288 
293 
302 
311 
312  iRegistry.watchPreEvent(this,&MessageLogger::preEvent);
313  iRegistry.watchPostEvent(this,&MessageLogger::postEvent);
314 
323 
332 
335 
336 
337  MessageDrop* messageDrop = MessageDrop::instance();
338  nonModule_debugEnabled = messageDrop->debugEnabled;
339  nonModule_infoEnabled = messageDrop->infoEnabled;
341  nonModule_errorEnabled = messageDrop->errorEnabled;
342  } // ctor
343 
344  //
345  // Shared helper routines for establishing module name and enabling behavior
346  //
347 
348  void
350  const char * whichPhase) // ChangeLog 13, 17
351  {
352  MessageDrop* messageDrop = MessageDrop::instance();
353 
354  // std::cerr << "establishModule( " << desc.moduleName() << ")\n";
355  // Change Log 17
356  messageDrop->setModuleWithPhase(desc.moduleName(), desc.moduleLabel(),
357  desc.id(), whichPhase );
358  // Removed caching per change 17 - caching is now done in MessageDrop.cc
359  // in theContext() method, and only happens if a message is actually issued.
360 
361  if (!anyDebugEnabled_) {
362  messageDrop->debugEnabled = false;
363  } else if (everyDebugEnabled_) {
364  messageDrop->debugEnabled = true;
365  } else {
366  messageDrop->debugEnabled =
367  debugEnabledModules_.count(desc.moduleLabel());
368  }
369 
370  auto it = suppression_levels_.find(desc.moduleLabel());
371  if ( it != suppression_levels_.end() ) {
372  messageDrop->debugEnabled = messageDrop->debugEnabled
373  && (it->second < ELseverityLevel::ELsev_success );
374  messageDrop->infoEnabled = (it->second < ELseverityLevel::ELsev_info );
375  messageDrop->warningEnabled = (it->second < ELseverityLevel::ELsev_warning );
376  messageDrop->errorEnabled = (it->second < ELseverityLevel::ELsev_error );
377  } else {
378  messageDrop->infoEnabled = true;
379  messageDrop->warningEnabled = true;
380  messageDrop->errorEnabled = true;
381  }
382  } // establishModule
383 
384  void
385  MessageLogger::establishModule(unsigned int transitionIndex,
386  ModuleCallingContext const & mod,
387  const char * whichPhase) // ChangeLog 13, 17
388  {
389  MessageDrop* messageDrop = MessageDrop::instance();
390 
391  // std::cerr << "establishModule( " << desc.moduleName() << ")\n";
392  // Change Log 17
393  auto const desc = mod.moduleDescription();
394  messageDrop->runEvent = transitionInfoCache_[transitionIndex];
395  messageDrop->setModuleWithPhase(desc->moduleName(), desc->moduleLabel(),
396  desc->id(), whichPhase );
397  messageDrop->streamID = transitionIndex;
398  if(transitionIndex>= lumiInfoBegin_) {
400  }
401  // Removed caching per change 17 - caching is now done in MessageDrop.cc
402  // in theContext() method, and only happens if a message is actually issued.
403 
404  if (!anyDebugEnabled_) {
405  messageDrop->debugEnabled = false;
406  } else if (everyDebugEnabled_) {
407  messageDrop->debugEnabled = true;
408  } else {
409  messageDrop->debugEnabled =
410  debugEnabledModules_.count(desc->moduleLabel());
411  }
412 
413  auto it = suppression_levels_.find(desc->moduleLabel());
414  if ( it != suppression_levels_.end() ) {
415  messageDrop->debugEnabled = messageDrop->debugEnabled
416  && (it->second < ELseverityLevel::ELsev_success );
417  messageDrop->infoEnabled = (it->second < ELseverityLevel::ELsev_info );
418  messageDrop->warningEnabled = (it->second < ELseverityLevel::ELsev_warning );
419  messageDrop->errorEnabled = (it->second < ELseverityLevel::ELsev_error );
420  } else {
421  messageDrop->infoEnabled = true;
422  messageDrop->warningEnabled = true;
423  messageDrop->errorEnabled = true;
424  }
425  } // establishModule
426 
427 
428  void
430  const char* state)
431  {
432  // std::cerr << "unestablishModule( " << desc.moduleName() << ") "
433  // << "state = " << *state << "\n";
434 
435  MessageDrop* messageDrop = MessageDrop::instance();
436  messageDrop->setSinglet( state ); // Change Log 17
437  messageDrop->debugEnabled = nonModule_debugEnabled;
438  messageDrop->infoEnabled = nonModule_infoEnabled;
440  messageDrop->errorEnabled = nonModule_errorEnabled; // change log 20
441  }
442 
443  void
445  const char* state)
446  {
447  //Need to reset to what was previously being used on this thread
448  auto previous = mod.previousModuleOnThread();
449  if(previous) {
450  //need to know if we are in a global or stream context
451  auto top = previous->getTopModuleCallingContext();
452  assert(nullptr != top);
453  if (ParentContext::Type::kGlobal == top->type()) {
454  auto globalContext = top->globalContext();
455  assert(nullptr != globalContext);
456  auto tran = globalContext->transition();
459  establishModule(lumiInfoBegin_+globalContext->luminosityBlockIndex(),
460  *previous,s_globalTransitionNames[static_cast<int>(tran)]);
461  } else {
462  establishModule(runInfoBegin_+globalContext->runIndex(),
463  *previous,s_globalTransitionNames[static_cast<int>(tran)]);
464  }
465  } else {
466  auto stream = previous->getStreamContext();
467  establishModule(stream->streamID().value(),*previous,s_streamTransitionNames[static_cast<int>(stream->transition())]);
468  }
469  } else {
470 
471  MessageDrop* messageDrop = MessageDrop::instance();
473  messageDrop->setSinglet( state ); // Change Log 17
474  messageDrop->debugEnabled = nonModule_debugEnabled;
475  messageDrop->infoEnabled = nonModule_infoEnabled;
477  messageDrop->errorEnabled = nonModule_errorEnabled; // change log 20
478  }
479 
480  // std::cerr << "unestablishModule( " << desc.moduleName() << ") "
481  // << "state = " << *state << "\n";
482 
483  }
484 
485  void
486  MessageLogger::establish(const char* state)
487  {
488  MessageDrop* messageDrop = MessageDrop::instance();
489  messageDrop->setSinglet( state ); // Change Log 17
490  if (!anyDebugEnabled_) {
491  messageDrop->debugEnabled = false;
492  } else if (everyDebugEnabled_) {
493  messageDrop->debugEnabled = true;
494  } else {
495  messageDrop->debugEnabled =
496  debugEnabledModules_.count(state); // change log 8
497  }
498  std::map<const std::string,ELseverityLevel>::const_iterator it =
499  suppression_levels_.find(state); // change log 8
500  if ( it != suppression_levels_.end() ) {
501  messageDrop->debugEnabled = messageDrop->debugEnabled
502  && (it->second < ELseverityLevel::ELsev_success );
503  messageDrop->infoEnabled = (it->second < ELseverityLevel::ELsev_info );
504  messageDrop->warningEnabled = (it->second < ELseverityLevel::ELsev_warning );
505  messageDrop->errorEnabled = (it->second < ELseverityLevel::ELsev_error );
506  } else {
507  messageDrop->infoEnabled = true;
508  messageDrop->warningEnabled = true;
509  messageDrop->errorEnabled = true;
510  }
511  }
512 
513  void
514  MessageLogger::unEstablish(const char* state)
515  {
516  MessageDrop::instance()->setSinglet( state ); // Change Log 17
517  }
518 
519  //
520  // callbacks that need to establish the module, and their counterparts
521  //
522 
523  void
525  {
526  if (!messageServicePSetHasBeenValidated_) { // change log 12
528  throw ( edm::Exception
531  ) );
532  }
534  }
535  establishModule (desc,"@ctor"); // ChangeLog 16
536  }
538  { //it is now guaranteed that this will be called even if the module throws
539  unEstablishModule (iDescription, "AfterModConstruction"); }
540 
541  void
543  {
544  establishModule (desc,"@beginJob"); // ChangeLog 13
545  }
547  { unEstablishModule (iDescription, "AfterModBeginJob"); }
548 
549  void
551  {
552  if (!messageServicePSetHasBeenValidated_) { // change log 12
554  throw ( edm::Exception
557  ) );
558  }
560  }
561  establishModule(desc,"@sourceConstruction"); // ChangeLog 16
562  }
564  { unEstablishModule (iDescription, "AfterSourceConstruction"); }
565 
566  void
568  {
569  ModuleDescription const& desc = *mcc.moduleDescription();
570  establishModule (desc,"@beginStream"); // ChangeLog 13
571  }
573  {
574  ModuleDescription const& desc = *mcc.moduleDescription();
575  unEstablishModule (desc, "AfterModBeginStream");
576  }
577 
578  void
580  {
581  establishModule (stream.streamID().value(),mod,
582  s_streamTransitionNames[static_cast<int>(StreamContext::Transition::kBeginRun)]);
583  }
585  { unEstablishModule (mod, "AfterModStreamBeginRun"); }
586 
587  void
589  {
590  establishModule (stream.streamID().value(),mod,
591  s_streamTransitionNames[static_cast<int>(StreamContext::Transition::kBeginLuminosityBlock)]);
592  }
594  { unEstablishModule (mod, "AfterModStreamBeginLumi"); }
595 
596  void
598  {
599  establishModule (stream.streamID().value(),mod,
600  s_streamTransitionNames[static_cast<int>(StreamContext::Transition::kEvent)]);
601  }
602 
604  {
605  unEstablishModule(mod,"PostModuleEvent");
606  }
607 
608  void
610  {
611  establishModule (stream.streamID().value(),mod,
612  s_streamTransitionNames[static_cast<int>(StreamContext::Transition::kEndLuminosityBlock)]);
613  }
615  { unEstablishModule (mod, "AfterModStreamEndLumi"); }
616 
617  void
619  {
620  establishModule (stream.streamID().value(),mod,
621  s_streamTransitionNames[static_cast<int>(StreamContext::Transition::kEndRun)]); // ChangeLog 13
622  }
624  { unEstablishModule (mod, "AfterModStreamEndRun"); }
625 
626  //Global
627  void
629  {
631  s_globalTransitionNames[static_cast<int>(GlobalContext::Transition::kBeginRun)]);
632  }
634  { unEstablishModule (mod, "AfterModGlobalBeginRun"); }
635 
636  void
638  {
640  s_globalTransitionNames[static_cast<int>(GlobalContext::Transition::kBeginLuminosityBlock)]);
641  }
643  { unEstablishModule (mod, "AfterModGlobalBeginLumi"); }
644 
645  void
647  {
649  s_globalTransitionNames[static_cast<int>(GlobalContext::Transition::kEndLuminosityBlock)]);
650  }
652  { unEstablishModule (mod, "AfterModGlobalEndLumi"); }
653 
654  void
656  {
658  s_globalTransitionNames[static_cast<int>(GlobalContext::Transition::kEndRun)]); // ChangeLog 13
659  }
661  { unEstablishModule (mod, "AfterModGlobalEndRun"); }
662 
663  void
665  {
666  ModuleDescription const& desc = *mcc.moduleDescription();
667  establishModule (desc,"@endStream"); // ChangeLog 13
668  }
669 
671  {
672  ModuleDescription const& desc = *mcc.moduleDescription();
673  unEstablishModule (desc, "AfterModEndStream");
674  }
675 
676  void
678  {
679  establishModule (desc,"@endJob"); // ChangeLog 13
680  }
682  { unEstablishModule (iDescription, "AfterModEndJob"); }
683 
684  //
685  // callbacks that don't know about the module
686  //
687 
688  void
690  {
691  MessageDrop::instance()->runEvent = "BeforeEvents";
692  MessageDrop::instance()->setSinglet("AfterBeginJob"); // Change Log 17
693  }
694 
696  { establish("source"); }
698  { unEstablish("AfterSource");
699  MessageDrop::instance()->runEvent = "AfterSource";
700  }
702  { establish("source"); }
704  { unEstablish("AfterSource"); }
705 
706  void MessageLogger::preFile( std::string const &, bool )
707  { establish("file_open"); }
709  { establish("file_close"); }
710  void MessageLogger::postFile( std::string const &, bool )
711  { unEstablish("AfterFile"); }
712 
713 
714  void
716  {
717  std::ostringstream ost;
718  auto const& id = iContext.eventID();
719  ost << "Run: " << id.run()
720  << " Event: " << id.event(); // change log 2
721  assert(iContext.streamID().value()<transitionInfoCache_.size());
722  transitionInfoCache_[iContext.streamID().value()]=ost.str();
723  edm::MessageDrop::instance()->runEvent = ost.str();
724  edm::MessageDrop::instance()->setSinglet("PreEventProcessing");// changelog 17
725  // Note - module name had not been set here Similarly in other places where
726  // RunEvent carries the new information; we add setSinglet for module name.
727  }
728 
729  void
731  {
732  edm::MessageDrop::instance()->runEvent = "PostProcessEvent";
734  }
735 
736  void
737  MessageLogger::preStreamBeginRun( StreamContext const& iContext) // change log 14
738  {
739  std::ostringstream ost;
740  ost << "Run: " << iContext.eventID().run()<<" Stream: "<<iContext.streamID().value();;
741  transitionInfoCache_[iContext.streamID().value()]=ost.str();
742  edm::MessageDrop::instance()->runEvent = ost.str();
743  edm::MessageDrop::instance()->setSinglet("PreStreamBeginRun"); // changelog 17
744  }
746  {
747  edm::MessageDrop::instance()->runEvent = "PostStreamBeginRun";
748  edm::MessageDrop::instance()->setSinglet("PostStreamBeginRun"); // changelog 17
749  // Note - module name had not been set here
750  }
751 
752  void
754  {
755  std::ostringstream ost;
756  ost << "End Run: " << iContext.eventID().run()<<" Stream: "<<iContext.streamID().value();;
757  transitionInfoCache_[iContext.streamID().value()]=ost.str();
758  edm::MessageDrop::instance()->runEvent = ost.str();
759  edm::MessageDrop::instance()->setSinglet("PreStreamEndRun"); // changelog 17
760  }
761 
763  {
764  edm::MessageDrop::instance()->runEvent = "PostStreamEndRun";
765  edm::MessageDrop::instance()->setSinglet("PostStreaEndRun"); // changelog 17
766  }
767 
768  void
770  {
771  std::ostringstream ost;
772  auto const& id = iContext.eventID();
773  ost << "Run: " << id.run() << " Lumi: " << id.luminosityBlock()<<" Stream: "<<iContext.streamID().value();
774  transitionInfoCache_[iContext.streamID().value()]=ost.str();
775  edm::MessageDrop::instance()->runEvent = ost.str();
776  edm::MessageDrop::instance()->setSinglet("PreStreamBeginLumi"); // changelog 17
777  }
778 
780  {
781  edm::MessageDrop::instance()->runEvent = "PostStreamBeginLumi";
782  edm::MessageDrop::instance()->setSinglet("PostStreamBeginLumi"); // changelog 17
783  }
784 
785  void
787  {
788  std::ostringstream ost;
789  auto const& id = iContext.eventID();
790  ost << "Run: " << id.run() << " Lumi: " << id.luminosityBlock()<<" Stream: "<<iContext.streamID().value();;
791  transitionInfoCache_[iContext.streamID().value()]=ost.str();
792  edm::MessageDrop::instance()->runEvent = ost.str();
793  edm::MessageDrop::instance()->setSinglet("PreStreamEndLumi"); // changelog 17
794  }
796  {
797  edm::MessageDrop::instance()->runEvent = "PostStreamEndLumi";
798  edm::MessageDrop::instance()->setSinglet("PostStreamEndLumi"); // changelog 17
799  }
800 
801 
802  void
803  MessageLogger::preGlobalBeginRun( GlobalContext const& iContext) // change log 14
804  {
805  std::ostringstream ost;
806  ost << "Run: " << iContext.luminosityBlockID().run();
807  transitionInfoCache_[runInfoBegin_+iContext.runIndex()]=ost.str();
808  edm::MessageDrop::instance()->runEvent = ost.str();
809  edm::MessageDrop::instance()->setSinglet("PreGlobalBeginRun"); // changelog 17
810  }
812  {
813  edm::MessageDrop::instance()->runEvent = "PostGlobalBeginRun";
814  edm::MessageDrop::instance()->setSinglet("PostGlobalBeginRun"); // changelog 17
815  // Note - module name had not been set here
816  }
817 
818  void
819  MessageLogger::prePathEvent( StreamContext const& stream, PathContext const& iPath) // change log 14
820  {
821  auto messageDrop = edm::MessageDrop::instance();
822  messageDrop->runEvent = transitionInfoCache_[stream.streamID().value()];
823  messageDrop->setPath( "PreProcPath ", iPath.pathName());
824  // change log 17
825  }
826 
828  {
829  edm::MessageDrop::instance()->setSinglet("PostProcessPath"); // changelog 17
830  }
831 
832  void
834  {
835  std::ostringstream ost;
836  ost << "End Run: " << iContext.luminosityBlockID().run();
837  transitionInfoCache_[runInfoBegin_+iContext.runIndex()]=ost.str();
838  edm::MessageDrop::instance()->runEvent = ost.str();
839  edm::MessageDrop::instance()->setSinglet("PreGlobalEndRun"); // changelog 17
840  }
841 
843  {
844  edm::MessageDrop::instance()->runEvent = "PostGlobalEndRun";
845  edm::MessageDrop::instance()->setSinglet("PostGlobalEndRun"); // changelog 17
846  }
847 
848  void
850  {
851  std::ostringstream ost;
852  auto const& id = iContext.luminosityBlockID();
853  ost << "Run: " << id.run() << " Lumi: " << id.luminosityBlock();
855  edm::MessageDrop::instance()->runEvent = ost.str();
856  edm::MessageDrop::instance()->setSinglet("PreGlobalBeginLumi"); // changelog 17
857  }
858 
860  {
861  edm::MessageDrop::instance()->runEvent = "PostGlobalBeginLumi";
862  edm::MessageDrop::instance()->setSinglet("PostGlobalBeginLumi"); // changelog 17
863  }
864 
865  void
867  {
868  std::ostringstream ost;
869  auto const& id = iContext.luminosityBlockID();
870  ost << "Run: " << id.run() << " Lumi: " << id.luminosityBlock();
872  edm::MessageDrop::instance()->runEvent = ost.str();
873  edm::MessageDrop::instance()->setSinglet("PreGlobalEndLumi"); // changelog 17
874  }
876  {
877  edm::MessageDrop::instance()->runEvent = "PostGlobalEndLumi";
878  edm::MessageDrop::instance()->setSinglet("PostGlobalEndLumi"); // changelog 17
879  }
880 
881  void
883  {
884  SummarizeInJobReport(); // Put summary info into Job Rep // change log 10
885  MessageLoggerQ::MLqSUM ( ); // trigger summary info. // change log 9
886  }
887 
888  void
890  {
891  MessageDrop* messageDrop = MessageDrop::instance();
892  messageDrop->setSinglet("jobFailure");
893  SummarizeInJobReport(); // Put summary info into Job Rep // change log 10
894  MessageLoggerQ::MLqSUM ( ); // trigger summary info. // change log 9
895  }
896 
897 
898  //
899  // Other methods
900  //
901 
902  void
904  if ( fjrSummaryRequested_ ) {
905  std::map<std::string, double> * smp = new std::map<std::string, double> ();
906  MessageLoggerQ::MLqJRS ( smp );
907  Service<JobReport> reportSvc;
908  reportSvc->reportMessageInfo(*smp);
909  delete smp;
910  }
911  }
912 
913  } // end of namespace service
914 } // end of namespace edm
void preModuleStreamEndLumi(StreamContext const &, ModuleCallingContext const &)
void preModuleEvent(StreamContext const &, ModuleCallingContext const &)
RunNumber_t run() const
Definition: EventID.h:39
void watchPostModuleGlobalEndLumi(PostModuleGlobalEndLumi::slot_type const &iSlot)
void watchPostModuleConstruction(PostModuleConstruction::slot_type const &iSlot)
std::string const & pathName() const
Definition: PathContext.h:37
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 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 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:52
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:191
void watchPostSourceConstruction(PostSourceConstruction::slot_type const &iSlot)
static MessageDrop * instance()
Definition: MessageDrop.cc:60
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:50
void watchPostModuleStreamEndLumi(PostModuleStreamEndLumi::slot_type const &iSlot)
static std::string jobMode
Definition: MessageDrop.h:110
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 postStreamEndRun(StreamContext const &)
void setSinglet(const char *sing)
Definition: MessageDrop.cc:204
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:53
unsigned int maxNumberOfStreams() const
Definition: SystemBounds.h:43
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:104
void watchPostSourceRun(PostSourceRun::slot_type const &iSlot)
LuminosityBlockIndex const & luminosityBlockIndex() const
Definition: GlobalContext.h:54
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 watchPreModuleEndJob(PreModuleEndJob::slot_type const &iSlot)
unsigned int value() const
void preModuleStreamEndRun(StreamContext const &, ModuleCallingContext const &)
void watchPostGlobalEndLumi(PostGlobalEndLumi::slot_type const &iSlot)
void postModuleStreamBeginRun(StreamContext const &, ModuleCallingContext const &)
void watchPreSourceRun(PreSourceRun::slot_type const &iSlot)
void preModuleConstruction(ModuleDescription const &)
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:57
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::vector< std::string > transitionInfoCache_
unsigned int value() const
Definition: StreamID.h:46
unsigned int maxNumberOfConcurrentLuminosityBlocks() const
Definition: SystemBounds.h:45
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:592
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 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)
void watchPostModuleGlobalBeginRun(PostModuleGlobalBeginRun::slot_type const &iSlot)
unsigned int maxNumberOfConcurrentRuns() const
Definition: SystemBounds.h:44
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 &)
std::string runEvent
Definition: MessageDrop.h:103
void preGlobalEndRun(GlobalContext const &)
void preEvent(StreamContext const &)
std::string messageServicePSetValidatationResults_
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void watchPostModuleEndJob(PostModuleEndJob::slot_type const &iSlot)
std::map< std::string, ELseverityLevel > suppression_levels_
void preModuleGlobalBeginRun(GlobalContext const &, ModuleCallingContext const &)
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)