CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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"); }
700  { establish("source"); }
702  { unEstablish("AfterSource"); }
703 
704  void MessageLogger::preFile( std::string const &, bool )
705  { establish("file_open"); }
707  { establish("file_close"); }
708  void MessageLogger::postFile( std::string const &, bool )
709  { unEstablish("AfterFile"); }
710 
711 
712  void
714  {
715  std::ostringstream ost;
716  auto const& id = iContext.eventID();
717  ost << "Run: " << id.run()
718  << " Event: " << id.event(); // change log 2
719  assert(iContext.streamID().value()<transitionInfoCache_.size());
720  transitionInfoCache_[iContext.streamID().value()]=ost.str();
721  edm::MessageDrop::instance()->runEvent = ost.str();
722  edm::MessageDrop::instance()->setSinglet("PreEventProcessing");// changelog 17
723  // Note - module name had not been set here Similarly in other places where
724  // RunEvent carries the new information; we add setSinglet for module name.
725  }
726 
727  void
729  {
730  edm::MessageDrop::instance()->runEvent = "PostProcessEvent";
732  }
733 
734  void
735  MessageLogger::preStreamBeginRun( StreamContext const& iContext) // change log 14
736  {
737  std::ostringstream ost;
738  ost << "Run: " << iContext.eventID().run();
739  transitionInfoCache_[iContext.streamID().value()]=ost.str();
740  edm::MessageDrop::instance()->runEvent = ost.str();
741  edm::MessageDrop::instance()->setSinglet("PreBeginRun"); // changelog 17
742  }
744  {
745  edm::MessageDrop::instance()->runEvent = "PostBeginRun";
746  edm::MessageDrop::instance()->setSinglet("PostBeginRun"); // changelog 17
747  // Note - module name had not been set here
748  }
749 
750  void
752  {
753  std::ostringstream ost;
754  ost << "End Run: " << iContext.eventID().run();
755  transitionInfoCache_[iContext.streamID().value()]=ost.str();
756  edm::MessageDrop::instance()->runEvent = ost.str();
757  edm::MessageDrop::instance()->setSinglet("PreEndRun"); // changelog 17
758  }
759 
761  {
762  edm::MessageDrop::instance()->runEvent = "PostEndRun";
763  edm::MessageDrop::instance()->setSinglet("PostEndRun"); // changelog 17
764  }
765 
766  void
768  {
769  std::ostringstream ost;
770  auto const& id = iContext.eventID();
771  ost << "Run: " << id.run() << " Lumi: " << id.luminosityBlock();
772  transitionInfoCache_[iContext.streamID().value()]=ost.str();
773  edm::MessageDrop::instance()->runEvent = ost.str();
774  edm::MessageDrop::instance()->setSinglet("PreBeginLumi"); // changelog 17
775  }
776 
778  {
779  edm::MessageDrop::instance()->runEvent = "PostBeginLumi";
780  edm::MessageDrop::instance()->setSinglet("PostBeginLumi"); // 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();
789  transitionInfoCache_[iContext.streamID().value()]=ost.str();
790  edm::MessageDrop::instance()->runEvent = ost.str();
791  edm::MessageDrop::instance()->setSinglet("PreEndLumi"); // changelog 17
792  }
794  {
795  edm::MessageDrop::instance()->runEvent = "PostEndLumi";
796  edm::MessageDrop::instance()->setSinglet("PostEndLumi"); // changelog 17
797  }
798 
799 
800  void
801  MessageLogger::preGlobalBeginRun( GlobalContext const& iContext) // change log 14
802  {
803  std::ostringstream ost;
804  ost << "Run: " << iContext.luminosityBlockID().run();
805  transitionInfoCache_[runInfoBegin_+iContext.runIndex()]=ost.str();
806  edm::MessageDrop::instance()->runEvent = ost.str();
807  edm::MessageDrop::instance()->setSinglet("PreBeginRun"); // changelog 17
808  }
810  {
811  edm::MessageDrop::instance()->runEvent = "PostBeginRun";
812  edm::MessageDrop::instance()->setSinglet("PostBeginRun"); // changelog 17
813  // Note - module name had not been set here
814  }
815 
816  void
817  MessageLogger::prePathEvent( StreamContext const& stream, PathContext const& iPath) // change log 14
818  {
819  auto messageDrop = edm::MessageDrop::instance();
820  messageDrop->runEvent = transitionInfoCache_[stream.streamID().value()];
821  messageDrop->setPath( "PreProcPath ", iPath.pathName());
822  // change log 17
823  }
824 
826  {
827  edm::MessageDrop::instance()->setSinglet("PostProcessPath"); // changelog 17
828  }
829 
830  void
832  {
833  std::ostringstream ost;
834  ost << "End Run: " << iContext.luminosityBlockID().run();
835  transitionInfoCache_[runInfoBegin_+iContext.runIndex()]=ost.str();
836  edm::MessageDrop::instance()->runEvent = ost.str();
837  edm::MessageDrop::instance()->setSinglet("PreEndRun"); // changelog 17
838  }
839 
841  {
842  edm::MessageDrop::instance()->runEvent = "PostEndRun";
843  edm::MessageDrop::instance()->setSinglet("PostEndRun"); // changelog 17
844  }
845 
846  void
848  {
849  std::ostringstream ost;
850  auto const& id = iContext.luminosityBlockID();
851  ost << "Run: " << id.run() << " Lumi: " << id.luminosityBlock();
853  edm::MessageDrop::instance()->runEvent = ost.str();
854  edm::MessageDrop::instance()->setSinglet("PreBeginLumi"); // changelog 17
855  }
856 
858  {
859  edm::MessageDrop::instance()->runEvent = "PostBeginLumi";
860  edm::MessageDrop::instance()->setSinglet("PostBeginLumi"); // 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("PreEndLumi"); // changelog 17
872  }
874  {
875  edm::MessageDrop::instance()->runEvent = "PostEndLumi";
876  edm::MessageDrop::instance()->setSinglet("PostEndLumi"); // changelog 17
877  }
878 
879  void
881  {
882  SummarizeInJobReport(); // Put summary info into Job Rep // change log 10
883  MessageLoggerQ::MLqSUM ( ); // trigger summary info. // change log 9
884  }
885 
886  void
888  {
889  MessageDrop* messageDrop = MessageDrop::instance();
890  messageDrop->setSinglet("jobFailure");
891  SummarizeInJobReport(); // Put summary info into Job Rep // change log 10
892  MessageLoggerQ::MLqSUM ( ); // trigger summary info. // change log 9
893  }
894 
895 
896  //
897  // Other methods
898  //
899 
900  void
902  if ( fjrSummaryRequested_ ) {
903  std::map<std::string, double> * smp = new std::map<std::string, double> ();
904  MessageLoggerQ::MLqJRS ( smp );
905  Service<JobReport> reportSvc;
906  reportSvc->reportMessageInfo(*smp);
907  delete smp;
908  }
909  }
910 
911  } // end of namespace service
912 } // 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
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::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
void postModuleGlobalBeginLumi(GlobalContext const &, ModuleCallingContext const &)
void watchPostModuleEndStream(PostModuleEndStream::slot_type const &iSlot)
void watchPreModuleEvent(PreModuleEvent::slot_type const &iSlot)
tuple suppressDebug
Definition: MergeJob_cfg.py:30
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)
assert(m_qm.get())
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:109
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 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:103
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)
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 unEstablishModule(const ModuleDescription &desc, const char *whichPhase)
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:644
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
void postModuleBeginJob(ModuleDescription const &)
void watchPreStreamBeginRun(PreStreamBeginRun::slot_type const &iSlot)
void establishModule(const ModuleDescription &desc, const char *whichPhase)
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)
volatile std::atomic< bool > shutdown_flag false
void postModuleGlobalEndRun(GlobalContext const &, ModuleCallingContext const &)
tuple suppressWarning
Definition: MergeJob_cfg.py:28
void preModuleStreamBeginLumi(StreamContext const &, ModuleCallingContext const &)
std::string runEvent
Definition: MessageDrop.h:102
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)