CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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, unsigned int run, unsigned int 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 (unsigned int run, unsigned int event)
 
void reportSkippedFile (std::string const &pfn, std::string const &lfn)
 
 ~JobReport ()
 

Protected Member Functions

boost::scoped_ptr
< JobReportImpl > & 
impl ()
 

Private Attributes

boost::scoped_ptr< JobReportImplimpl_
 
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 101 of file JobReport.h.

Member Typedef Documentation

typedef unsigned int edm::JobReport::RunNumber

Definition at line 104 of file JobReport.h.

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

Definition at line 105 of file JobReport.h.

Constructor & Destructor Documentation

edm::JobReport::JobReport ( )

Definition at line 331 of file JobReport.cc.

331  :
332  impl_(new JobReportImpl(0)) {
333  }
boost::scoped_ptr< JobReportImpl > impl_
Definition: JobReport.h:436
edm::JobReport::JobReport ( std::ostream *  outputStream)

Definition at line 335 of file JobReport.cc.

References impl_.

335  : impl_(new JobReportImpl(iOstream)) {
336  if(impl_->ost_) {
337  *(impl_->ost_) << "<FrameworkJobReport>\n";
338  }
339  }
boost::scoped_ptr< JobReportImpl > impl_
Definition: JobReport.h:436
edm::JobReport::JobReport ( JobReport const &  )
delete
edm::JobReport::~JobReport ( )

Definition at line 324 of file JobReport.cc.

References impl_.

324  {
325  impl_->flushFiles();
326  if(impl_->ost_) {
327  *(impl_->ost_) << "</FrameworkJobReport>\n" << std::flush;
328  }
329  }
boost::scoped_ptr< JobReportImpl > impl_
Definition: JobReport.h:436

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 388 of file JobReport.cc.

References impl_, and AlCaHLTBitMon_ParallelJobs::p.

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

debug/test util

Definition at line 782 of file JobReport.cc.

References f, edm::findOrDefault(), impl_, edm::JobReport::InputFile::logicalFileName, producerFileCleanner::msg, and edm::JobReport::InputFile::physicalFileName.

782  {
783  std::ostringstream msg;
784 
785  typedef std::vector<JobReport::OutputFile>::iterator iterator;
786 
787  for(iterator f = impl_->outputFiles_.begin(), fEnd = impl_->outputFiles_.end(); f != fEnd; ++f) {
788 
789  msg << "\n<File>";
790  msg << *f;
791 
792  msg << "\n<LumiSections>";
793  msg << "\n<Inputs>";
794  typedef std::vector<JobReport::Token>::iterator iterator;
795  for(iterator iInput = f->contributingInputs.begin(),
796  iInputEnd = f->contributingInputs.end();
797  iInput != iInputEnd; ++iInput) {
798  JobReport::InputFile inpFile = impl_->inputFiles_[*iInput];
799  msg << "\n<Input>";
800  msg << "\n <LFN>" << TiXmlText(inpFile.logicalFileName) << "</LFN>";
801  msg << "\n <PFN>" << TiXmlText(inpFile.physicalFileName) << "</PFN>";
802  msg << "\n <FastCopying>" << findOrDefault(f->fastCopyingInputs, inpFile.physicalFileName) << "</FastCopying>";
803  msg << "\n</Input>";
804  }
805  msg << "\n</Inputs>";
806  msg << "\n</File>";
807 
808  }
809  return msg.str();
810  }
tuple InputFile
Open Root file and provide MEs ############.
double f[11][100]
boost::scoped_ptr< JobReportImpl > impl_
Definition: JobReport.h:436
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 446 of file JobReport.cc.

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

446  {
447  JobReport::InputFile& f = impl_->getInputFileForToken(inputType, fileToken);
448  ++f.numEventsRead;
449  }
tuple InputFile
Open Root file and provide MEs ############.
double f[11][100]
boost::scoped_ptr< JobReportImpl > impl_
Definition: JobReport.h:436
void edm::JobReport::eventWrittenToFile ( JobReport::Token  fileToken,
unsigned int  run,
unsigned int  event 
)

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

Definition at line 512 of file JobReport.cc.

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

512  {
513  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
514  ++f.numEventsWritten;
515  }
double f[11][100]
boost::scoped_ptr< JobReportImpl > impl_
Definition: JobReport.h:436
boost::scoped_ptr<JobReportImpl>& edm::JobReport::impl ( )
inlineprotected

Definition at line 433 of file JobReport.h.

References impl_.

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

433 {return impl_;}
boost::scoped_ptr< JobReportImpl > impl_
Definition: JobReport.h:436
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 458 of file JobReport.cc.

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

Referenced by DQMRootSource::closeFile_().

458  {
459  JobReport::InputFile& f = impl_->getInputFileForToken(inputType, fileToken);
460  f.fileHasBeenClosed = true;
461  if(inputType == InputType::Primary) {
462  impl_->writeInputFile(f);
463  } else {
464  {
465  std::lock_guard<std::mutex> lock(write_mutex);
466  impl_->writeInputFile(f);
467  }
468  }
469  }
std::mutex write_mutex
Definition: JobReport.h:437
tuple InputFile
Open Root file and provide MEs ############.
double f[11][100]
boost::scoped_ptr< JobReportImpl > impl_
Definition: JobReport.h:436
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 398 of file JobReport.cc.

References edm::JobReport::InputFile::branchNames, validate_alignment_devdb10_cfg::catalog, edm::JobReport::InputFile::catalog, edm::JobReport::InputFile::fileHasBeenClosed, edm::JobReport::InputFile::guid, impl_, RPC_Client_on_RootFile::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_().

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

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

Referenced by DQMRootOutputModule::finishEndFile().

