test
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, 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)
 
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 325 of file JobReport.cc.

325  :
326  impl_(new JobReportImpl(0)) {
327  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
edm::JobReport::JobReport ( std::ostream *  outputStream)

Definition at line 329 of file JobReport.cc.

References impl_.

329  : impl_(new JobReportImpl(iOstream)) {
330  if(impl_->ost_) {
331  *(impl_->ost_) << "<FrameworkJobReport>\n";
332  }
333  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
edm::JobReport::JobReport ( JobReport const &  )
delete
edm::JobReport::~JobReport ( )

Definition at line 318 of file JobReport.cc.

References impl_.

318  {
319  impl_->flushFiles();
320  if(impl_->ost_) {
321  *(impl_->ost_) << "</FrameworkJobReport>\n" << std::flush;
322  }
323  }
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 382 of file JobReport.cc.

References impl_, and AlCaHLTBitMon_ParallelJobs::p.

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

debug/test util

Definition at line 776 of file JobReport.cc.

References f, edm::findOrDefault(), impl_, edm::JobReport::InputFile::logicalFileName, visualization-live-secondInstance_cfg::msg, and edm::JobReport::InputFile::physicalFileName.

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

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

440  {
441  JobReport::InputFile& f = impl_->getInputFileForToken(inputType, fileToken);
442  ++f.numEventsRead;
443  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
tuple InputFile
Open Root file and provide MEs ############.
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 506 of file JobReport.cc.

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

506  {
507  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
508  ++f.numEventsWritten;
509  }
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 452 of file JobReport.cc.

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

Referenced by DQMRootSource::closeFile_().

452  {
453  JobReport::InputFile& f = impl_->getInputFileForToken(inputType, fileToken);
454  f.fileHasBeenClosed = true;
455  if(inputType == InputType::Primary) {
456  impl_->writeInputFile(f);
457  } else {
458  {
459  std::lock_guard<std::mutex> lock(write_mutex);
460  impl_->writeInputFile(f);
461  }
462  }
463  }
std::mutex write_mutex
Definition: JobReport.h:442
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
tuple InputFile
Open Root file and provide MEs ############.
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 392 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_().

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

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

Referenced by DQMRootOutputModule::finishEndFile().

512  {
513  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
514  f.fileHasBeenClosed = true;
515  impl_->writeOutputFile(f);
516  }
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 466 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().

474  {
475  impl_->outputFiles_.emplace_back();
476  JobReport::OutputFile& r = impl_->outputFiles_.back();
477 
478  r.logicalFileName = logicalFileName;
479  r.physicalFileName = physicalFileName;
480  r.catalog = catalog;
481  r.outputModuleClassName = outputModuleClassName;
482  r.moduleLabel = moduleLabel;
483  r.guid = guid;
484  r.dataType = dataType;
485  r.branchHash = branchHash;
486  r.numEventsWritten = 0;
487  r.branchNames = branchNames;
488  r.fileHasBeenClosed = false;
489  //
490  // Init list of contributors to list of open input file Tokens
491  //
492  for(std::vector<Token>::size_type i = 0, iEnd = impl_->inputFiles_.size(); i < iEnd; ++i) {
493  if(!impl_->inputFiles_[i].fileHasBeenClosed) {
494  r.contributingInputs.push_back(i);
495  }
496  }
497  for(tbb::concurrent_vector<Token>::size_type i = 0, iEnd = impl_->inputFilesSecSource_.size(); i < iEnd; ++i) {
498  if(!impl_->inputFilesSecSource_[i].fileHasBeenClosed) {
499  r.contributingInputsSecSource.push_back(i);
500  }
501  }
502  return impl_->outputFiles_.size()-1;
503  }
int i
Definition: DBlmapReader.cc:9
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 378 of file JobReport.cc.

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

Definition at line 360 of file JobReport.cc.

References i, impl_, and AlCaHLTBitMon_ParallelJobs::p.

360  {
361  if(impl_->ost_) {
362  *(impl_->ost_) << "<ChildProcessFiles>\n";
363  for(unsigned int i = 0; i < numberOfChildren; ++i) {
364  std::ostringstream ofilename;
365  toFileName(jobReportFile, i, numberOfChildren, ofilename);
366  *(impl_->ost_) << " <ChildProcessFile>" << ofilename.str() << "</ChildProcessFile>\n";
367  }
368  *(impl_->ost_) << "</ChildProcessFiles>\n";
369  *(impl_->ost_) << "</FrameworkJobReport>\n";
370  std::ofstream* p = dynamic_cast<std::ofstream *>(impl_->ost());
371  if(p) {
372  p->close();
373  }
374  }
375  }
int i
Definition: DBlmapReader.cc:9
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 558 of file JobReport.cc.

References impl_, CommonMethods::lock(), visualization-live-secondInstance_cfg::msg, and write_mutex.

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

558  {
559  if(impl_->ost_) {
560  std::ostream& msg = *(impl_->ost_);
561  {
562  std::lock_guard<std::mutex> lock(write_mutex);
563  msg << "<AnalysisFile>\n"
564  << " <FileName>" << TiXmlText(fileName) << "</FileName>\n";
565 
566  typedef std::map<std::string, std::string>::const_iterator const_iterator;
567  for(const_iterator pos = fileData.begin(), posEnd = fileData.end(); pos != posEnd; ++pos) {
568  msg << " <" << pos->first
569  << " Value=\"" << pos->second << "\" />"
570  << "\n";
571  }
572  msg << "</AnalysisFile>\n";
573  msg << std::flush;
574  }
575  }
576  }
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 446 of file JobReport.cc.

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

446  {
447  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
448  f.dataType = dataType;
449  }
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 579 of file JobReport.cc.

References impl_, CommonMethods::lock(), visualization-live-secondInstance_cfg::msg, and write_mutex.

Referenced by edm::printCmsException().

581  {
582  if(impl_->ost_) {
583  {
584  std::lock_guard<std::mutex> lock(write_mutex);
585  std::ostream& msg = *(impl_->ost_);
586  msg << "<FrameworkError ExitStatus=\""<< exitCode
587  << "\" Type=\"" << shortDesc << "\" >\n";
588  msg << "<![CDATA[\n" << longDesc << "\n]]>\n";
589  msg << "</FrameworkError>\n";
590  msg << std::flush;
591  }
592  }
593  }
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 612 of file JobReport.cc.

References impl_, CommonMethods::lock(), visualization-live-secondInstance_cfg::msg, and write_mutex.

612  {
613  if(impl_->ost_) {
614  std::ostream& msg = *(impl_->ost_);
615  TiXmlElement fallback("FallbackAttempt");
616  fallback.SetAttribute("Pfn", pfn);
617  fallback.SetAttribute("Lfn", lfn);
618  {
619  std::lock_guard<std::mutex> lock(write_mutex);
620  msg << fallback << "\n";
621  msg << "<![CDATA[\n" << err << "\n]]>\n";
622  msg << std::flush;
623  }
624  }
625  }
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 708 of file JobReport.cc.

References impl_, and nEvents.

708  {
709  std::set<std::string>& clonedBranches = impl_->inputFiles_.at(impl_->lastOpenedPrimaryInputFile_).fastClonedBranches;
710  for(std::set<std::string>::const_iterator it = fastClonedBranches.begin(), itEnd = fastClonedBranches.end();
711  it != itEnd; ++it) {
712  if(clonedBranches.insert(*it).second) {
713  impl_->readBranches_[*it] += nEvents;
714  }
715  }
716  }
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 532 of file JobReport.cc.

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

532  {
533  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
534  f.fastCopyingInputs.insert(std::make_pair(inputFileName, fastCopying));
535  }
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 543 of file JobReport.cc.

References impl_.

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

543  {
544  impl_->associateInputLumiSection(run, lumiSectId);
545  }
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 553 of file JobReport.cc.

References impl_.

Referenced by DQMRootSource::readRun_().

553  {
554  impl_->associateInputRun(run);
555  }
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 
)

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

References impl_.

Referenced by DQMRootOutputModule::writeLuminosityBlock().

538  {
539  impl_->associateLumiSection(token, run, lumiSectId);
540  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:441
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 628 of file JobReport.cc.

References impl_, and visualization-live-secondInstance_cfg::msg.

628  {
629  if(impl_->ost_) {
630  std::ostream& msg = *(impl_->ost_);
631  msg << "<MemoryService>\n";
632 
633  typedef std::vector<std::string>::const_iterator const_iterator;
634  for(const_iterator pos = memoryData.begin(), posEnd = memoryData.end(); pos != posEnd; ++pos) {
635  msg << *pos << "\n";
636  }
637  msg << "</MemoryService>\n";
638  msg << std::flush;
639  }
640  }
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 643 of file JobReport.cc.

References impl_, and visualization-live-secondInstance_cfg::msg.

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

643  {
644  if(impl_->ost_) {
645  std::ostream& msg = *(impl_->ost_);
646  msg << "<MessageSummary>\n";
647  typedef std::map<std::string, double>::const_iterator const_iterator;
648  for(const_iterator pos = messageData.begin(), posEnd = messageData.end(); pos != posEnd; ++pos) {
649  msg << " <" << pos->first
650  << " Value=\"" << pos->second << "\" />"
651  << "\n";
652  }
653  msg << "</MessageSummary>\n";
654  msg << std::flush;
655  }
656  }
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 753 of file JobReport.cc.

References impl_, and visualization-live-secondInstance_cfg::msg.

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

755  {
756  if(impl_->ost_) {
757  std::ostream& msg = *(impl_->ost_);
758  msg << "<PerformanceReport>\n"
759  << " <PerformanceModule Metric=\"" << metricClass << "\" "
760  << " Module=\"" << moduleName << "\" >\n";
761 
762  typedef std::map<std::string, std::string>::const_iterator const_iterator;
763  for(const_iterator iter = metrics.begin(), iterEnd = metrics.end(); iter != iterEnd; ++iter) {
764  msg << " <Metric Name=\"" << iter->first << "\" "
765  << "Value=\"" << iter->second << "\"/>\n";
766  }
767 
768  msg << " </PerformanceModule>\n"
769  << "</PerformanceReport>\n";
770  msg << std::flush;
771  //LogInfo("FwkJob") << msg.str();
772  }
773  }
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 732 of file JobReport.cc.

References impl_, and visualization-live-secondInstance_cfg::msg.

Referenced by TFileAdaptor::termination().

733  {
734  if(impl_->ost_) {
735  std::ostream& msg = *(impl_->ost_);
736  msg << "<PerformanceReport>\n"
737  << " <PerformanceSummary Metric=\"" << metricClass << "\">\n";
738 
739  typedef std::map<std::string, std::string>::const_iterator const_iterator;
740  for(const_iterator iter = metrics.begin(), iterEnd = metrics.end(); iter != iterEnd; ++iter) {
741  msg << " <Metric Name=\"" << iter->first << "\" "
742  << "Value=\"" << iter->second << "\"/>\n";
743  }
744 
745  msg << " </PerformanceSummary>\n"
746  << "</PerformanceReport>\n";
747  msg << std::flush;
748  //LogInfo("FwkJob") << msg.str();
749  }
750  }
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 718 of file JobReport.cc.

References impl_, CommonMethods::lock(), visualization-live-secondInstance_cfg::msg, and write_mutex.

718  {
719  if(impl_->ost_) {
720  std::ostream& msg = *(impl_->ost_);
721  {
722  std::lock_guard<std::mutex> lock(write_mutex);
723  msg << "<RandomServiceStateFile>\n"
724  << TiXmlText(name) << "\n"
725  << "</RandomServiceStateFile>\n";
726  msg << std::flush;
727  }
728  }
729  }
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 693 of file JobReport.cc.

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

693  {
694  if(inputType == InputType::Primary) {
695  // Fast cloned branches have already been reported.
696  std::set<std::string> const& clonedBranches = impl_->inputFiles_.at(impl_->lastOpenedPrimaryInputFile_).fastClonedBranches;
697  if(clonedBranches.find(branchName) == clonedBranches.end()) {
698  ++impl_->readBranches_[branchName];
699  }
700  } else if (inputType == InputType::SecondaryFile) {
701  ++impl_->readBranchesSecFile_[branchName];
702  } else if (inputType == InputType::SecondarySource) {
703  ++impl_->readBranchesSecSource_[branchName].value();
704  }
705  }
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 659 of file JobReport.cc.

References impl_.

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

References impl_.

Referenced by DQMRootOutputModule::writeRun().

548  {
549  impl_->associateRun(token, run);
550  }
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 519 of file JobReport.cc.

References impl_, CommonMethods::lock(), visualization-live-secondInstance_cfg::msg, and write_mutex.

519  {
520  if(impl_->ost_) {
521  std::ostream& msg = *(impl_->ost_);
522  {
523  std::lock_guard<std::mutex> lock(write_mutex);
524  msg << "<SkippedEvent Run=\"" << run << "\"";
525  msg << " Event=\"" << event << "\" />\n";
526  msg << std::flush;
527  }
528  }
529  }
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 596 of file JobReport.cc.

References impl_, CommonMethods::lock(), visualization-live-secondInstance_cfg::msg, and write_mutex.

597  {
598  if(impl_->ost_) {
599  std::ostream& msg = *(impl_->ost_);
600  TiXmlElement skipped("SkippedFile");
601  skipped.SetAttribute("Pfn", pfn);
602  skipped.SetAttribute("Lfn", lfn);
603  {
604  std::lock_guard<std::mutex> lock(write_mutex);
605  msg << skipped << "\n";
606  msg << std::flush;
607  }
608  }
609  }
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