CMS 3D CMS Logo

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

#include <JobReport.h>

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

Classes

class  AtomicLongLong
 
struct  InputFile
 
struct  JobReportImpl
 
struct  OutputFile
 
struct  RunReport
 

Public Types

typedef unsigned int RunNumber
 
typedef std::size_t Token
 

Public Member Functions

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

Protected Member Functions

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

Private Attributes

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

Detailed Description

Description: A service that collections job handling information.

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

CMS-THREADING Some notes about thread safety:

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

open primary input file nothing else running concurrently Also respondToOpenInputFiles serially

open output files serially nothing else running concurrently

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

close primary input file nothing else running concurrently

close output files serially nothing else running concurrently

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

All endJob and postEndJob activities occur serially not concurrently

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

Definition at line 103 of file JobReport.h.

Member Typedef Documentation

◆ RunNumber

typedef unsigned int edm::JobReport::RunNumber

Definition at line 105 of file JobReport.h.

◆ Token

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

Definition at line 106 of file JobReport.h.

Constructor & Destructor Documentation

◆ JobReport() [1/3]

edm::JobReport::JobReport ( )

Definition at line 312 of file JobReport.cc.

312 : impl_(new JobReportImpl(nullptr)) {}

◆ JobReport() [2/3]

edm::JobReport::JobReport ( std::ostream *  outputStream)

Definition at line 314 of file JobReport.cc.

314  : impl_(new JobReportImpl(iOstream)) {
315  if (impl_->ost_) {
316  *(impl_->ost_) << "<FrameworkJobReport>\n";
317  }
318  }

References impl_.

◆ JobReport() [3/3]

edm::JobReport::JobReport ( JobReport const &  )
delete

◆ ~JobReport()

edm::JobReport::~JobReport ( )

Definition at line 305 of file JobReport.cc.

305  {
306  impl_->flushFiles();
307  if (impl_->ost_) {
308  *(impl_->ost_) << "</FrameworkJobReport>\n" << std::flush;
309  }
310  }

References impl_.

Member Function Documentation

◆ dumpFiles()

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

debug/test util

Definition at line 692 of file JobReport.cc.

692  {
693  std::ostringstream msg;
694 
695  tinyxml2::XMLDocument doc;
696  for (auto const& f : impl_->outputFiles_) {
697  msg << "\n<File>";
698  msg << f;
699 
700  msg << "\n<LumiSections>";
701  msg << "\n<Inputs>";
702  typedef std::vector<JobReport::Token>::iterator iterator;
703  for (auto const& iInput : f.contributingInputs) {
704  auto const& inpFile = impl_->inputFiles_[iInput];
705  msg << "\n<Input>";
706  msg << "\n <LFN>" << doc.NewText(inpFile.logicalFileName.c_str())->Value() << "</LFN>";
707  msg << "\n <PFN>" << doc.NewText(inpFile.physicalFileName.c_str())->Value() << "</PFN>";
708  msg << "\n <FastCopying>" << findOrDefault(f.fastCopyingInputs, inpFile.physicalFileName) << "</FastCopying>";
709  msg << "\n</Input>";
710  doc.DeleteChildren();
711  }
712  msg << "\n</Inputs>";
713  msg << "\n</File>";
714  }
715  return msg.str();
716  }

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

◆ eventReadFromFile()

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

366  {
367  JobReport::InputFile& f = impl_->getInputFileForToken(inputType, fileToken);
368  ++f.numEventsRead;
369  }

References f, and impl_.

◆ eventWrittenToFile()

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

428  {
429  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
430  ++f.numEventsWritten;
431  }

References f, and impl_.

Referenced by NanoAODOutputModule::write().

◆ impl()

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

◆ inputFileClosed()

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

376  {
377  JobReport::InputFile& f = impl_->getInputFileForToken(inputType, fileToken);
378  f.fileHasBeenClosed = true;
379  if (inputType == InputType::Primary) {
380  impl_->writeInputFile(f);
381  } else {
382  {
383  std::lock_guard<std::mutex> lock(write_mutex);
384  impl_->writeInputFile(f);
385  }
386  }
387  }

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

◆ inputFileOpened()

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

