CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Private Attributes
edm::JobReport Class Reference

#include <JobReport.h>

Inheritance diagram for edm::JobReport:
edm::service::JobReportService

Classes

class  AtomicLongLong
 
struct  InputFile
 
struct  JobReportImpl
 
struct  OutputFile
 
struct  RunReport
 

Public Types

typedef unsigned int RunNumber
 
typedef std::size_t Token
 

Public Member Functions

std::string dumpFiles (void)
 debug/test util More...
 
void eventReadFromFile (InputType inputType, Token fileToken)
 
void eventWrittenToFile (Token fileToken, RunNumber_t run, EventNumber_t event)
 
void inputFileClosed (InputType inputType, Token fileToken)
 
Token inputFileOpened (std::string const &physicalFileName, std::string const &logicalFileName, std::string const &catalog, std::string const &inputType, std::string const &inputSourceClassName, std::string const &moduleLabel, std::string const &guid, std::vector< std::string > const &branchNames)
 
 JobReport ()
 
 JobReport (std::ostream *outputStream)
 
 JobReport (JobReport const &)=delete
 
JobReportoperator= (JobReport const &)=delete
 
void outputFileClosed (Token fileToken)
 
Token outputFileOpened (std::string const &physicalFileName, std::string const &logicalFileName, std::string const &catalog, std::string const &outputModuleClassName, std::string const &moduleLabel, std::string const &guid, std::string const &dataType, std::string const &branchHash, std::vector< std::string > const &branchNames)
 
void reportAnalysisFile (std::string const &fileName, std::map< std::string, std::string > const &fileData)
 
void reportDataType (Token fileToken, std::string const &dataType)
 
void reportError (std::string const &shortDesc, std::string const &longDesc, int const &exitCode)
 
void reportFallbackAttempt (std::string const &pfn, std::string const &lfn, std::string const &err)
 
void reportFastClonedBranches (std::set< std::string > const &fastClonedBranches, long long nEvents)
 Inform the job report that branches have been fast Cloned. More...
 
void reportFastCopyingStatus (Token t, std::string const &inputFileName, bool fastCopying)
 
void reportInputLumiSection (unsigned int run, unsigned int lumiSectId)
 
void reportInputRunNumber (unsigned int run)
 
void reportLumiSection (JobReport::Token token, unsigned int run, unsigned int lumiSectId, unsigned long nEvents=0)
 
void reportMemoryInfo (std::vector< std::string > const &memoryData)
 
void reportMessageInfo (std::map< std::string, double > const &messageData)
 
void reportPerformanceForModule (std::string const &metricClass, std::string const &moduleName, std::map< std::string, std::string > const &metrics)
 
void reportPerformanceSummary (std::string const &metricClass, std::map< std::string, std::string > const &metrics)
 
void reportRandomStateFile (std::string const &name)
 
void reportReadBranch (InputType inputType, std::string const &branchName)
 Inform the job report that a branch has been read. More...
 
void reportReadBranches ()
 
void reportRunNumber (JobReport::Token token, unsigned int run)
 
void reportSkippedEvent (RunNumber_t run, EventNumber_t event)
 
void reportSkippedFile (std::string const &pfn, std::string const &lfn)
 
 ~JobReport ()
 

Protected Member Functions

edm::propagate_const< std::unique_ptr< JobReportImpl > > & impl ()
 

Private Attributes

edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
 
std::mutex write_mutex
 

Detailed Description

Description: A service that collections job handling information.

Usage: The JobReport service collects 'job handling' information (currently file handling) from several sources, collates the information, and at appropriate intervals, reports the information to the job report, through the MessageLogger.

CMS-THREADING Some notes about thread safety:

  1. It is assumed non-experts will turn the job report on and look at the XML output and NOT call the available public functions. Many of the available service functions can be called at times that are not thread safe (causing data races or interleaved output). The following notes are for Framework experts and detail the assumptions made when modifying JobReport to run in the multithreaded Framework.
  2. We assume the primary input source performs its activity serially. There can be multiple secondary input sources running concurrently.
  3. We assume the following sequence of activities where the lines of asterisks indicate synchronization points:

open primary input file nothing else running concurrently Also respondToOpenInputFiles serially

open output files serially nothing else running concurrently

