CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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

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

Protected Member Functions

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

Private Attributes

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

Detailed Description

Description: A service that collections job handling information.

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

CMS-THREADING Some notes about thread safety:

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

open primary input file nothing else running concurrently Also respondToOpenInputFiles serially

open output files serially nothing else running concurrently

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

close primary input file nothing else running concurrently

close output files serially nothing else running concurrently

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

All endJob and postEndJob activities occur serially not concurrently

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

Definition at line 103 of file JobReport.h.

Member Typedef Documentation

typedef unsigned int edm::JobReport::RunNumber

Definition at line 105 of file JobReport.h.

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

Definition at line 106 of file JobReport.h.

Constructor & Destructor Documentation

edm::JobReport::JobReport ( )

Definition at line 312 of file JobReport.cc.

312 : impl_(new JobReportImpl(nullptr)) {}
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
edm::JobReport::JobReport ( std::ostream *  outputStream)

Definition at line 314 of file JobReport.cc.

References impl_.

314  : impl_(new JobReportImpl(iOstream)) {
315  if (impl_->ost_) {
316  *(impl_->ost_) << "<FrameworkJobReport>\n";
317  }
318  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
edm::JobReport::JobReport ( JobReport const &  )
delete
edm::JobReport::~JobReport ( )

Definition at line 305 of file JobReport.cc.

References impl_.

305  {
306  impl_->flushFiles();
307  if (impl_->ost_) {
308  *(impl_->ost_) << "</FrameworkJobReport>\n" << std::flush;
309  }
310  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430

Member Function Documentation

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

debug/test util

Definition at line 694 of file JobReport.cc.

References validate-o2o-wbm::f, edm::findOrDefault(), impl_, and mps_check::msg.

694  {
695  std::ostringstream msg;
696 
697  tinyxml2::XMLDocument doc;
698  for (auto const& f : impl_->outputFiles_) {
699  msg << "\n<File>";
700  msg << f;
701 
702  msg << "\n<LumiSections>";
703  msg << "\n<Inputs>";
704  typedef std::vector<JobReport::Token>::iterator iterator;
705  for (auto const& iInput : f.contributingInputs) {
706  auto const& inpFile = impl_->inputFiles_[iInput];
707  msg << "\n<Input>";
708  msg << "\n <LFN>" << doc.NewText(inpFile.logicalFileName.c_str())->Value() << "</LFN>";
709  msg << "\n <PFN>" << doc.NewText(inpFile.physicalFileName.c_str())->Value() << "</PFN>";
710  msg << "\n <FastCopying>" << findOrDefault(f.fastCopyingInputs, inpFile.physicalFileName) << "</FastCopying>";
711  msg << "\n</Input>";
712  doc.DeleteChildren();
713  }
714  msg << "\n</Inputs>";
715  msg << "\n</File>";
716  }
717  return msg.str();
718  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
reco::JetExtendedAssociation::JetExtendedData Value
Value const & findOrDefault(std::map< Key, Value > const &m, Key const &k, Value const &defaultValue)
Definition: Map.h:24
tuple msg
Definition: mps_check.py:285
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.

References validate-o2o-wbm::f, impl_, and edm::JobReport::InputFile::numEventsRead.

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

References validate-o2o-wbm::f, impl_, and edm::JobReport::OutputFile::numEventsWritten.

Referenced by NanoAODOutputModule::write().

426  {
427  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
428  ++f.numEventsWritten;
429  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
edm::propagate_const<std::unique_ptr<JobReportImpl> >& edm::JobReport::impl ( )
inlineprotected

Definition at line 427 of file JobReport.h.

References impl_.

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

427 { return impl_; }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
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.

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

Referenced by DQMRootSource::OpenFileInfo::~OpenFileInfo().

376  {
377  JobReport::InputFile& f = impl_->getInputFileForToken(inputType, fileToken);
378  f.fileHasBeenClosed = true;
379  std::lock_guard<std::mutex> lock(write_mutex);
380  if (inputType == InputType::Primary) {
381  impl_->writeInputFile(f);
382  } else {
383  impl_->writeInputFile(f);
384  }
385  }
std::mutex write_mutex
Definition: JobReport.h:431
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
tuple InputFile
Open Root file and provide MEs ############.
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.

References haddnano::branchNames, 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_().

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  }
InputType
Definition: InputType.h:5
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
tuple InputFile
Open Root file and provide MEs ############.
std::size_t Token
Definition: JobReport.h:106
tuple branchNames
Definition: haddnano.py:54
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 431 of file JobReport.cc.

References validate-o2o-wbm::f, edm::JobReport::OutputFile::fileHasBeenClosed, impl_, CommonMethods::lock(), and write_mutex.

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

431  {
432  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
433  f.fileHasBeenClosed = true;
434  std::lock_guard<std::mutex> lock(write_mutex);
435  impl_->writeOutputFile(f);
436  }
std::mutex write_mutex
Definition: JobReport.h:431
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
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 387 of file JobReport.cc.

References edm::JobReport::OutputFile::branchHash, haddnano::branchNames, 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, mps_fire::i, impl_, edm::JobReport::OutputFile::logicalFileName, edm::JobReport::OutputFile::moduleLabel, edm::JobReport::OutputFile::numEventsWritten, edm::JobReport::OutputFile::outputModuleClassName, edm::JobReport::OutputFile::physicalFileName, and alignCSCRings::r.

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

Definition at line 472 of file JobReport.cc.

References 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().

472  {
473  tinyxml2::XMLDocument doc;
474  if (impl_->ost_) {
475  std::ostream& msg = *(impl_->ost_);
476  {
477  std::lock_guard<std::mutex> lock(write_mutex);
478  msg << "<AnalysisFile>\n"
479  << " <FileName>" << doc.NewText(fileName.c_str())->Value() << "</FileName>\n";
480 
481  typedef std::map<std::string, std::string>::const_iterator const_iterator;
482  for (const_iterator pos = fileData.begin(), posEnd = fileData.end(); pos != posEnd; ++pos) {
483  msg << " <" << pos->first << " Value=\"" << pos->second << "\" />"
484  << "\n";
485  }
486  msg << "</AnalysisFile>\n";
487  msg << std::flush;
488  }
489  }
490  }
std::mutex write_mutex
Definition: JobReport.h:431
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
reco::JetExtendedAssociation::JetExtendedData Value
tuple msg
Definition: mps_check.py:285
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.

References dtTPAnalyzer_cfg::dataType, edm::JobReport::OutputFile::dataType, validate-o2o-wbm::f, and impl_.

371  {
372  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
373  f.dataType = dataType;
374  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
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 492 of file JobReport.cc.

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

Referenced by edm::printCmsException().

492  {
493  if (impl_->ost_) {
494  {
495  std::lock_guard<std::mutex> lock(write_mutex);
496  std::ostream& msg = *(impl_->ost_);
497  msg << "<FrameworkError ExitStatus=\"" << exitCode << "\" Type=\"" << shortDesc << "\" >\n";
498  msg << "<![CDATA[\n" << longDesc << "\n]]>\n";
499  msg << "</FrameworkError>\n";
500  msg << std::flush;
501  }
502  }
503  }
std::mutex write_mutex
Definition: JobReport.h:431
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
tuple msg
Definition: mps_check.py:285
void edm::JobReport::reportFallbackAttempt ( std::string const &  pfn,
std::string const &  lfn,
std::string const &  err 
)

Definition at line 522 of file JobReport.cc.

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

522  {
523  if (impl_->ost_) {
524  std::ostream& msg = *(impl_->ost_);
525  tinyxml2::XMLDocument doc;
526  tinyxml2::XMLPrinter printer;
527  tinyxml2::XMLElement* fallback = doc.NewElement("FallbackAttempt");
528  fallback->SetAttribute("Pfn", pfn.c_str());
529  fallback->SetAttribute("Lfn", lfn.c_str());
530  {
531  std::lock_guard<std::mutex> lock(write_mutex);
532  fallback->Accept(&printer);
533  msg << printer.CStr();
534  msg << "<![CDATA[\n" << err << "\n]]>\n";
535  msg << std::flush;
536  }
537  }
538  }
std::mutex write_mutex
Definition: JobReport.h:431
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
tuple msg
Definition: mps_check.py:285
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 628 of file JobReport.cc.

References impl_, and submitPVValidationJobs::nEvents.

628  {
629  std::set<std::string>& clonedBranches =
630  impl_->inputFiles_.at(impl_->lastOpenedPrimaryInputFile_).fastClonedBranches;
631  for (std::set<std::string>::const_iterator it = fastClonedBranches.begin(), itEnd = fastClonedBranches.end();
632  it != itEnd;
633  ++it) {
634  if (clonedBranches.insert(*it).second) {
635  impl_->readBranches_[*it] += nEvents;
636  }
637  }
638  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
void edm::JobReport::reportFastCopyingStatus ( JobReport::Token  fileToken,
std::string const &  inputFileName,
bool  fastCopying 
)

Definition at line 450 of file JobReport.cc.

References validate-o2o-wbm::f, edm::JobReport::OutputFile::fastCopyingInputs, and impl_.

452  {
453  JobReport::OutputFile& f = impl_->getOutputFileForToken(fileToken);
454  f.fastCopyingInputs.insert(std::make_pair(inputFileName, fastCopying));
455  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
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 464 of file JobReport.cc.

References impl_.

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

464  {
465  impl_->associateInputLumiSection(run, lumiSectId);
466  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
void edm::JobReport::reportInputRunNumber ( unsigned int  run)

API to report a run read from input

Definition at line 470 of file JobReport.cc.

References impl_.

Referenced by DQMRootSource::readRun_().

470 { impl_->associateInputRun(run); }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
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 457 of file JobReport.cc.

References impl_.

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

460  {
461  impl_->associateLumiSection(token, run, lumiSectId, nEvents);
462  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
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 540 of file JobReport.cc.

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

540  {
541  if (impl_->ost_) {
542  std::lock_guard<std::mutex> lock(write_mutex);
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  }
std::mutex write_mutex
Definition: JobReport.h:431
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
tuple msg
Definition: mps_check.py:285
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.

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

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

555  {
556  if (impl_->ost_) {
557  std::lock_guard<std::mutex> lock(write_mutex);
558  std::ostream& msg = *(impl_->ost_);
559  msg << "<MessageSummary>\n";
560  typedef std::map<std::string, double>::const_iterator const_iterator;
561  for (const_iterator pos = messageData.begin(), posEnd = messageData.end(); pos != posEnd; ++pos) {
562  msg << " <" << pos->first << " Value=\"" << pos->second << "\" />"
563  << "\n";
564  }
565  msg << "</MessageSummary>\n";
566  msg << std::flush;
567  }
568  }
std::mutex write_mutex
Definition: JobReport.h:431
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
tuple msg
Definition: mps_check.py:285
void edm::JobReport::reportPerformanceForModule ( std::string const &  metricClass,
std::string const &  moduleName,
std::map< std::string, std::string > const &  metrics 
)

Definition at line 673 of file JobReport.cc.

References impl_, and mps_check::msg.

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

675  {
676  if (impl_->ost_) {
677  std::ostream& msg = *(impl_->ost_);
678  msg << "<PerformanceReport>\n"
679  << " <PerformanceModule Metric=\"" << metricClass << "\" "
680  << " Module=\"" << moduleName << "\" >\n";
681 
682  typedef std::map<std::string, std::string>::const_iterator const_iterator;
683  for (const_iterator iter = metrics.begin(), iterEnd = metrics.end(); iter != iterEnd; ++iter) {
684  msg << " <Metric Name=\"" << iter->first << "\" "
685  << "Value=\"" << iter->second << "\"/>\n";
686  }
687 
688  msg << " </PerformanceModule>\n"
689  << "</PerformanceReport>\n";
690  msg << std::flush;
691  }
692  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
tuple msg
Definition: mps_check.py:285
std::string moduleName(StableProvenance const &provenance, ProcessHistory const &history)
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 654 of file JobReport.cc.

References impl_, and mps_check::msg.

Referenced by TFileAdaptor::termination().

655  {
656  if (impl_->ost_) {
657  std::ostream& msg = *(impl_->ost_);
658  msg << "<PerformanceReport>\n"
659  << " <PerformanceSummary Metric=\"" << metricClass << "\">\n";
660 
661  typedef std::map<std::string, std::string>::const_iterator const_iterator;
662  for (const_iterator iter = metrics.begin(), iterEnd = metrics.end(); iter != iterEnd; ++iter) {
663  msg << " <Metric Name=\"" << iter->first << "\" "
664  << "Value=\"" << iter->second << "\"/>\n";
665  }
666 
667  msg << " </PerformanceSummary>\n"
668  << "</PerformanceReport>\n";
669  msg << std::flush;
670  }
671  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
tuple msg
Definition: mps_check.py:285
void edm::JobReport::reportRandomStateFile ( std::string const &  name)

Report the name of the random engine persistency file

Definition at line 640 of file JobReport.cc.

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

640  {
641  tinyxml2::XMLDocument doc;
642  if (impl_->ost_) {
643  std::ostream& msg = *(impl_->ost_);
644  {
645  std::lock_guard<std::mutex> lock(write_mutex);
646  msg << "<RandomServiceStateFile>\n"
647  << doc.NewText(name.c_str())->Value() << "\n"
648  << "</RandomServiceStateFile>\n";
649  msg << std::flush;
650  }
651  }
652  }
std::mutex write_mutex
Definition: JobReport.h:431
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
reco::JetExtendedAssociation::JetExtendedData Value
tuple msg
Definition: mps_check.py:285
void edm::JobReport::reportReadBranch ( InputType  inputType,
std::string const &  branchName 
)

Inform the job report that a branch has been read.

Definition at line 613 of file JobReport.cc.

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

613  {
614  if (inputType == InputType::Primary) {
615  // Fast cloned branches have already been reported.
616  std::set<std::string> const& clonedBranches =
617  impl_->inputFiles_.at(impl_->lastOpenedPrimaryInputFile_).fastClonedBranches;
618  if (clonedBranches.find(branchName) == clonedBranches.end()) {
619  ++impl_->readBranches_[branchName];
620  }
621  } else if (inputType == InputType::SecondaryFile) {
622  ++impl_->readBranchesSecFile_[branchName];
623  } else if (inputType == InputType::SecondarySource) {
624  ++impl_->readBranchesSecSource_[branchName].value();
625  }
626  }
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
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 570 of file JobReport.cc.

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

570  {
571  bool expected = false;
572  if (not impl_->printedReadBranches_.compare_exchange_strong(expected, true))
573  return;
574  if (impl_->ost_) {
575  std::lock_guard<std::mutex> lock(write_mutex);
576  std::ostream& ost = *(impl_->ost_);
577  ost << "<ReadBranches>\n";
578  tinyxml2::XMLDocument doc;
579  tinyxml2::XMLPrinter printer;
580  for (auto const& iBranch : impl_->readBranches_) {
581  tinyxml2::XMLElement* branch = doc.NewElement("Branch");
582  branch->SetAttribute("Name", iBranch.first.c_str());
583  branch->SetAttribute("ReadCount", int64_t(iBranch.second));
584  branch->Accept(&printer);
585  ost << printer.CStr();
586  printer.ClearBuffer();
587  }
588  for (auto const& iBranch : impl_->readBranchesSecFile_) {
589  tinyxml2::XMLElement* branch = doc.NewElement("Branch");
590  branch->SetAttribute("Name", iBranch.first.c_str());
591  branch->SetAttribute("ReadCount", int64_t(iBranch.second));
592  branch->Accept(&printer);
593  ost << printer.CStr();
594  printer.ClearBuffer();
595  }
596  ost << "</ReadBranches>\n";
597  if (!impl_->readBranchesSecSource_.empty()) {
598  ost << "<SecondarySourceReadBranches>\n";
599  for (auto const& iBranch : impl_->readBranchesSecSource_) {
600  tinyxml2::XMLElement* branch = doc.NewElement("Branch");
601  branch->SetAttribute("Name", iBranch.first.c_str());
602  branch->SetAttribute("ReadCount", int64_t(iBranch.second.value().load()));
603  branch->Accept(&printer);
604  ost << printer.CStr();
605  printer.ClearBuffer();
606  }
607  ost << "</SecondarySourceReadBranches>\n";
608  }
609  ost << std::flush;
610  }
611  }
std::mutex write_mutex
Definition: JobReport.h:431
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
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 468 of file JobReport.cc.

References impl_.

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

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

Definition at line 438 of file JobReport.cc.

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

438  {
439  if (impl_->ost_) {
440  std::ostream& msg = *(impl_->ost_);
441  {
442  std::lock_guard<std::mutex> lock(write_mutex);
443  msg << "<SkippedEvent Run=\"" << run << "\"";
444  msg << " Event=\"" << event << "\" />\n";
445  msg << std::flush;
446  }
447  }
448  }
std::mutex write_mutex
Definition: JobReport.h:431
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
tuple msg
Definition: mps_check.py:285
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 505 of file JobReport.cc.

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

505  {
506  if (impl_->ost_) {
507  std::ostream& msg = *(impl_->ost_);
508  tinyxml2::XMLDocument doc;
509  tinyxml2::XMLPrinter printer;
510  tinyxml2::XMLElement* skipped = doc.NewElement("SkippedFile");
511  skipped->SetAttribute("Pfn", pfn.c_str());
512  skipped->SetAttribute("Lfn", lfn.c_str());
513  {
514  std::lock_guard<std::mutex> lock(write_mutex);
515  skipped->Accept(&printer);
516  msg << printer.CStr();
517  msg << std::flush;
518  }
519  }
520  }
std::mutex write_mutex
Definition: JobReport.h:431
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
Definition: JobReport.h:430
tuple msg
Definition: mps_check.py:285

Member Data Documentation

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