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

void childAfterFork (std::string const &jobReportFile, unsigned int childIndex, unsigned int numberOfChildren)
 New output file for child. More...
 
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 parentAfterFork (std::string const &jobReportFile)
 
void parentBeforeFork (std::string const &jobReportFile, unsigned int numberOfChildren)
 
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 330 of file JobReport.cc.

330  :
331  impl_(new JobReportImpl(0)) {
332  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
edm::JobReport::JobReport ( std::ostream *  outputStream)

Definition at line 334 of file JobReport.cc.

References objects.autophobj::filler, impl_, PFRecoTauDiscriminationByIsolation_cfi::offset, AlCaHLTBitMon_QueryRunRegistry::string, and mitigatedMETSequence_cff::U.

334  : impl_(new JobReportImpl(iOstream)) {
335  if(impl_->ost_) {
336  *(impl_->ost_) << "<FrameworkJobReport>\n";
337  }
338  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
edm::JobReport::JobReport ( JobReport const &  )
delete
edm::JobReport::~JobReport ( )

Definition at line 323 of file JobReport.cc.

References impl_.

323  {
324  impl_->flushFiles();
325  if(impl_->ost_) {
326  *(impl_->ost_) << "</FrameworkJobReport>\n" << std::flush;
327  }
328  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441

Member Function Documentation

void edm::JobReport::childAfterFork ( std::string const &  jobReportFile,
unsigned int  childIndex,
unsigned int  numberOfChildren 
)

New output file for child.

Definition at line 387 of file JobReport.cc.

References impl_, and AlCaHLTBitMon_ParallelJobs::p.

387  {
388  std::ofstream* p = dynamic_cast<std::ofstream*>(impl_->ost());
389  if(!p) return;
390  std::ostringstream ofilename;
391  toFileName(jobReportFile, childIndex, numberOfChildren, ofilename);
392  p->open(ofilename.str().c_str());
393  *p << "<FrameworkJobReport>\n";
394  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
std::string edm::JobReport::dumpFiles ( void  )

debug/test util

Definition at line 781 of file JobReport.cc.

References f, edm::findOrDefault(), impl_, and mps_alisetup::msg.

781  {
782  std::ostringstream msg;
783 
784 
785  for(auto const& f :impl_->outputFiles_) {
786 
787  msg << "\n<File>";
788  msg << f;
789 
790  msg << "\n<LumiSections>";
791  msg << "\n<Inputs>";
792  typedef std::vector<JobReport::Token>::iterator iterator;
793  for(auto const& iInput : f.contributingInputs) {
794  auto const& inpFile = impl_->inputFiles_[iInput];
795  msg << "\n<Input>";
796  msg << "\n <LFN>" << TiXmlText(inpFile.logicalFileName) << "</LFN>";
797  msg << "\n <PFN>" << TiXmlText(inpFile.physicalFileName) << "</PFN>";
798  msg << "\n <FastCopying>" << findOrDefault(f.fastCopyingInputs, inpFile.physicalFileName) << "</FastCopying>";
799  msg << "\n</Input>";
800  }
801  msg << "\n</Inputs>";
802  msg << "\n</File>";
803 
804  }
805  return msg.str();
806  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
double f[11][100]
Value const & findOrDefault(std::map< Key, Value > const &m, Key const &k, Value const &defaultValue)
Definition: Map.h:28
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 445 of file JobReport.cc.

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

445  {
446  JobReport::InputFile& f = impl_->getInputFileForToken(inputType, fileToken);
447  ++f.numEventsRead;
448  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
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 511 of file JobReport.cc.

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

511  {
512  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
513  ++f.numEventsWritten;
514  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
double f[11][100]
edm::propagate_const<std::unique_ptr<JobReportImpl> >& edm::JobReport::impl ( )
inlineprotected

Definition at line 438 of file JobReport.h.

References impl_.

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

438 {return impl_;}
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
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 457 of file JobReport.cc.

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

Referenced by DQMRootSource::closeFile_().

457  {
458  JobReport::InputFile& f = impl_->getInputFileForToken(inputType, fileToken);
459  f.fileHasBeenClosed = true;
460  if(inputType == InputType::Primary) {
461  impl_->writeInputFile(f);
462  } else {
463  {
464  std::lock_guard<std::mutex> lock(write_mutex);
465  impl_->writeInputFile(f);
466  }
467  }
468  }
std::mutex write_mutex
Definition: JobReport.h:442
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
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 397 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_().

404  {
405 
406  InputType theInputType = InputType::Primary;
407  InputFile* newFile = nullptr;
408  JobReport::Token newToken = 0;
409 
410  if (inputType == "mixingFiles") {
411  theInputType = InputType::SecondarySource;
412  auto itr = impl_->inputFilesSecSource_.push_back(InputFile());
413  newFile = &(*itr);
414  newToken = itr - impl_->inputFilesSecSource_.begin();
415  } else {
416  if (inputType == "secondaryFiles") {
417  theInputType = InputType::SecondaryFile;
418  }
419  impl_->inputFiles_.emplace_back();
420  newFile = &impl_->inputFiles_.back();
421  newToken = impl_->inputFiles_.size() - 1;
422  }
423 
424  if(theInputType == InputType::Primary) {
425  impl_->lastOpenedPrimaryInputFile_ = impl_->inputFiles_.size() - 1;
426  }
427  newFile->logicalFileName = logicalFileName;
428  newFile->physicalFileName = physicalFileName;
429  newFile->catalog = catalog;
430  newFile->inputType = inputType;
431  newFile->inputSourceClassName = inputSourceClassName;
432  newFile->moduleLabel = moduleLabel;
433  newFile->guid = guid;
434  newFile->numEventsRead = 0;
435  newFile->branchNames = branchNames;
436  newFile->fileHasBeenClosed = false;
437 
438  // Add the new input file token to all output files
439  // currently open.
440  impl_->insertInputForOutputs(theInputType, newToken);
441  return newToken;
442  }
InputType
Definition: InputType.h:5
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
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 517 of file JobReport.cc.

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

Referenced by DQMRootOutputModule::finishEndFile().

517  {
518  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
519  f.fileHasBeenClosed = true;
520  impl_->writeOutputFile(f);
521  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
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 471 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().

479  {
480  auto itr = impl_->outputFiles_.emplace_back();
481  JobReport::OutputFile& r = *itr;
482 
483  r.logicalFileName = logicalFileName;
484  r.physicalFileName = physicalFileName;
485  r.catalog = catalog;
486  r.outputModuleClassName = outputModuleClassName;
487  r.moduleLabel = moduleLabel;
488  r.guid = guid;
489  r.dataType = dataType;
490  r.branchHash = branchHash;
491  r.numEventsWritten = 0;
492  r.branchNames = branchNames;
493  r.fileHasBeenClosed = false;
494  //
495  // Init list of contributors to list of open input file Tokens
496  //
497  for(std::vector<Token>::size_type i = 0, iEnd = impl_->inputFiles_.size(); i < iEnd; ++i) {
498  if(!impl_->inputFiles_[i].fileHasBeenClosed) {
499  r.contributingInputs.push_back(i);
500  }
501  }
502  for(tbb::concurrent_vector<Token>::size_type i = 0, iEnd = impl_->inputFilesSecSource_.size(); i < iEnd; ++i) {
503  if(!impl_->inputFilesSecSource_[i].fileHasBeenClosed) {
504  r.contributingInputsSecSource.push_back(i);
505  }
506  }
507  return itr - impl_->outputFiles_.begin();
508  }
uint16_t size_type
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
void edm::JobReport::parentAfterFork ( std::string const &  jobReportFile)

Definition at line 383 of file JobReport.cc.

383  {
384  }
void edm::JobReport::parentBeforeFork ( std::string const &  jobReportFile,
unsigned int  numberOfChildren 
)

Definition at line 365 of file JobReport.cc.

References mps_fire::i, impl_, and AlCaHLTBitMon_ParallelJobs::p.

365  {
366  if(impl_->ost_) {
367  *(impl_->ost_) << "<ChildProcessFiles>\n";
368  for(unsigned int i = 0; i < numberOfChildren; ++i) {
369  std::ostringstream ofilename;
370  toFileName(jobReportFile, i, numberOfChildren, ofilename);
371  *(impl_->ost_) << " <ChildProcessFile>" << ofilename.str() << "</ChildProcessFile>\n";
372  }
373  *(impl_->ost_) << "</ChildProcessFiles>\n";
374  *(impl_->ost_) << "</FrameworkJobReport>\n";
375  std::ofstream* p = dynamic_cast<std::ofstream *>(impl_->ost());
376  if(p) {
377  p->close();
378  }
379  }
380  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
void edm::JobReport::reportAnalysisFile ( std::string const &  fileName,
std::map< std::string, std::string > const &  fileData 
)

Definition at line 563 of file JobReport.cc.

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

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

563  {
564  if(impl_->ost_) {
565  std::ostream& msg = *(impl_->ost_);
566  {
567  std::lock_guard<std::mutex> lock(write_mutex);
568  msg << "<AnalysisFile>\n"
569  << " <FileName>" << TiXmlText(fileName) << "</FileName>\n";
570 
571  typedef std::map<std::string, std::string>::const_iterator const_iterator;
572  for(const_iterator pos = fileData.begin(), posEnd = fileData.end(); pos != posEnd; ++pos) {
573  msg << " <" << pos->first
574  << " Value=\"" << pos->second << "\" />"
575  << "\n";
576  }
577  msg << "</AnalysisFile>\n";
578  msg << std::flush;
579  }
580  }
581  }
std::mutex write_mutex
Definition: JobReport.h:442
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
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 451 of file JobReport.cc.

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

451  {
452  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
453  f.dataType = dataType;
454  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
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 584 of file JobReport.cc.

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

Referenced by edm::printCmsException().

586  {
587  if(impl_->ost_) {
588  {
589  std::lock_guard<std::mutex> lock(write_mutex);
590  std::ostream& msg = *(impl_->ost_);
591  msg << "<FrameworkError ExitStatus=\""<< exitCode
592  << "\" Type=\"" << shortDesc << "\" >\n";
593  msg << "<![CDATA[\n" << longDesc << "\n]]>\n";
594  msg << "</FrameworkError>\n";
595  msg << std::flush;
596  }
597  }
598  }
std::mutex write_mutex
Definition: JobReport.h:442
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
void edm::JobReport::reportFallbackAttempt ( std::string const &  pfn,
std::string const &  lfn,
std::string const &  err 
)

Definition at line 617 of file JobReport.cc.

References trackingPlots::fallback, impl_, CommonMethods::lock(), mps_alisetup::msg, and write_mutex.

617  {
618  if(impl_->ost_) {
619  std::ostream& msg = *(impl_->ost_);
620  TiXmlElement fallback("FallbackAttempt");
621  fallback.SetAttribute("Pfn", pfn);
622  fallback.SetAttribute("Lfn", lfn);
623  {
624  std::lock_guard<std::mutex> lock(write_mutex);
625  msg << fallback << "\n";
626  msg << "<![CDATA[\n" << err << "\n]]>\n";
627  msg << std::flush;
628  }
629  }
630  }
std::mutex write_mutex
Definition: JobReport.h:442
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
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 713 of file JobReport.cc.

References impl_, and nEvents.

713  {
714  std::set<std::string>& clonedBranches = impl_->inputFiles_.at(impl_->lastOpenedPrimaryInputFile_).fastClonedBranches;
715  for(std::set<std::string>::const_iterator it = fastClonedBranches.begin(), itEnd = fastClonedBranches.end();
716  it != itEnd; ++it) {
717  if(clonedBranches.insert(*it).second) {
718  impl_->readBranches_[*it] += nEvents;
719  }
720  }
721  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
UInt_t nEvents
Definition: hcalCalib.cc:42
void edm::JobReport::reportFastCopyingStatus ( JobReport::Token  fileToken,
std::string const &  inputFileName,
bool  fastCopying 
)

Definition at line 537 of file JobReport.cc.

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

537  {
538  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
539  f.fastCopyingInputs.insert(std::make_pair(inputFileName, fastCopying));
540  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
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 548 of file JobReport.cc.

References impl_.

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

548  {
549  impl_->associateInputLumiSection(run, lumiSectId);
550  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
void edm::JobReport::reportInputRunNumber ( unsigned int  run)

API to report a run read from input

Definition at line 558 of file JobReport.cc.

References impl_.

Referenced by DQMRootSource::readRun_().

558  {
559  impl_->associateInputRun(run);
560  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
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 543 of file JobReport.cc.

References impl_.

Referenced by DQMRootOutputModule::writeLuminosityBlock().

543  {
544  impl_->associateLumiSection(token, run, lumiSectId,nEvents);
545  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
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 633 of file JobReport.cc.

References impl_, and mps_alisetup::msg.

633  {
634  if(impl_->ost_) {
635  std::ostream& msg = *(impl_->ost_);
636  msg << "<MemoryService>\n";
637 
638  typedef std::vector<std::string>::const_iterator const_iterator;
639  for(const_iterator pos = memoryData.begin(), posEnd = memoryData.end(); pos != posEnd; ++pos) {
640  msg << *pos << "\n";
641  }
642  msg << "</MemoryService>\n";
643  msg << std::flush;
644  }
645  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
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 648 of file JobReport.cc.

References impl_, and mps_alisetup::msg.

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

648  {
649  if(impl_->ost_) {
650  std::ostream& msg = *(impl_->ost_);
651  msg << "<MessageSummary>\n";
652  typedef std::map<std::string, double>::const_iterator const_iterator;
653  for(const_iterator pos = messageData.begin(), posEnd = messageData.end(); pos != posEnd; ++pos) {
654  msg << " <" << pos->first
655  << " Value=\"" << pos->second << "\" />"
656  << "\n";
657  }
658  msg << "</MessageSummary>\n";
659  msg << std::flush;
660  }
661  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
void edm::JobReport::reportPerformanceForModule ( std::string const &  metricClass,
std::string const &  moduleName,
std::map< std::string, std::string > const &  metrics 
)

Definition at line 758 of file JobReport.cc.

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

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

760  {
761  if(impl_->ost_) {
762  std::ostream& msg = *(impl_->ost_);
763  msg << "<PerformanceReport>\n"
764  << " <PerformanceModule Metric=\"" << metricClass << "\" "
765  << " Module=\"" << moduleName << "\" >\n";
766 
767  typedef std::map<std::string, std::string>::const_iterator const_iterator;
768  for(const_iterator iter = metrics.begin(), iterEnd = metrics.end(); iter != iterEnd; ++iter) {
769  msg << " <Metric Name=\"" << iter->first << "\" "
770  << "Value=\"" << iter->second << "\"/>\n";
771  }
772 
773  msg << " </PerformanceModule>\n"
774  << "</PerformanceReport>\n";
775  msg << std::flush;
776  //LogInfo("FwkJob") << msg.str();
777  }
778  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
std::string moduleName(Provenance const &provenance)
Definition: Provenance.cc:27
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 737 of file JobReport.cc.

References impl_, and mps_alisetup::msg.

Referenced by TFileAdaptor::termination().

738  {
739  if(impl_->ost_) {
740  std::ostream& msg = *(impl_->ost_);
741  msg << "<PerformanceReport>\n"
742  << " <PerformanceSummary Metric=\"" << metricClass << "\">\n";
743 
744  typedef std::map<std::string, std::string>::const_iterator const_iterator;
745  for(const_iterator iter = metrics.begin(), iterEnd = metrics.end(); iter != iterEnd; ++iter) {
746  msg << " <Metric Name=\"" << iter->first << "\" "
747  << "Value=\"" << iter->second << "\"/>\n";
748  }
749 
750  msg << " </PerformanceSummary>\n"
751  << "</PerformanceReport>\n";
752  msg << std::flush;
753  //LogInfo("FwkJob") << msg.str();
754  }
755  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
void edm::JobReport::reportRandomStateFile ( std::string const &  name)

Report the name of the random engine persistency file

Definition at line 723 of file JobReport.cc.

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

723  {
724  if(impl_->ost_) {
725  std::ostream& msg = *(impl_->ost_);
726  {
727  std::lock_guard<std::mutex> lock(write_mutex);
728  msg << "<RandomServiceStateFile>\n"
729  << TiXmlText(name) << "\n"
730  << "</RandomServiceStateFile>\n";
731  msg << std::flush;
732  }
733  }
734  }
std::mutex write_mutex
Definition: JobReport.h:442
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
void edm::JobReport::reportReadBranch ( InputType  inputType,
std::string const &  branchName 
)

Inform the job report that a branch has been read.

Definition at line 698 of file JobReport.cc.

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

698  {
699  if(inputType == InputType::Primary) {
700  // Fast cloned branches have already been reported.
701  std::set<std::string> const& clonedBranches = impl_->inputFiles_.at(impl_->lastOpenedPrimaryInputFile_).fastClonedBranches;
702  if(clonedBranches.find(branchName) == clonedBranches.end()) {
703  ++impl_->readBranches_[branchName];
704  }
705  } else if (inputType == InputType::SecondaryFile) {
706  ++impl_->readBranchesSecFile_[branchName];
707  } else if (inputType == InputType::SecondarySource) {
708  ++impl_->readBranchesSecSource_[branchName].value();
709  }
710  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
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 664 of file JobReport.cc.

References impl_.

664  {
665  if(impl_->printedReadBranches_) return;
666  impl_->printedReadBranches_ = true;
667  if(impl_->ost_) {
668  std::ostream& ost = *(impl_->ost_);
669  ost << "<ReadBranches>\n";
670  for(auto const& iBranch : impl_->readBranches_) {
671  TiXmlElement branch("Branch");
672  branch.SetAttribute("Name", iBranch.first);
673  branch.SetAttribute("ReadCount", iBranch.second);
674  ost << branch << "\n";
675  }
676  for(auto const& iBranch : impl_->readBranchesSecFile_) {
677  TiXmlElement branch("Branch");
678  branch.SetAttribute("Name", iBranch.first);
679  branch.SetAttribute("ReadCount", iBranch.second);
680  ost << branch << "\n";
681  }
682  ost << "</ReadBranches>\n";
683  if(!impl_->readBranchesSecSource_.empty()) {
684  ost << "<SecondarySourceReadBranches>\n";
685  for(auto const& iBranch : impl_->readBranchesSecSource_) {
686  TiXmlElement branch("Branch");
687  branch.SetAttribute("Name", iBranch.first);
688  branch.SetAttribute("ReadCount", iBranch.second.value().load());
689  ost << branch << "\n";
690  }
691  ost << "</SecondarySourceReadBranches>\n";
692  }
693  ost << std::flush;
694  }
695  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
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 553 of file JobReport.cc.

References impl_.

Referenced by DQMRootOutputModule::writeRun().

553  {
554  impl_->associateRun(token, run);
555  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
void edm::JobReport::reportSkippedEvent ( RunNumber_t  run,
EventNumber_t  event 
)

Definition at line 524 of file JobReport.cc.

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

524  {
525  if(impl_->ost_) {
526  std::ostream& msg = *(impl_->ost_);
527  {
528  std::lock_guard<std::mutex> lock(write_mutex);
529  msg << "<SkippedEvent Run=\"" << run << "\"";
530  msg << " Event=\"" << event << "\" />\n";
531  msg << std::flush;
532  }
533  }
534  }
std::mutex write_mutex
Definition: JobReport.h:442
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
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 601 of file JobReport.cc.

References impl_, CommonMethods::lock(), mps_alisetup::msg, runEdmFileComparison::skipped, and write_mutex.

602  {
603  if(impl_->ost_) {
604  std::ostream& msg = *(impl_->ost_);
605  TiXmlElement skipped("SkippedFile");
606  skipped.SetAttribute("Pfn", pfn);
607  skipped.SetAttribute("Lfn", lfn);
608  {
609  std::lock_guard<std::mutex> lock(write_mutex);
610  msg << skipped << "\n";
611  msg << std::flush;
612  }
613  }
614  }
std::mutex write_mutex
Definition: JobReport.h:442
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441

Member Data Documentation

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