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 
275  // change log 14:
276  iRegistry.watchPreSourceRun([this](RunIndex) { preSourceRunLumi(); });
277  iRegistry.watchPostSourceRun([this](RunIndex) { postSourceRunLumi(); });
278  iRegistry.watchPreSourceLumi([this](LuminosityBlockIndex) { preSourceRunLumi(); });
280  iRegistry.watchPreOpenFile(this,&MessageLogger::preFile);
284 
285  // change log 13:
286  // change log 15
291 
296 
305 
314 
315  iRegistry.watchPreEvent(this,&MessageLogger::preEvent);
316  iRegistry.watchPostEvent(this,&MessageLogger::postEvent);
317 
326 
335 
338 
339 
340  MessageDrop* messageDrop = MessageDrop::instance();
341  nonModule_debugEnabled = messageDrop->debugEnabled;
342  nonModule_infoEnabled = messageDrop->infoEnabled;
344  nonModule_errorEnabled = messageDrop->errorEnabled;
345  } // ctor
346 
347  //
348  // Shared helper routines for establishing module name and enabling behavior
349  //
350 
351  void
353  const char * whichPhase) // ChangeLog 13, 17
354  {
355  MessageDrop* messageDrop = MessageDrop::instance();
356 
357  // std::cerr << "establishModule( " << desc.moduleName() << ")\n";
358  // Change Log 17
359  messageDrop->setModuleWithPhase(desc.moduleName(), desc.moduleLabel(),
360  desc.id(), whichPhase );
361  // Removed caching per change 17 - caching is now done in MessageDrop.cc
362  // in theContext() method, and only happens if a message is actually issued.
363 
364  if (!anyDebugEnabled_) {
365  messageDrop->debugEnabled = false;
366  } else if (everyDebugEnabled_) {
367  messageDrop->debugEnabled = true;
368  } else {
369  messageDrop->debugEnabled =
370  debugEnabledModules_.count(desc.moduleLabel());
371  }
372 
373  auto it = suppression_levels_.find(desc.moduleLabel());
374  if ( it != suppression_levels_.end() ) {
375  messageDrop->debugEnabled = messageDrop->debugEnabled
376  && (it->second < ELseverityLevel::ELsev_success );
377  messageDrop->infoEnabled = (it->second < ELseverityLevel::ELsev_info );
378  messageDrop->warningEnabled = (it->second < ELseverityLevel::ELsev_warning );
379  messageDrop->errorEnabled = (it->second < ELseverityLevel::ELsev_error );
380  } else {
381  messageDrop->infoEnabled = true;
382  messageDrop->warningEnabled = true;
383  messageDrop->errorEnabled = true;
384  }
385  } // establishModule
386 
387  void
388  MessageLogger::establishModule(unsigned int transitionIndex,
389  ModuleCallingContext const & mod,
390  const char * whichPhase) // ChangeLog 13, 17
391  {
392  MessageDrop* messageDrop = MessageDrop::instance();
393 
394  // std::cerr << "establishModule( " << desc.moduleName() << ")\n";
395  // Change Log 17
396  auto const desc = mod.moduleDescription();
397  messageDrop->runEvent = transitionInfoCache_[transitionIndex];
398  messageDrop->setModuleWithPhase(desc->moduleName(), desc->moduleLabel(),
399  desc->id(), whichPhase );
400  messageDrop->streamID = transitionIndex;
401  if(transitionIndex>= lumiInfoBegin_) {
403  }
404  // Removed caching per change 17 - caching is now done in MessageDrop.cc
405  // in theContext() method, and only happens if a message is actually issued.
406 
407  if (!anyDebugEnabled_) {
408  messageDrop->debugEnabled = false;
409  } else if (everyDebugEnabled_) {
410  messageDrop->debugEnabled = true;
411  } else {
412  messageDrop->debugEnabled =
413  debugEnabledModules_.count(desc->moduleLabel());
414  }
415 
416  auto it = suppression_levels_.find(desc->moduleLabel());
417  if ( it != suppression_levels_.end() ) {
418  messageDrop->debugEnabled = messageDrop->debugEnabled
419  && (it->second < ELseverityLevel::ELsev_success );
420  messageDrop->infoEnabled = (it->second < ELseverityLevel::ELsev_info );
421  messageDrop->warningEnabled = (it->second < ELseverityLevel::ELsev_warning );
422  messageDrop->errorEnabled = (it->second < ELseverityLevel::ELsev_error );
423  } else {
424  messageDrop->infoEnabled = true;
425  messageDrop->warningEnabled = true;
426  messageDrop->errorEnabled = true;
427  }
428  } // establishModule
429 
430 
431  void
433  const char* state)
434  {
435  // std::cerr << "unestablishModule( " << desc.moduleName() << ") "
436  // << "state = " << *state << "\n";
437 
438  MessageDrop* messageDrop = MessageDrop::instance();
439  messageDrop->setSinglet( state ); // Change Log 17
440  messageDrop->debugEnabled = nonModule_debugEnabled;
441  messageDrop->infoEnabled = nonModule_infoEnabled;
443  messageDrop->errorEnabled = nonModule_errorEnabled; // change log 20
444  }
445 
446  void
448  const char* state)
449  {
450  //Need to reset to what was previously being used on this thread
451  auto previous = mod.previousModuleOnThread();
452  if(previous) {
453  //need to know if we are in a global or stream context
454  auto top = previous->getTopModuleCallingContext();
455  assert(nullptr != top);
456  if (ParentContext::Type::kGlobal == top->type()) {
457  auto globalContext = top->globalContext();
458  assert(nullptr != globalContext);
459  auto tran = globalContext->transition();
462  establishModule(lumiInfoBegin_+globalContext->luminosityBlockIndex(),
463  *previous,s_globalTransitionNames[static_cast<int>(tran)]);
464  } else {
465  establishModule(runInfoBegin_+globalContext->runIndex(),
466  *previous,s_globalTransitionNames[static_cast<int>(tran)]);
467  }
468  } else {
469  auto stream = previous->getStreamContext();
470  establishModule(stream->streamID().value(),*previous,s_streamTransitionNames[static_cast<int>(stream->transition())]);
471  }
472  } else {
473 
474  MessageDrop* messageDrop = MessageDrop::instance();
476  messageDrop->setSinglet( state ); // Change Log 17
477  messageDrop->debugEnabled = nonModule_debugEnabled;
478  messageDrop->infoEnabled = nonModule_infoEnabled;
480  messageDrop->errorEnabled = nonModule_errorEnabled; // change log 20
481  }
482 
483  // std::cerr << "unestablishModule( " << desc.moduleName() << ") "
484  // << "state = " << *state << "\n";
485 
486  }
487 
488  void
489  MessageLogger::establish(const char* state)
490  {
491  MessageDrop* messageDrop = MessageDrop::instance();
492  messageDrop->setSinglet( state ); // Change Log 17
493  if (!anyDebugEnabled_) {
494  messageDrop->debugEnabled = false;
495  } else if (everyDebugEnabled_) {
496  messageDrop->debugEnabled = true;
497  } else {
498  messageDrop->debugEnabled =
499  debugEnabledModules_.count(state); // change log 8
500  }
501  std::map<const std::string,ELseverityLevel>::const_iterator it =
502  suppression_levels_.find(state); // change log 8
503  if ( it != suppression_levels_.end() ) {
504  messageDrop->debugEnabled = messageDrop->debugEnabled
505  && (it->second < ELseverityLevel::ELsev_success );
506  messageDrop->infoEnabled = (it->second < ELseverityLevel::ELsev_info );
507  messageDrop->warningEnabled = (it->second < ELseverityLevel::ELsev_warning );
508  messageDrop->errorEnabled = (it->second < ELseverityLevel::ELsev_error );
509  } else {
510  messageDrop->infoEnabled = true;
511  messageDrop->warningEnabled = true;
512  messageDrop->errorEnabled = true;
513  }
514  }
515 
516  void
517  MessageLogger::unEstablish(const char* state)
518  {
519  MessageDrop::instance()->setSinglet( state ); // Change Log 17
520  }
521 
522  //
523  // callbacks that need to establish the module, and their counterparts
524  //
525 
526  void
528  {
529  if (!messageServicePSetHasBeenValidated_) { // change log 12
531  throw ( edm::Exception
534  ) );
535  }
537  }
538  establishModule (desc,"@ctor"); // ChangeLog 16
539  }
541  { //it is now guaranteed that this will be called even if the module throws
542  unEstablishModule (iDescription, "AfterModConstruction"); }
543 
544  void
546  {
547  establishModule (desc,"@beginJob"); // ChangeLog 13
548  }
550  { unEstablishModule (iDescription, "AfterModBeginJob"); }
551 
552  void
554  {
555  if (!messageServicePSetHasBeenValidated_) { // change log 12
557  throw ( edm::Exception
560  ) );
561  }
563  }
564  establishModule(desc,"@sourceConstruction"); // ChangeLog 16
565  }
567  { unEstablishModule (iDescription, "AfterSourceConstruction"); }
568 
569  void
571  {
572  ModuleDescription const& desc = *mcc.moduleDescription();
573  establishModule (desc,"@beginStream"); // ChangeLog 13
574  }
576  {
577  ModuleDescription const& desc = *mcc.moduleDescription();
578  unEstablishModule (desc, "AfterModBeginStream");
579  }
580 
581  void
583  {
584  establishModule (stream.streamID().value(),mod,
585  s_streamTransitionNames[static_cast<int>(StreamContext::Transition::kBeginRun)]);
586  }
588  { unEstablishModule (mod, "AfterModStreamBeginRun"); }
589 
590  void
592  {
593  establishModule (stream.streamID().value(),mod,
594  s_streamTransitionNames[static_cast<int>(StreamContext::Transition::kBeginLuminosityBlock)]);
595  }
597  { unEstablishModule (mod, "AfterModStreamBeginLumi"); }
598 
599  void
601  {
602  establishModule (stream.streamID().value(),mod,
603  s_streamTransitionNames[static_cast<int>(StreamContext::Transition::kEvent)]);
604  }
605 
607  {
608  unEstablishModule(mod,"PostModuleEvent");
609  }
610 
611  void
613  {
614  establishModule (stream.streamID().value(),mod,
615  s_streamTransitionNames[static_cast<int>(StreamContext::Transition::kEvent)]);
616  }
617 
619  {
620  unEstablishModule(mod,"PostModuleEventAcquire");
621  }
622 
623  void
625  {
626  establishModule (stream.streamID().value(),mod,
627  s_streamTransitionNames[static_cast<int>(StreamContext::Transition::kEndLuminosityBlock)]);
628  }
630  { unEstablishModule (mod, "AfterModStreamEndLumi"); }
631 
632  void
634  {
635  establishModule (stream.streamID().value(),mod,
636  s_streamTransitionNames[static_cast<int>(StreamContext::Transition::kEndRun)]); // ChangeLog 13
637  }
639  { unEstablishModule (mod, "AfterModStreamEndRun"); }
640 
641  //Global
642  void
644  {
646  s_globalTransitionNames[static_cast<int>(GlobalContext::Transition::kBeginRun)]);
647  }
649  { unEstablishModule (mod, "AfterModGlobalBeginRun"); }
650 
651  void
653  {
655  s_globalTransitionNames[static_cast<int>(GlobalContext::Transition::kBeginLuminosityBlock)]);
656  }
658  { unEstablishModule (mod, "AfterModGlobalBeginLumi"); }
659 
660  void
662  {
664  s_globalTransitionNames[static_cast<int>(GlobalContext::Transition::kEndLuminosityBlock)]);
665  }
667  { unEstablishModule (mod, "AfterModGlobalEndLumi"); }
668 
669  void
671  {
673  s_globalTransitionNames[static_cast<int>(GlobalContext::Transition::kEndRun)]); // ChangeLog 13
674  }
676  { unEstablishModule (mod, "AfterModGlobalEndRun"); }
677 
678  void
680  {
681  ModuleDescription const& desc = *mcc.moduleDescription();
682  establishModule (desc,"@endStream"); // ChangeLog 13
683  }
684 
686  {
687  ModuleDescription const& desc = *mcc.moduleDescription();
688  unEstablishModule (desc, "AfterModEndStream");
689  }
690 
691  void
693  {
694  establishModule (desc,"@endJob"); // ChangeLog 13
695  }
697  { unEstablishModule (iDescription, "AfterModEndJob"); }
698 
699  //
700  // callbacks that don't know about the module
701  //
702 
703  void
705  {
706  MessageDrop::instance()->runEvent = "BeforeEvents";
707  MessageDrop::instance()->setSinglet("AfterBeginJob"); // Change Log 17
708  }
709 
711  { establish("source"); }
713  { unEstablish("AfterSource");
714  MessageDrop::instance()->runEvent = "AfterSource";
715  }
717  { establish("source"); }
719  { unEstablish("AfterSource"); }
720 
721  void MessageLogger::preFile( std::string const &, bool )
722  { establish("file_open"); }
724  { establish("file_close"); }
725  void MessageLogger::postFile( std::string const &, bool )
726  { unEstablish("AfterFile"); }
727 
728 
729  void
731  {
732  std::ostringstream ost;
733  auto const& id = iContext.eventID();
734  ost << "Run: " << id.run()
735  << " Event: " << id.event(); // change log 2
736  assert(iContext.streamID().value()<transitionInfoCache_.size());
737  transitionInfoCache_[iContext.streamID().value()]=ost.str();
738  edm::MessageDrop::instance()->runEvent = ost.str();
739  edm::MessageDrop::instance()->setSinglet("PreEventProcessing");// changelog 17
740  // Note - module name had not been set here Similarly in other places where
741  // RunEvent carries the new information; we add setSinglet for module name.
742  }
743 
744  void
746  {
747  edm::MessageDrop::instance()->runEvent = "PostProcessEvent";
749  }
750 
751  void
752  MessageLogger::preStreamBeginRun( StreamContext const& iContext) // change log 14
753  {
754  std::ostringstream ost;
755  ost << "Run: " << iContext.eventID().run()<<" Stream: "<<iContext.streamID().value();;
756  transitionInfoCache_[iContext.streamID().value()]=ost.str();
757  edm::MessageDrop::instance()->runEvent = ost.str();
758  edm::MessageDrop::instance()->setSinglet("PreStreamBeginRun"); // changelog 17
759  }
761  {
762  edm::MessageDrop::instance()->runEvent = "PostStreamBeginRun";
763  edm::MessageDrop::instance()->setSinglet("PostStreamBeginRun"); // changelog 17
764  // Note - module name had not been set here
765  }
766 
767  void
769  {
770  std::ostringstream ost;
771  ost << "End Run: " << iContext.eventID().run()<<" Stream: "<<iContext.streamID().value();;
772  transitionInfoCache_[iContext.streamID().value()]=ost.str();
773  edm::MessageDrop::instance()->runEvent = ost.str();
774  edm::MessageDrop::instance()->setSinglet("PreStreamEndRun"); // changelog 17
775  }
776 
778  {
779  edm::MessageDrop::instance()->runEvent = "PostStreamEndRun";
780  edm::MessageDrop::instance()->setSinglet("PostStreaEndRun"); // changelog 17
781  }
782 
783  void
785  {
786  std::ostringstream ost;
787  auto const& id = iContext.eventID();
788  ost << "Run: " << id.run() << " Lumi: " << id.luminosityBlock()<<" Stream: "<<iContext.streamID().value();
789  transitionInfoCache_[iContext.streamID().value()]=ost.str();
790  edm::MessageDrop::instance()->runEvent = ost.str();
791  edm::MessageDrop::instance()->setSinglet("PreStreamBeginLumi"); // changelog 17
792  }
793 
795  {
796  edm::MessageDrop::instance()->runEvent = "PostStreamBeginLumi";
797  edm::MessageDrop::instance()->setSinglet("PostStreamBeginLumi"); // changelog 17
798  }
799 
800  void
802  {
803  std::ostringstream ost;
804  auto const& id = iContext.eventID();
805  ost << "Run: " << id.run() << " Lumi: " << id.luminosityBlock()<<" Stream: "<<iContext.streamID().value();;
806  transitionInfoCache_[iContext.streamID().value()]=ost.str();
807  edm::MessageDrop::instance()->runEvent = ost.str();
808  edm::MessageDrop::instance()->setSinglet("PreStreamEndLumi"); // changelog 17
809  }
811  {
812  edm::MessageDrop::instance()->runEvent = "PostStreamEndLumi";
813  edm::MessageDrop::instance()->setSinglet("PostStreamEndLumi"); // changelog 17
814  }
815 
816 
817  void
818  MessageLogger::preGlobalBeginRun( GlobalContext const& iContext) // change log 14
819  {
820  std::ostringstream ost;
821  ost << "Run: " << iContext.luminosityBlockID().run();
822  transitionInfoCache_[runInfoBegin_+iContext.runIndex()]=ost.str();
823  edm::MessageDrop::instance()->runEvent = ost.str();
824  edm::MessageDrop::instance()->setSinglet("PreGlobalBeginRun"); // changelog 17
825  }
827  {
828  edm::MessageDrop::instance()->runEvent = "PostGlobalBeginRun";
829  edm::MessageDrop::instance()->setSinglet("PostGlobalBeginRun"); // changelog 17
830  // Note - module name had not been set here
831  }
832 
833  void
834  MessageLogger::prePathEvent( StreamContext const& stream, PathContext const& iPath) // change log 14
835  {
836  auto messageDrop = edm::MessageDrop::instance();
837  messageDrop->runEvent = transitionInfoCache_[stream.streamID().value()];
838  messageDrop->setPath( "PreProcPath ", iPath.pathName());
839  // change log 17
840  }
841 
843  {
844  edm::MessageDrop::instance()->setSinglet("PostProcessPath"); // changelog 17
845  }
846 
847  void
849  {
850  std::ostringstream ost;
851  ost << "End Run: " << iContext.luminosityBlockID().run();
852  transitionInfoCache_[runInfoBegin_+iContext.runIndex()]=ost.str();
853  edm::MessageDrop::instance()->runEvent = ost.str();
854  edm::MessageDrop::instance()->setSinglet("PreGlobalEndRun"); // changelog 17
855  }
856 
858  {
859  edm::MessageDrop::instance()->runEvent = "PostGlobalEndRun";
860  edm::MessageDrop::instance()->setSinglet("PostGlobalEndRun"); // changelog 17
861  }
862 
863  void
865  {
866  std::ostringstream ost;
867  auto const& id = iContext.luminosityBlockID();
868  ost << "Run: " << id.run() << " Lumi: " << id.luminosityBlock();
870  edm::MessageDrop::instance()->runEvent = ost.str();
871  edm::MessageDrop::instance()->setSinglet("PreGlobalBeginLumi"); // changelog 17
872  }
873 
875  {
876  edm::MessageDrop::instance()->runEvent = "PostGlobalBeginLumi";
877  edm::MessageDrop::instance()->setSinglet("PostGlobalBeginLumi"); // changelog 17
878  }
879 
880  void
882  {
883  std::ostringstream ost;
884  auto const& id = iContext.luminosityBlockID();
885  ost << "Run: " << id.run() << " Lumi: " << id.luminosityBlock();
887  edm::MessageDrop::instance()->runEvent = ost.str();
888  edm::MessageDrop::instance()->setSinglet("PreGlobalEndLumi"); // changelog 17
889  }
891  {
892  edm::MessageDrop::instance()->runEvent = "PostGlobalEndLumi";
893  edm::MessageDrop::instance()->setSinglet("PostGlobalEndLumi"); // changelog 17
894  }
895 
896  void
898  {
899  SummarizeInJobReport(); // Put summary info into Job Rep // change log 10
900  MessageLoggerQ::MLqSUM ( ); // trigger summary info. // change log 9
901  }
902 
903  void
905  {
906  MessageDrop* messageDrop = MessageDrop::instance();
907  messageDrop->setSinglet("jobFailure");
908  SummarizeInJobReport(); // Put summary info into Job Rep // change log 10
909  MessageLoggerQ::MLqSUM ( ); // trigger summary info. // change log 9
910  }
911 
912 
913  //
914  // Other methods
915  //
916 
917  void
919  if ( fjrSummaryRequested_ ) {
920  std::map<std::string, double> * smp = new std::map<std::string, double> ();
921  MessageLoggerQ::MLqJRS ( smp );
922  Service<JobReport> reportSvc;
923  reportSvc->reportMessageInfo(*smp);
924  delete smp;
925  }
926  }
927 
928  } // end of namespace service
929 } // 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 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:57
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 postModuleEventAcquire(StreamContext const &, ModuleCallingContext const &)
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:58
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:59
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)
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:63
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)