327  {
328  InputType theInputType = InputType::Primary;
329  InputFile* newFile = nullptr;
330  JobReport::Token newToken = 0;
331 
332  if (inputType == "mixingFiles") {
333  theInputType = InputType::SecondarySource;
334  auto itr = impl_->inputFilesSecSource_.push_back(InputFile());
335  newFile = &(*itr);
336  newToken = itr - impl_->inputFilesSecSource_.begin();
337  } else {
338  if (inputType == "secondaryFiles") {
339  theInputType = InputType::SecondaryFile;
340  }
341  impl_->inputFiles_.emplace_back();
342  newFile = &impl_->inputFiles_.back();
343  newToken = impl_->inputFiles_.size() - 1;
344  }
345 
346  if (theInputType == InputType::Primary) {
347  impl_->lastOpenedPrimaryInputFile_ = impl_->inputFiles_.size() - 1;
348  }
349  newFile->logicalFileName = logicalFileName;
350  newFile->physicalFileName = physicalFileName;
351  newFile->catalog = catalog;
352  newFile->inputType = inputType;
353  newFile->inputSourceClassName = inputSourceClassName;
354  newFile->moduleLabel = moduleLabel;
355  newFile->guid = guid;
356  newFile->numEventsRead = 0;
357  newFile->branchNames = branchNames;
358  newFile->fileHasBeenClosed = false;
359 
360  // Add the new input file token to all output files
361  // currently open.
362  impl_->insertInputForOutputs(theInputType, newToken);
363  return newToken;
364  }

References edm::JobReport::InputFile::branchNames, getEcalConditions_orcoffint2r_cff::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, HerwigMaxPtPartonFilter_cfi::moduleLabel, edm::JobReport::InputFile::moduleLabel, edm::JobReport::InputFile::numEventsRead, edm::JobReport::InputFile::physicalFileName, edm::Primary, edm::SecondaryFile, and edm::SecondarySource.

◆ operator=()

JobReport& edm::JobReport::operator= ( JobReport const &  )
delete

◆ outputFileClosed()

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

433  {
434  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
435  f.fileHasBeenClosed = true;
436  impl_->writeOutputFile(f);
437  }

References f, and impl_.

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

◆ outputFileOpened()

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

397  {
398  auto itr = impl_->outputFiles_.emplace_back();
399  JobReport::OutputFile& r = *itr;
400 
401  r.logicalFileName = logicalFileName;
402  r.physicalFileName = physicalFileName;
403  r.catalog = catalog;
404  r.outputModuleClassName = outputModuleClassName;
405  r.moduleLabel = moduleLabel;
406  r.guid = guid;
407  r.dataType = dataType;
408  r.branchHash = branchHash;
409  r.numEventsWritten = 0;
410  r.branchNames = branchNames;
411  r.fileHasBeenClosed = false;
412  //
413  // Init list of contributors to list of open input file Tokens
414  //
415  for (std::vector<Token>::size_type i = 0, iEnd = impl_->inputFiles_.size(); i < iEnd; ++i) {
416  if (!impl_->inputFiles_[i].fileHasBeenClosed) {
417  r.contributingInputs.push_back(i);
418  }
419  }
420  for (tbb::concurrent_vector<Token>::size_type i = 0, iEnd = impl_->inputFilesSecSource_.size(); i < iEnd; ++i) {
421  if (!impl_->inputFilesSecSource_[i].fileHasBeenClosed) {
422  r.contributingInputsSecSource.push_back(i);
423  }
424  }
425  return itr - impl_->outputFiles_.begin();
426  }

References getEcalConditions_orcoffint2r_cff::catalog, DTskim_cfg::dataType, mps_fire::i, impl_, HerwigMaxPtPartonFilter_cfi::moduleLabel, and alignCSCRings::r.

◆ reportAnalysisFile()

void edm::JobReport::reportAnalysisFile ( std::string const &  fileName,
std::map< std::string, std::string > const &  fileData 
)

Definition at line 473 of file JobReport.cc.

473  {
474  tinyxml2::XMLDocument doc;
475  if (impl_->ost_) {
476  std::ostream& msg = *(impl_->ost_);
477  {
478  std::lock_guard<std::mutex> lock(write_mutex);
479  msg << "<AnalysisFile>\n"
480  << " <FileName>" << doc.NewText(fileName.c_str())->Value() << "</FileName>\n";
481 
482  typedef std::map<std::string, std::string>::const_iterator const_iterator;
483  for (const_iterator pos = fileData.begin(), posEnd = fileData.end(); pos != posEnd; ++pos) {
484  msg << " <" << pos->first << " Value=\"" << pos->second << "\" />"
485  << "\n";
486  }
487  msg << "</AnalysisFile>\n";
488  msg << std::flush;
489  }
490  }
491  }

References boostedTaus_cff::doc, MillePedeFileConverter_cfg::fileName, impl_, CommonMethods::lock(), mps_check::msg, and write_mutex.

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

◆ reportDataType()

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

371  {
372  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
373  f.dataType = dataType;
374  }