518  {
519  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
520  f.fileHasBeenClosed = true;
521  impl_->writeOutputFile(f);
522  }
double f[11][100]
boost::scoped_ptr< JobReportImpl > impl_
Definition: JobReport.h:436
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 472 of file JobReport.cc.

References edm::JobReport::OutputFile::branchHash, edm::JobReport::OutputFile::branchNames, validate_alignment_devdb10_cfg::catalog, edm::JobReport::OutputFile::catalog, edm::JobReport::OutputFile::contributingInputs, edm::JobReport::OutputFile::contributingInputsSecSource, dtTPAnalyzer_cfg::dataType, edm::JobReport::OutputFile::dataType, edm::JobReport::OutputFile::fileHasBeenClosed, edm::JobReport::OutputFile::guid, 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().

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

Definition at line 384 of file JobReport.cc.

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

Definition at line 366 of file JobReport.cc.

References i, impl_, and AlCaHLTBitMon_ParallelJobs::p.

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

Definition at line 564 of file JobReport.cc.

References impl_, fff_deleter::lock(), producerFileCleanner::msg, and write_mutex.

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

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

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

452  {
453  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
454  f.dataType = dataType;
455  }
double f[11][100]
boost::scoped_ptr< JobReportImpl > impl_
Definition: JobReport.h:436
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 585 of file JobReport.cc.

References impl_, fff_deleter::lock(), producerFileCleanner::msg, and write_mutex.

Referenced by edm::printCmsException(), and edm::printCmsExceptionWarning().

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

Definition at line 618 of file JobReport.cc.

References impl_, fff_deleter::lock(), producerFileCleanner::msg, TiXmlElement::SetAttribute(), and write_mutex.

618  {
619  if(impl_->ost_) {
620  std::ostream& msg = *(impl_->ost_);
621  TiXmlElement fallback("FallbackAttempt");
622  fallback.SetAttribute("Pfn", pfn);
623  fallback.SetAttribute("Lfn", lfn);
624  {
625  std::lock_guard<std::mutex> lock(write_mutex);
626  msg << fallback << "\n";
627  msg << "<![CDATA[\n" << err << "\n]]>\n";
628  msg << std::flush;
629  }
630  }
631  }
list pfn
Definition: dbtoconf.py:76
std::mutex write_mutex
Definition: JobReport.h:437
boost::scoped_ptr< JobReportImpl > impl_
Definition: JobReport.h:436
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 714 of file JobReport.cc.

References impl_, and nEvents.

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

Definition at line 538 of file JobReport.cc.

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

538  {
539  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
540  f.fastCopyingInputs.insert(std::make_pair(inputFileName, fastCopying));
541  }
double f[11][100]
boost::scoped_ptr< JobReportImpl > impl_
Definition: JobReport.h:436
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 549 of file JobReport.cc.

References impl_.

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

549  {
550  impl_->associateInputLumiSection(run, lumiSectId);
551  }
boost::scoped_ptr< JobReportImpl > impl_
Definition: JobReport.h:436
void edm::JobReport::reportInputRunNumber ( unsigned int  run)

API to report a run read from input

Definition at line 559 of file JobReport.cc.

References impl_.

Referenced by DQMRootSource::readRun_().

559  {
560  impl_->associateInputRun(run);
561  }
boost::scoped_ptr< JobReportImpl > impl_
Definition: JobReport.h:436
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 544 of file JobReport.cc.

References impl_.

Referenced by DQMRootOutputModule::writeLuminosityBlock().

544  {
545  impl_->associateLumiSection(token, run, lumiSectId,nEvents);
546  }
boost::scoped_ptr< JobReportImpl > impl_
Definition: JobReport.h:436
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 634 of file JobReport.cc.

References impl_, and producerFileCleanner::msg.

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

References impl_, and producerFileCleanner::msg.

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

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

Definition at line 759 of file JobReport.cc.

References impl_, getDQMSummary::iter, and producerFileCleanner::msg.

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

References impl_, getDQMSummary::iter, and producerFileCleanner::msg.

Referenced by TFileAdaptor::termination().

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

Report the name of the random engine persistency file

Definition at line 724 of file JobReport.cc.

References impl_, fff_deleter::lock(), producerFileCleanner::msg, and write_mutex.

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

Inform the job report that a branch has been read.

Definition at line 699 of file JobReport.cc.

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

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

References impl_, and TiXmlElement::SetAttribute().

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

References impl_.

Referenced by DQMRootOutputModule::writeRun().

554  {
555  impl_->associateRun(token, run);
556  }
boost::scoped_ptr< JobReportImpl > impl_
Definition: JobReport.h:436
void edm::JobReport::reportSkippedEvent ( unsigned int  run,
unsigned int  event 
)

Definition at line 525 of file JobReport.cc.

References impl_, fff_deleter::lock(), producerFileCleanner::msg, and write_mutex.

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

References impl_, fff_deleter::lock(), producerFileCleanner::msg, TiXmlElement::SetAttribute(), and write_mutex.

603  {
604  if(impl_->ost_) {
605  std::ostream& msg = *(impl_->ost_);
606  TiXmlElement skipped("SkippedFile");
607  skipped.SetAttribute("Pfn", pfn);
608  skipped.SetAttribute("Lfn", lfn);
609  {
610  std::lock_guard<std::mutex> lock(write_mutex);
611  msg << skipped << "\n";
612  msg << std::flush;
613  }
614  }
615  }
list pfn
Definition: dbtoconf.py:76
std::mutex write_mutex
Definition: JobReport.h:437
boost::scoped_ptr< JobReportImpl > impl_
Definition: JobReport.h:436

Member Data Documentation

boost::scoped_ptr<JobReportImpl> edm::JobReport::impl_
private
std::mutex edm::JobReport::write_mutex
private