The primary source runs its other tasks concurrently with the secondary sources running their tasks and modules running their tasks.

close primary input file nothing else running concurrently

close output files serially nothing else running concurrently

repeat the above (the output file opens and closes are optional except for the first and last)

All endJob and postEndJob activities occur serially not concurrently

  1. We assume that a single instance of an OutputModule will only be running on one thread at a time. Other instances of that type of OutputModule may be running concurrently. There are several functions where this is an issue. We have discussed that in the future we might decide to run the OutputModule for multiple events concurrently. That would require further modifications of either the JobReport or the OutputModule.
  2. For Primary and SecondaryFile input sources (not SecondarySource) the calls to reportBranchName from the delayed reader need to be serialized.

Definition at line 103 of file JobReport.h.

Member Typedef Documentation

typedef unsigned int edm::JobReport::RunNumber

Definition at line 106 of file JobReport.h.

typedef std::size_t edm::JobReport::Token

Definition at line 107 of file JobReport.h.

Constructor & Destructor Documentation

edm::JobReport::JobReport ( )

Definition at line 335 of file JobReport.cc.

335  :
336  impl_(new JobReportImpl(nullptr)) {
337  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
edm::JobReport::JobReport ( std::ostream *  outputStream)

Definition at line 339 of file JobReport.cc.

References impl_.

339  : impl_(new JobReportImpl(iOstream)) {
340  if(impl_->ost_) {
341  *(impl_->ost_) << "<FrameworkJobReport>\n";
342  }
343  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
edm::JobReport::JobReport ( JobReport const &  )
delete
edm::JobReport::~JobReport ( )

Definition at line 328 of file JobReport.cc.

References impl_.

328  {
329  impl_->flushFiles();
330  if(impl_->ost_) {
331  *(impl_->ost_) << "</FrameworkJobReport>\n" << std::flush;
332  }
333  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434

Member Function Documentation

std::string edm::JobReport::dumpFiles ( void  )

debug/test util

Definition at line 746 of file JobReport.cc.

References common_cff::doc, f, edm::findOrDefault(), impl_, and mps_check::msg.

746  {
747  std::ostringstream msg;
748 
749  tinyxml2::XMLDocument doc;
750  for(auto const& f :impl_->outputFiles_) {
751 
752  msg << "\n<File>";
753  msg << f;
754 
755  msg << "\n<LumiSections>";
756  msg << "\n<Inputs>";
757  typedef std::vector<JobReport::Token>::iterator iterator;
758  for(auto const& iInput : f.contributingInputs) {
759  auto const& inpFile = impl_->inputFiles_[iInput];
760  msg << "\n<Input>";
761  msg << "\n <LFN>" << doc.NewText(inpFile.logicalFileName.c_str())->Value() << "</LFN>";
762  msg << "\n <PFN>" << doc.NewText(inpFile.physicalFileName.c_str())->Value() << "</PFN>";
763  msg << "\n <FastCopying>" << findOrDefault(f.fastCopyingInputs, inpFile.physicalFileName) << "</FastCopying>";
764  msg << "\n</Input>";
765  doc.DeleteChildren();
766  }
767  msg << "\n</Inputs>";
768  msg << "\n</File>";
769 
770  }
771  return msg.str();
772  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
reco::JetExtendedAssociation::JetExtendedData Value
double f[11][100]
Value const & findOrDefault(std::map< Key, Value > const &m, Key const &k, Value const &defaultValue)
Definition: Map.h:28
tuple msg
Definition: mps_check.py:278
void edm::JobReport::eventReadFromFile ( InputType  inputType,
JobReport::Token  fileToken 
)

Report that an event has been read from the file identified by the given Token.

Definition at line 394 of file JobReport.cc.

References f, impl_, and edm::JobReport::InputFile::numEventsRead.

394  {
395  JobReport::InputFile& f = impl_->getInputFileForToken(inputType, fileToken);
396  ++f.numEventsRead;
397  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
double f[11][100]
void edm::JobReport::eventWrittenToFile ( JobReport::Token  fileToken,
RunNumber_t  run,
EventNumber_t  event 
)

Report that the event with the given id has been written to the file identified by the given Token.

Definition at line 460 of file JobReport.cc.

References f, impl_, and edm::JobReport::OutputFile::numEventsWritten.

Referenced by NanoAODOutputModule::write().

460  {
461  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
462  ++f.numEventsWritten;
463  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
double f[11][100]
edm::propagate_const<std::unique_ptr<JobReportImpl> >& edm::JobReport::impl ( )
inlineprotected

Definition at line 431 of file JobReport.h.

References impl_.

Referenced by edm::service::JobReportService::frameworkShutdownOnFailure(), and edm::service::JobReportService::postEndJob().

431 {return impl_;}
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
void edm::JobReport::inputFileClosed ( InputType  inputType,
JobReport::Token  fileToken 
)

Report that the input file identified by the given Token has been closed. An exception will be thrown if the given Token was not obtained from inputFileOpened.

Definition at line 406 of file JobReport.cc.

References f, edm::JobReport::InputFile::fileHasBeenClosed, impl_, CommonMethods::lock(), edm::Primary, and write_mutex.

Referenced by DQMRootSource::closeFile_().

406  {
407  JobReport::InputFile& f = impl_->getInputFileForToken(inputType, fileToken);
408  f.fileHasBeenClosed = true;
409  if(inputType == InputType::Primary) {
410  impl_->writeInputFile(f);
411  } else {
412  {
413  std::lock_guard<std::mutex> lock(write_mutex);
414  impl_->writeInputFile(f);
415  }
416  }
417  }
std::mutex write_mutex
Definition: JobReport.h:435
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
double f[11][100]
JobReport::Token edm::JobReport::inputFileOpened ( std::string const &  physicalFileName,
std::string const &  logicalFileName,
std::string const &  catalog,
std::string const &  inputType,
std::string const &  inputSourceClassName,
std::string const &  moduleLabel,
std::string const &  guid,
std::vector< std::string > const &  branchNames 
)

Report that an input file has been opened. The returned Token should be used for later identification of this file.

Definition at line 346 of file JobReport.cc.

References edm::JobReport::InputFile::branchNames, getEcalConditions_orcoffint2r_cff::catalog, edm::JobReport::InputFile::catalog, edm::JobReport::InputFile::fileHasBeenClosed, edm::JobReport::InputFile::guid, impl_, ElectronMcFakePostValidator_cfi::InputFile, edm::JobReport::InputFile::inputSourceClassName, edm::JobReport::InputFile::inputType, edm::JobReport::InputFile::logicalFileName, edm::JobReport::InputFile::moduleLabel, edm::JobReport::InputFile::numEventsRead, edm::JobReport::InputFile::physicalFileName, edm::Primary, edm::SecondaryFile, and edm::SecondarySource.

Referenced by DQMRootSource::readFile_().

353  {
354 
355  InputType theInputType = InputType::Primary;
356  InputFile* newFile = nullptr;
357  JobReport::Token newToken = 0;
358 
359  if (inputType == "mixingFiles") {
360  theInputType = InputType::SecondarySource;
361  auto itr = impl_->inputFilesSecSource_.push_back(InputFile());
362  newFile = &(*itr);
363  newToken = itr - impl_->inputFilesSecSource_.begin();
364  } else {
365  if (inputType == "secondaryFiles") {
366  theInputType = InputType::SecondaryFile;
367  }
368  impl_->inputFiles_.emplace_back();
369  newFile = &impl_->inputFiles_.back();
370  newToken = impl_->inputFiles_.size() - 1;
371  }
372 
373  if(theInputType == InputType::Primary) {
374  impl_->lastOpenedPrimaryInputFile_ = impl_->inputFiles_.size() - 1;
375  }
376  newFile->logicalFileName = logicalFileName;
377  newFile->physicalFileName = physicalFileName;
378  newFile->catalog = catalog;
379  newFile->inputType = inputType;
380  newFile->inputSourceClassName = inputSourceClassName;
381  newFile->moduleLabel = moduleLabel;
382  newFile->guid = guid;
383  newFile->numEventsRead = 0;
384  newFile->branchNames = branchNames;
385  newFile->fileHasBeenClosed = false;
386 
387  // Add the new input file token to all output files
388  // currently open.
389  impl_->insertInputForOutputs(theInputType, newToken);
390  return newToken;
391  }
InputType
Definition: InputType.h:5
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
std::size_t Token
Definition: JobReport.h:107
JobReport& edm::JobReport::operator= ( JobReport const &  )
delete
void edm::JobReport::outputFileClosed ( JobReport::Token  fileToken)

Report that the output file identified by the given Token has been closed. An exception will be thrown if the given Token was not obtained from outputFileOpened.

Definition at line 466 of file JobReport.cc.

References f, edm::JobReport::OutputFile::fileHasBeenClosed, and impl_.

Referenced by DQMRootOutputModule::finishEndFile(), and NanoAODOutputModule::reallyCloseFile().

466  {
467  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
468  f.fileHasBeenClosed = true;
469  impl_->writeOutputFile(f);
470  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
double f[11][100]
JobReport::Token edm::JobReport::outputFileOpened ( std::string const &  physicalFileName,
std::string const &  logicalFileName,
std::string const &  catalog,
std::string const &  outputModuleClassName,
std::string const &  moduleLabel,
std::string const &  guid,
std::string const &  dataType,
std::string const &  branchHash,
std::vector< std::string > const &  branchNames 
)

Report that an output file has been opened. The returned Token should be used for later identification of this file.

Definition at line 420 of file JobReport.cc.

References edm::JobReport::OutputFile::branchHash, edm::JobReport::OutputFile::branchNames, getEcalConditions_orcoffint2r_cff::catalog, edm::JobReport::OutputFile::catalog, edm::JobReport::OutputFile::contributingInputs, edm::JobReport::OutputFile::contributingInputsSecSource, MergeFilesAndCalculateEfficiencies_cfg::dataType, edm::JobReport::OutputFile::dataType, edm::JobReport::OutputFile::fileHasBeenClosed, edm::JobReport::OutputFile::guid, mps_fire::i, impl_, edm::JobReport::OutputFile::logicalFileName, edm::JobReport::OutputFile::moduleLabel, edm::JobReport::OutputFile::numEventsWritten, edm::JobReport::OutputFile::outputModuleClassName, edm::JobReport::OutputFile::physicalFileName, and alignCSCRings::r.

Referenced by DQMRootOutputModule::openFile().

428  {
429  auto itr = impl_->outputFiles_.emplace_back();
430  JobReport::OutputFile& r = *itr;
431 
432  r.logicalFileName = logicalFileName;
433  r.physicalFileName = physicalFileName;
434  r.catalog = catalog;
435  r.outputModuleClassName = outputModuleClassName;
436  r.moduleLabel = moduleLabel;
437  r.guid = guid;
438  r.dataType = dataType;
439  r.branchHash = branchHash;
440  r.numEventsWritten = 0;
441  r.branchNames = branchNames;
442  r.fileHasBeenClosed = false;
443  //
444  // Init list of contributors to list of open input file Tokens
445  //
446  for(std::vector<Token>::size_type i = 0, iEnd = impl_->inputFiles_.size(); i < iEnd; ++i) {
447  if(!impl_->inputFiles_[i].fileHasBeenClosed) {
448  r.contributingInputs.push_back(i);
449  }
450  }
451  for(tbb::concurrent_vector<Token>::size_type i = 0, iEnd = impl_->inputFilesSecSource_.size(); i < iEnd; ++i) {
452  if(!impl_->inputFilesSecSource_[i].fileHasBeenClosed) {
453  r.contributingInputsSecSource.push_back(i);
454  }
455  }
456  return itr - impl_->outputFiles_.begin();
457  }
uint16_t size_type
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
void edm::JobReport::reportAnalysisFile ( std::string const &  fileName,
std::map< std::string, std::string > const &  fileData 
)

Definition at line 512 of file JobReport.cc.

References common_cff::doc, impl_, CommonMethods::lock(), mps_check::msg, and write_mutex.

Referenced by TFileService::afterBeginJob(), DQMStoreStats::calcstats(), AlcaBeamSpotHarvester::endRun(), PCLMetadataWriter::endRun(), DQMFileSaver::saveJobReport(), and dqm::DQMFileSaverBase::saveJobReport().

512  {
513  tinyxml2::XMLDocument doc;
514  if(impl_->ost_) {
515  std::ostream& msg = *(impl_->ost_);
516  {
517  std::lock_guard<std::mutex> lock(write_mutex);
518  msg << "<AnalysisFile>\n"
519  << " <FileName>" << doc.NewText(fileName.c_str())->Value() << "</FileName>\n";
520 
521  typedef std::map<std::string, std::string>::const_iterator const_iterator;
522  for(const_iterator pos = fileData.begin(), posEnd = fileData.end(); pos != posEnd; ++pos) {
523  msg << " <" << pos->first
524  << " Value=\"" << pos->second << "\" />"
525  << "\n";
526  }
527  msg << "</AnalysisFile>\n";
528  msg << std::flush;
529  }
530  }
531  }
std::mutex write_mutex
Definition: JobReport.h:435
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
reco::JetExtendedAssociation::JetExtendedData Value
tuple msg
Definition: mps_check.py:278
void edm::JobReport::reportDataType ( Token  fileToken,
std::string const &  dataType 
)

Report the data type of a file after it has been opened Needed since the data type isn't known until an event has been read

Definition at line 400 of file JobReport.cc.

References MergeFilesAndCalculateEfficiencies_cfg::dataType, edm::JobReport::OutputFile::dataType, f, and impl_.

400  {
401  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
402  f.dataType = dataType;
403  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
double f[11][100]
void edm::JobReport::reportError ( std::string const &  shortDesc,
std::string const &  longDesc,
int const &  exitCode 
)

Report an exception, providing details of the problem as a short description (Eg "XXXError") and a long description (Eg "XXX crashed because...") Also overload this method to accept an optional standard exit code

Definition at line 534 of file JobReport.cc.

References impl_, CommonMethods::lock(), mps_check::msg, and write_mutex.

Referenced by edm::printCmsException().

536  {
537  if(impl_->ost_) {
538  {
539  std::lock_guard<std::mutex> lock(write_mutex);
540  std::ostream& msg = *(impl_->ost_);
541  msg << "<FrameworkError ExitStatus=\""<< exitCode
542  << "\" Type=\"" << shortDesc << "\" >\n";
543  msg << "<![CDATA[\n" << longDesc << "\n]]>\n";
544  msg << "</FrameworkError>\n";
545  msg << std::flush;
546  }
547  }
548  }
std::mutex write_mutex
Definition: JobReport.h:435
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
tuple msg
Definition: mps_check.py:278
void edm::JobReport::reportFallbackAttempt ( std::string const &  pfn,
std::string const &  lfn,
std::string const &  err 
)

Definition at line 570 of file JobReport.cc.

References common_cff::doc, trackingPlots::fallback, impl_, CommonMethods::lock(), mps_check::msg, and write_mutex.

570  {
571  if(impl_->ost_) {
572  std::ostream& msg = *(impl_->ost_);
573  tinyxml2::XMLDocument doc;
574  tinyxml2::XMLPrinter printer;
575  tinyxml2::XMLElement * fallback = doc.NewElement("FallbackAttempt");
576  fallback->SetAttribute("Pfn", pfn.c_str());
577  fallback->SetAttribute("Lfn", lfn.c_str());
578  {
579  std::lock_guard<std::mutex> lock(write_mutex);
580  fallback->Accept(&printer);
581  msg << printer.CStr() ;
582  msg << "<![CDATA[\n" << err << "\n]]>\n";
583  msg << std::flush;
584  }
585  }
586  }
std::mutex write_mutex
Definition: JobReport.h:435
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
tuple msg
Definition: mps_check.py:278
void edm::JobReport::reportFastClonedBranches ( std::set< std::string > const &  fastClonedBranches,
long long  nEvents 
)

Inform the job report that branches have been fast Cloned.

Definition at line 677 of file JobReport.cc.

References impl_, and nEvents.

677  {
678  std::set<std::string>& clonedBranches = impl_->inputFiles_.at(impl_->lastOpenedPrimaryInputFile_).fastClonedBranches;
679  for(std::set<std::string>::const_iterator it = fastClonedBranches.begin(), itEnd = fastClonedBranches.end();
680  it != itEnd; ++it) {
681  if(clonedBranches.insert(*it).second) {
682  impl_->readBranches_[*it] += nEvents;
683  }
684  }
685  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
UInt_t nEvents
Definition: hcalCalib.cc:42
void edm::JobReport::reportFastCopyingStatus ( JobReport::Token  fileToken,
std::string const &  inputFileName,
bool  fastCopying 
)

Definition at line 486 of file JobReport.cc.

References f, edm::JobReport::OutputFile::fastCopyingInputs, and impl_.

486  {
487  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
488  f.fastCopyingInputs.insert(std::make_pair(inputFileName, fastCopying));
489  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
double f[11][100]
void edm::JobReport::reportInputLumiSection ( unsigned int  run,
unsigned int  lumiSectId 
)

API for reporting a Lumi Section to the job report. for input files, call only if lumi section is physically read from the input file

Definition at line 497 of file JobReport.cc.

References impl_.

Referenced by dqmservices::DQMProtobufReader::readLuminosityBlock_(), and DQMRootSource::readLuminosityBlock_().

497  {
498  impl_->associateInputLumiSection(run, lumiSectId);
499  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
void edm::JobReport::reportInputRunNumber ( unsigned int  run)

API to report a run read from input

Definition at line 507 of file JobReport.cc.

References impl_.

Referenced by DQMRootSource::readRun_().

507  {
508  impl_->associateInputRun(run);
509  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
void edm::JobReport::reportLumiSection ( JobReport::Token  token,
unsigned int  run,
unsigned int  lumiSectId,
unsigned long  nEvents = 0 
)

API for reporting a Lumi Section to the job report. for output files, call only if lumi section is written to the output file

Definition at line 492 of file JobReport.cc.

References impl_.

Referenced by NanoAODOutputModule::writeLuminosityBlock(), and DQMRootOutputModule::writeLuminosityBlock().

492  {
493  impl_->associateLumiSection(token, run, lumiSectId,nEvents);
494  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
UInt_t nEvents
Definition: hcalCalib.cc:42
void edm::JobReport::reportMemoryInfo ( std::vector< std::string > const &  memoryData)

Report Memory statistics ALTERNATE FORM - USING THIS MAY NECESSITATE CHANGES IN PARSING XML! Invoked by the Memory service to send an end of job summary about memory usage for inclusion in the job report

Definition at line 589 of file JobReport.cc.

References impl_, and mps_check::msg.

589  {
590  if(impl_->ost_) {
591  std::ostream& msg = *(impl_->ost_);
592  msg << "<MemoryService>\n";
593 
594  typedef std::vector<std::string>::const_iterator const_iterator;
595  for(const_iterator pos = memoryData.begin(), posEnd = memoryData.end(); pos != posEnd; ++pos) {
596  msg << *pos << "\n";
597  }
598  msg << "</MemoryService>\n";
599  msg << std::flush;
600  }
601  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
tuple msg
Definition: mps_check.py:278
void edm::JobReport::reportMessageInfo ( std::map< std::string, double > const &  messageData)

Report Message statistics Invoked by the MessageLogger service to send an end of job summary about numbers of various categories messages issued for inclusion in the job report

Definition at line 604 of file JobReport.cc.

References impl_, and mps_check::msg.

Referenced by edm::service::MessageLogger::SummarizeInJobReport().

604  {
605  if(impl_->ost_) {
606  std::ostream& msg = *(impl_->ost_);
607  msg << "<MessageSummary>\n";
608  typedef std::map<std::string, double>::const_iterator const_iterator;
609  for(const_iterator pos = messageData.begin(), posEnd = messageData.end(); pos != posEnd; ++pos) {
610  msg << " <" << pos->first
611  << " Value=\"" << pos->second << "\" />"
612  << "\n";
613  }
614  msg << "</MessageSummary>\n";
615  msg << std::flush;
616  }
617  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
tuple msg
Definition: mps_check.py:278
void edm::JobReport::reportPerformanceForModule ( std::string const &  metricClass,
std::string const &  moduleName,
std::map< std::string, std::string > const &  metrics 
)

Definition at line 723 of file JobReport.cc.

References impl_, mps_check::msg, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by XrdAdaptor::XrdStatisticsService::postEndJob().

725  {
726  if(impl_->ost_) {
727  std::ostream& msg = *(impl_->ost_);
728  msg << "<PerformanceReport>\n"
729  << " <PerformanceModule Metric=\"" << metricClass << "\" "
730  << " Module=\"" << moduleName << "\" >\n";
731 
732  typedef std::map<std::string, std::string>::const_iterator const_iterator;
733  for(const_iterator iter = metrics.begin(), iterEnd = metrics.end(); iter != iterEnd; ++iter) {
734  msg << " <Metric Name=\"" << iter->first << "\" "
735  << "Value=\"" << iter->second << "\"/>\n";
736  }
737 
738  msg << " </PerformanceModule>\n"
739  << "</PerformanceReport>\n";
740  msg << std::flush;
741  //LogInfo("FwkJob") << msg.str();
742  }
743  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
std::string moduleName(Provenance const &provenance)
Definition: Provenance.cc:27
tuple msg
Definition: mps_check.py:278
void edm::JobReport::reportPerformanceSummary ( std::string const &  metricClass,
std::map< std::string, std::string > const &  metrics 
)

Performance Reports

Two categories: Summary for entire job and module for a specific module Each one requires a performance metric class such as Timing, Memory, CPU, Trigger etc.

Definition at line 702 of file JobReport.cc.

References impl_, and mps_check::msg.

Referenced by TFileAdaptor::termination().

703  {
704  if(impl_->ost_) {
705  std::ostream& msg = *(impl_->ost_);
706  msg << "<PerformanceReport>\n"
707  << " <PerformanceSummary Metric=\"" << metricClass << "\">\n";
708 
709  typedef std::map<std::string, std::string>::const_iterator const_iterator;
710  for(const_iterator iter = metrics.begin(), iterEnd = metrics.end(); iter != iterEnd; ++iter) {
711  msg << " <Metric Name=\"" << iter->first << "\" "
712  << "Value=\"" << iter->second << "\"/>\n";
713  }
714 
715  msg << " </PerformanceSummary>\n"
716  << "</PerformanceReport>\n";
717  msg << std::flush;
718  //LogInfo("FwkJob") << msg.str();
719  }
720  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
tuple msg
Definition: mps_check.py:278
void edm::JobReport::reportRandomStateFile ( std::string const &  name)

Report the name of the random engine persistency file

Definition at line 687 of file JobReport.cc.

References common_cff::doc, impl_, CommonMethods::lock(), mps_check::msg, and write_mutex.

687  {
688  tinyxml2::XMLDocument doc;
689  if(impl_->ost_) {
690  std::ostream& msg = *(impl_->ost_);
691  {
692  std::lock_guard<std::mutex> lock(write_mutex);
693  msg << "<RandomServiceStateFile>\n"
694  << doc.NewText(name.c_str())->Value() << "\n"
695  << "</RandomServiceStateFile>\n";
696  msg << std::flush;
697  }
698  }
699  }
std::mutex write_mutex
Definition: JobReport.h:435
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
reco::JetExtendedAssociation::JetExtendedData Value
tuple msg
Definition: mps_check.py:278
void edm::JobReport::reportReadBranch ( InputType  inputType,
std::string const &  branchName 
)

Inform the job report that a branch has been read.

Definition at line 662 of file JobReport.cc.

References electrons_cff::branchName, impl_, edm::Primary, edm::SecondaryFile, and edm::SecondarySource.

662  {
663  if(inputType == InputType::Primary) {
664  // Fast cloned branches have already been reported.
665  std::set<std::string> const& clonedBranches = impl_->inputFiles_.at(impl_->lastOpenedPrimaryInputFile_).fastClonedBranches;
666  if(clonedBranches.find(branchName) == clonedBranches.end()) {
667  ++impl_->readBranches_[branchName];
668  }
669  } else if (inputType == InputType::SecondaryFile) {
670  ++impl_->readBranchesSecFile_[branchName];
671  } else if (inputType == InputType::SecondarySource) {
672  ++impl_->readBranchesSecSource_[branchName].value();
673  }
674  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
void edm::JobReport::reportReadBranches ( )

Report read branches Invoked by the source that reads ROOT/EDM files at the end of a job to report which product branches in the Events tree have been read, with a count of the number of events for which the branch was read.

Definition at line 620 of file JobReport.cc.

References MicroEventContent_cff::branch, common_cff::doc, and impl_.

620  {
621  if(impl_->printedReadBranches_) return;
622  impl_->printedReadBranches_ = true;
623  if(impl_->ost_) {
624  std::ostream& ost = *(impl_->ost_);
625  ost << "<ReadBranches>\n";
626  tinyxml2::XMLDocument doc;
627  tinyxml2::XMLPrinter printer;
628  for(auto const& iBranch : impl_->readBranches_) {
629  tinyxml2::XMLElement * branch = doc.NewElement("Branch");
630  branch->SetAttribute("Name", iBranch.first.c_str());
631  branch->SetAttribute("ReadCount", int64_t(iBranch.second));
632  branch->Accept(&printer);
633  ost << printer.CStr();
634  printer.ClearBuffer();
635  }
636  for(auto const& iBranch : impl_->readBranchesSecFile_) {
637  tinyxml2::XMLElement * branch = doc.NewElement("Branch");
638  branch->SetAttribute("Name", iBranch.first.c_str());
639  branch->SetAttribute("ReadCount", int64_t(iBranch.second));
640  branch->Accept(&printer);
641  ost << printer.CStr();
642  printer.ClearBuffer();
643  }
644  ost << "</ReadBranches>\n";
645  if(!impl_->readBranchesSecSource_.empty()) {
646  ost << "<SecondarySourceReadBranches>\n";
647  for(auto const& iBranch : impl_->readBranchesSecSource_) {
648  tinyxml2::XMLElement * branch = doc.NewElement("Branch");
649  branch->SetAttribute("Name", iBranch.first.c_str());
650  branch->SetAttribute("ReadCount", int64_t(iBranch.second.value().load()));
651  branch->Accept(&printer);
652  ost << printer.CStr();
653  printer.ClearBuffer();
654  }
655  ost << "</SecondarySourceReadBranches>\n";
656  }
657  ost << std::flush;
658  }
659  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
void edm::JobReport::reportRunNumber ( JobReport::Token  token,
unsigned int  run 
)

API for reporting a Run to the job report. for output files, call only if Run is written to the output file

Definition at line 502 of file JobReport.cc.

References impl_.

Referenced by NanoAODOutputModule::writeRun(), and DQMRootOutputModule::writeRun().

502  {
503  impl_->associateRun(token, run);
504  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
void edm::JobReport::reportSkippedEvent ( RunNumber_t  run,
EventNumber_t  event 
)

Definition at line 473 of file JobReport.cc.

References impl_, CommonMethods::lock(), mps_check::msg, and write_mutex.

473  {
474  if(impl_->ost_) {
475  std::ostream& msg = *(impl_->ost_);
476  {
477  std::lock_guard<std::mutex> lock(write_mutex);
478  msg << "<SkippedEvent Run=\"" << run << "\"";
479  msg << " Event=\"" << event << "\" />\n";
480  msg << std::flush;
481  }
482  }
483  }
std::mutex write_mutex
Definition: JobReport.h:435
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
tuple msg
Definition: mps_check.py:278
void edm::JobReport::reportSkippedFile ( std::string const &  pfn,
std::string const &  lfn 
)

Report Skipped File

Report that a file has been skipped due to it not being found.

Definition at line 551 of file JobReport.cc.

References common_cff::doc, impl_, CommonMethods::lock(), mps_check::msg, runEdmFileComparison::skipped, and write_mutex.

552  {
553  if(impl_->ost_) {
554  std::ostream& msg = *(impl_->ost_);
555  tinyxml2::XMLDocument doc;
556  tinyxml2::XMLPrinter printer;
557  tinyxml2::XMLElement * skipped = doc.NewElement("SkippedFile");
558  skipped->SetAttribute("Pfn", pfn.c_str());
559  skipped->SetAttribute("Lfn", lfn.c_str());
560  {
561  std::lock_guard<std::mutex> lock(write_mutex);
562  skipped->Accept(&printer);
563  msg << printer.CStr() ;
564  msg << std::flush;
565  }
566  }
567  }
std::mutex write_mutex
Definition: JobReport.h:435
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:434
tuple msg
Definition: mps_check.py:278

Member Data Documentation

edm::propagate_const<std::unique_ptr<JobReportImpl> > edm::JobReport::impl_
private
std::mutex edm::JobReport::write_mutex
private