References DTskim_cfg::dataType, f, and impl_.

◆ reportError()

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

493  {
494  if (impl_->ost_) {
495  {
496  std::lock_guard<std::mutex> lock(write_mutex);
497  std::ostream& msg = *(impl_->ost_);
498  msg << "<FrameworkError ExitStatus=\"" << exitCode << "\" Type=\"" << shortDesc << "\" >\n";
499  msg << "<![CDATA[\n" << longDesc << "\n]]>\n";
500  msg << "</FrameworkError>\n";
501  msg << std::flush;
502  }
503  }
504  }

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

Referenced by edm::printCmsException().

◆ reportFallbackAttempt()

void edm::JobReport::reportFallbackAttempt ( std::string const &  pfn,
std::string const &  lfn,
std::string const &  err 
)

Definition at line 523 of file JobReport.cc.

523  {
524  if (impl_->ost_) {
525  std::ostream& msg = *(impl_->ost_);
526  tinyxml2::XMLDocument doc;
527  tinyxml2::XMLPrinter printer;
528  tinyxml2::XMLElement* fallback = doc.NewElement("FallbackAttempt");
529  fallback->SetAttribute("Pfn", pfn.c_str());
530  fallback->SetAttribute("Lfn", lfn.c_str());
531  {
532  std::lock_guard<std::mutex> lock(write_mutex);
533  fallback->Accept(&printer);
534  msg << printer.CStr();
535  msg << "<![CDATA[\n" << err << "\n]]>\n";
536  msg << std::flush;
537  }
538  }
539  }

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

◆ reportFastClonedBranches()

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

626  {
627  std::set<std::string>& clonedBranches =
628  impl_->inputFiles_.at(impl_->lastOpenedPrimaryInputFile_).fastClonedBranches;
629  for (std::set<std::string>::const_iterator it = fastClonedBranches.begin(), itEnd = fastClonedBranches.end();
630  it != itEnd;
631  ++it) {
632  if (clonedBranches.insert(*it).second) {
633  impl_->readBranches_[*it] += nEvents;
634  }
635  }
636  }

References impl_, and nEvents.

◆ reportFastCopyingStatus()

void edm::JobReport::reportFastCopyingStatus ( JobReport::Token  fileToken,
std::string const &  inputFileName,
bool  fastCopying 
)

Definition at line 451 of file JobReport.cc.

453  {
454  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
455  f.fastCopyingInputs.insert(std::make_pair(inputFileName, fastCopying));
456  }

References f, impl_, and InefficientDoubleROC::inputFileName.

◆ reportInputLumiSection()

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

465  {
466  impl_->associateInputLumiSection(run, lumiSectId);
467  }

References impl_, and writedatasetfile::run.

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

◆ reportInputRunNumber()

void edm::JobReport::reportInputRunNumber ( unsigned int  run)

API to report a run read from input

Definition at line 471 of file JobReport.cc.

471 { impl_->associateInputRun(run); }

References impl_, and writedatasetfile::run.

Referenced by DQMRootSource::readRun_().

◆ reportLumiSection()

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

461  {
462  impl_->associateLumiSection(token, run, lumiSectId, nEvents);
463  }

References impl_, nEvents, writedatasetfile::run, and unpackBuffers-CaloStage2::token.

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

◆ reportMemoryInfo()

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

541  {
542  if (impl_->ost_) {
543  std::ostream& msg = *(impl_->ost_);
544  msg << "<MemoryService>\n";
545 
546  typedef std::vector<std::string>::const_iterator const_iterator;
547  for (const_iterator pos = memoryData.begin(), posEnd = memoryData.end(); pos != posEnd; ++pos) {
548  msg << *pos << "\n";
549  }
550  msg << "</MemoryService>\n";
551  msg << std::flush;
552  }
553  }

References impl_, and mps_check::msg.

◆ reportMessageInfo()

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

555  {
556  if (impl_->ost_) {
557  std::ostream& msg = *(impl_->ost_);
558  msg << "<MessageSummary>\n";
559  typedef std::map<std::string, double>::const_iterator const_iterator;
560  for (const_iterator pos = messageData.begin(), posEnd = messageData.end(); pos != posEnd; ++pos) {
561  msg << " <" << pos->first << " Value=\"" << pos->second << "\" />"
562  << "\n";
563  }
564  msg << "</MessageSummary>\n";
565  msg << std::flush;
566  }
567  }

References impl_, and mps_check::msg.

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

◆ reportPerformanceForModule()

void edm::JobReport::reportPerformanceForModule ( std::string const &  metricClass,
std::string const &  moduleName,
std::map< std::string, std::string > const &  metrics 
)

Definition at line 671 of file JobReport.cc.

673  {
674  if (impl_->ost_) {
675  std::ostream& msg = *(impl_->ost_);
676  msg << "<PerformanceReport>\n"
677  << " <PerformanceModule Metric=\"" << metricClass << "\" "
678  << " Module=\"" << moduleName << "\" >\n";
679 
680  typedef std::map<std::string, std::string>::const_iterator const_iterator;
681  for (const_iterator iter = metrics.begin(), iterEnd = metrics.end(); iter != iterEnd; ++iter) {
682  msg << " <Metric Name=\"" << iter->first << "\" "
683  << "Value=\"" << iter->second << "\"/>\n";
684  }
685 
686  msg << " </PerformanceModule>\n"
687  << "</PerformanceReport>\n";
688  msg << std::flush;
689  }
690  }

References impl_, edm::moduleName(), and mps_check::msg.

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

◆ reportPerformanceSummary()

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

653  {
654  if (impl_->ost_) {
655  std::ostream& msg = *(impl_->ost_);
656  msg << "<PerformanceReport>\n"
657  << " <PerformanceSummary Metric=\"" << metricClass << "\">\n";
658 
659  typedef std::map<std::string, std::string>::const_iterator const_iterator;
660  for (const_iterator iter = metrics.begin(), iterEnd = metrics.end(); iter != iterEnd; ++iter) {
661  msg << " <Metric Name=\"" << iter->first << "\" "
662  << "Value=\"" << iter->second << "\"/>\n";
663  }
664 
665  msg << " </PerformanceSummary>\n"
666  << "</PerformanceReport>\n";
667  msg << std::flush;
668  }
669  }

References impl_, and mps_check::msg.

Referenced by TFileAdaptor::termination().

◆ reportRandomStateFile()

void edm::JobReport::reportRandomStateFile ( std::string const &  name)

Report the name of the random engine persistency file

Definition at line 638 of file JobReport.cc.

638  {
639  tinyxml2::XMLDocument doc;
640  if (impl_->ost_) {
641  std::ostream& msg = *(impl_->ost_);
642  {
643  std::lock_guard<std::mutex> lock(write_mutex);
644  msg << "<RandomServiceStateFile>\n"
645  << doc.NewText(name.c_str())->Value() << "\n"
646  << "</RandomServiceStateFile>\n";
647  msg << std::flush;
648  }
649  }
650  }

References boostedTaus_cff::doc, impl_, CommonMethods::lock(), mps_check::msg, Skims_PA_cff::name, and write_mutex.

◆ reportReadBranch()

void edm::JobReport::reportReadBranch ( InputType  inputType,
std::string const &  branchName 
)

Inform the job report that a branch has been read.

Definition at line 611 of file JobReport.cc.

611  {
612  if (inputType == InputType::Primary) {
613  // Fast cloned branches have already been reported.
614  std::set<std::string> const& clonedBranches =
615  impl_->inputFiles_.at(impl_->lastOpenedPrimaryInputFile_).fastClonedBranches;
616  if (clonedBranches.find(branchName) == clonedBranches.end()) {
617  ++impl_->readBranches_[branchName];
618  }
619  } else if (inputType == InputType::SecondaryFile) {
620  ++impl_->readBranchesSecFile_[branchName];
621  } else if (inputType == InputType::SecondarySource) {
622  ++impl_->readBranchesSecSource_[branchName].value();
623  }
624  }

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

◆ reportReadBranches()

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

569  {
570  if (impl_->printedReadBranches_)
571  return;
572  impl_->printedReadBranches_ = true;
573  if (impl_->ost_) {
574  std::ostream& ost = *(impl_->ost_);
575  ost << "<ReadBranches>\n";
576  tinyxml2::XMLDocument doc;
577  tinyxml2::XMLPrinter printer;
578  for (auto const& iBranch : impl_->readBranches_) {
579  tinyxml2::XMLElement* branch = doc.NewElement("Branch");
580  branch->SetAttribute("Name", iBranch.first.c_str());
581  branch->SetAttribute("ReadCount", int64_t(iBranch.second));
582  branch->Accept(&printer);
583  ost << printer.CStr();
584  printer.ClearBuffer();
585  }
586  for (auto const& iBranch : impl_->readBranchesSecFile_) {
587  tinyxml2::XMLElement* branch = doc.NewElement("Branch");
588  branch->SetAttribute("Name", iBranch.first.c_str());
589  branch->SetAttribute("ReadCount", int64_t(iBranch.second));
590  branch->Accept(&printer);
591  ost << printer.CStr();
592  printer.ClearBuffer();
593  }
594  ost << "</ReadBranches>\n";
595  if (!impl_->readBranchesSecSource_.empty()) {
596  ost << "<SecondarySourceReadBranches>\n";
597  for (auto const& iBranch : impl_->readBranchesSecSource_) {
598  tinyxml2::XMLElement* branch = doc.NewElement("Branch");
599  branch->SetAttribute("Name", iBranch.first.c_str());
600  branch->SetAttribute("ReadCount", int64_t(iBranch.second.value().load()));
601  branch->Accept(&printer);
602  ost << printer.CStr();
603  printer.ClearBuffer();
604  }
605  ost << "</SecondarySourceReadBranches>\n";
606  }
607  ost << std::flush;
608  }
609  }

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

◆ reportRunNumber()

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

469 { impl_->associateRun(token, run); }

References impl_, writedatasetfile::run, and unpackBuffers-CaloStage2::token.

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

◆ reportSkippedEvent()

void edm::JobReport::reportSkippedEvent ( RunNumber_t  run,
EventNumber_t  event 
)

Definition at line 439 of file JobReport.cc.

439  {
440  if (impl_->ost_) {
441  std::ostream& msg = *(impl_->ost_);
442  {
443  std::lock_guard<std::mutex> lock(write_mutex);
444  msg << "<SkippedEvent Run=\"" << run << "\"";
445  msg << " Event=\"" << event << "\" />\n";
446  msg << std::flush;
447  }
448  }
449  }

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

◆ reportSkippedFile()

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

506  {
507  if (impl_->ost_) {
508  std::ostream& msg = *(impl_->ost_);
509  tinyxml2::XMLDocument doc;
510  tinyxml2::XMLPrinter printer;
511  tinyxml2::XMLElement* skipped = doc.NewElement("SkippedFile");
512  skipped->SetAttribute("Pfn", pfn.c_str());
513  skipped->SetAttribute("Lfn", lfn.c_str());
514  {
515  std::lock_guard<std::mutex> lock(write_mutex);
516  skipped->Accept(&printer);
517  msg << printer.CStr();
518  msg << std::flush;
519  }
520  }
521  }

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

Member Data Documentation

◆ impl_

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

◆ write_mutex

std::mutex edm::JobReport::write_mutex
private
mps_fire.i
i
Definition: mps_fire.py:428
getEcalConditions_orcoffint2r_cff.catalog
catalog
Definition: getEcalConditions_orcoffint2r_cff.py:40
boostedTaus_cff.doc
doc
Definition: boostedTaus_cff.py:20
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
MicroEventContent_cff.branch
branch
Definition: MicroEventContent_cff.py:174
electrons_cff.branchName
branchName
Definition: electrons_cff.py:520
edm::JobReport::Token
std::size_t Token
Definition: JobReport.h:106
pos
Definition: PixelAliasList.h:18
edm::moduleName
std::string moduleName(StableProvenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:27
edm::InputType::SecondaryFile
mps_check.msg
tuple msg
Definition: mps_check.py:285
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
ESFEDIntegrityTask_cfi.OutputFile
OutputFile
Definition: ESFEDIntegrityTask_cfi.py:9
DTskim_cfg.dataType
dataType
Definition: DTskim_cfg.py:56
edm::InputType
InputType
Definition: InputType.h:5
InputFile
Definition: FedRawDataInputSource.h:211
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
InefficientDoubleROC.inputFileName
inputFileName
Definition: InefficientDoubleROC.py:437
CommonMethods.lock
def lock()
Definition: CommonMethods.py:81
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
edm::JobReport::write_mutex
std::mutex write_mutex
Definition: JobReport.h:431
alignCSCRings.r
r
Definition: alignCSCRings.py:93
writedatasetfile.run
run
Definition: writedatasetfile.py:27
edm::InputType::Primary
edm::JobReport::impl_
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
edm::InputType::SecondarySource
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
RPC_Client_on_RootFile.InputFile
InputFile
Definition: RPC_Client_on_RootFile.py:64
trackingPlots.fallback
fallback
Definition: trackingPlots.py:341
reco::JetExtendedAssociation::Value
reco::JetExtendedAssociation::JetExtendedData Value
Definition: JetExtendedAssociation.h:27
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
runEdmFileComparison.skipped
skipped
Definition: runEdmFileComparison.py:224
nEvents
UInt_t nEvents
Definition: hcalCalib.cc:40
edm::findOrDefault
Value const & findOrDefault(std::map< Key, Value > const &m, Key const &k, Value const &defaultValue)
Definition: Map.h:24
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316