38 template <
typename S,
typename T>
41 if(f.fileHasBeenClosed) {
42 os <<
"\n<State Value=\"closed\"/>";
44 os <<
"\n<State Value=\"open\"/>";
47 os <<
"\n<LFN>" << TiXmlText(f.logicalFileName) <<
"</LFN>";
48 os <<
"\n<PFN>" << TiXmlText(f.physicalFileName) <<
"</PFN>";
49 os <<
"\n<Catalog>" << TiXmlText(f.catalog) <<
"</Catalog>";
50 os <<
"\n<ModuleLabel>" << TiXmlText(f.moduleLabel) <<
"</ModuleLabel>";
51 os <<
"\n<GUID>" << f.guid <<
"</GUID>";
53 for(
auto const& branch : f.branchNames) {
54 os <<
"\n <Branch>" << TiXmlText(branch) <<
"</Branch>";
56 os <<
"\n</Branches>";
67 os <<
"\n<InputFile>";
69 os <<
"\n<InputType>" << f.
inputType <<
"</InputType>";
71 <<
"</InputSourceClass>";
79 os <<
"\n<OutputModuleClass>"
81 <<
"</OutputModuleClass>";
82 os <<
"\n<TotalEvents>"
84 <<
"</TotalEvents>\n";
88 os <<
"\n<BranchHash>"
102 os <<
" <LumiSection ID=\"" << il <<
"\"/>\n";
124 <<
"Access reported for secondary source input file with token "
126 <<
" but no matching input file is found\n";
132 <<
"Access reported for input file with token "
134 <<
" but no matching input file is found\n";
140 <<
"Access reported for input file with token "
142 <<
" after this file has been closed.\n"
143 <<
"File record follows:\n"
151 if(t >= outputFiles_.size()) {
153 <<
"Access reported for output file with token "
155 <<
" but no matching output file is found\n";
157 if(outputFiles_[t].fileHasBeenClosed) {
159 <<
"Access reported for output file with token "
161 <<
" after this file has been closed.\n"
162 <<
"File record follows:\n"
166 return outputFiles_[
t];
179 outputFile.contributingInputsSecSource.push_back(t);
196 for(
auto const& runReport : f.runReports) {
197 *ost_ << runReport.second;
199 *ost_ <<
"\n</Runs>\n";
200 *ost_ <<
"</InputFile>\n";
225 for(
auto const& runReport : f.runReports) {
226 *ost_ << runReport.second;
228 *ost_ <<
"\n</Runs>\n";
230 *ost_ <<
"\n<Inputs>";
231 for(
auto token : f.contributingInputs) {
233 *ost_ <<
"\n<Input>";
237 *ost_ <<
"\n</Input>";
239 for(
auto token : f.contributingInputsSecSource) {
241 *ost_ <<
"\n<Input>";
245 *ost_ <<
"\n</Input>";
247 *ost_ <<
"\n</Inputs>";
248 *ost_ <<
"\n</File>\n";
257 for(
auto const&
inputFile : inputFiles_) {
262 for(
auto const&
inputFile : inputFilesSecSource_) {
275 std::map<RunNumber, RunReport>& theMap = outputFiles_.at(token).runReports;
276 std::map<RunNumber, RunReport>::iterator iter(theMap.lower_bound(runNumber));
277 if(iter == theMap.end() || runNumber < iter->first) {
285 std::map<RunNumber, RunReport>& theMap =
inputFile.runReports;
286 std::map<RunNumber, RunReport>::iterator iter(theMap.lower_bound(runNumber));
287 if(iter == theMap.end() || runNumber < iter->first) {
295 std::map<RunNumber, RunReport>& theMap = outputFiles_.at(token).runReports;
296 std::map<RunNumber, RunReport>::iterator iter(theMap.lower_bound(runNumber));
297 if(iter == theMap.end() || runNumber < iter->first) {
300 iter->second.lumiSections.insert(lumiSect);
307 std::map<RunNumber, RunReport>& theMap =
inputFile.runReports;
308 std::map<RunNumber, RunReport>::iterator iter(theMap.lower_bound(runNumber));
309 if(iter == theMap.end() || runNumber < iter->first) {
312 iter->second.lumiSections.insert(lumiSect);
321 *(
impl_->ost_) <<
"</FrameworkJobReport>\n" << std::flush;
331 *(
impl_->ost_) <<
"<FrameworkJobReport>\n";
337 toFileName(
std::string const& jobReportFile,
unsigned int childIndex,
unsigned int numberOfChildren, std::ostringstream& ofilename) {
338 char filler = ofilename.fill();
339 unsigned int numberOfDigitsInIndex = 0U;
340 while (numberOfChildren != 0) {
341 ++numberOfDigitsInIndex;
342 numberOfChildren /= 10;
344 if(numberOfDigitsInIndex == 0) {
345 numberOfDigitsInIndex = 3;
348 if(offset == std::string::npos) {
349 ofilename << jobReportFile;
350 ofilename <<
'_' << std::setw(numberOfDigitsInIndex) << std::setfill(
'0') << childIndex << std::setfill(filler);
352 ofilename << jobReportFile.substr(0, offset);
353 ofilename <<
'_' << std::setw(numberOfDigitsInIndex) << std::setfill(
'0') << childIndex << std::setfill(filler);
354 ofilename << jobReportFile.substr(offset);
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";
368 *(
impl_->ost_) <<
"</ChildProcessFiles>\n";
369 *(
impl_->ost_) <<
"</FrameworkJobReport>\n";
370 std::ofstream*
p =
dynamic_cast<std::ofstream *
>(
impl_->ost());
383 std::ofstream*
p =
dynamic_cast<std::ofstream*
>(
impl_->ost());
385 std::ostringstream ofilename;
386 toFileName(jobReportFile, childIndex, numberOfChildren, ofilename);
387 p->open(ofilename.str().c_str());
388 *p <<
"<FrameworkJobReport>\n";
399 std::vector<std::string>
const& branchNames) {
405 if (inputType ==
"mixingFiles") {
409 newToken = itr -
impl_->inputFilesSecSource_.begin();
411 if (inputType ==
"secondaryFiles") {
414 impl_->inputFiles_.emplace_back();
415 newFile = &
impl_->inputFiles_.back();
416 newToken =
impl_->inputFiles_.size() - 1;
420 impl_->lastOpenedPrimaryInputFile_ =
impl_->inputFiles_.size() - 1;
428 newFile->
guid = guid;
435 impl_->insertInputForOutputs(theInputType, newToken);
456 impl_->writeInputFile(f);
460 impl_->writeInputFile(f);
474 std::vector<std::string>
const& branchNames) {
475 impl_->outputFiles_.emplace_back();
493 if(!
impl_->inputFiles_[
i].fileHasBeenClosed) {
498 if(!
impl_->inputFilesSecSource_[
i].fileHasBeenClosed) {
502 return impl_->outputFiles_.size()-1;
515 impl_->writeOutputFile(f);
524 msg <<
"<SkippedEvent Run=\"" << run <<
"\"";
525 msg <<
" Event=\"" <<
event <<
"\" />\n";
539 impl_->associateLumiSection(token, run, lumiSectId);
544 impl_->associateInputLumiSection(run, lumiSectId);
549 impl_->associateRun(token, run);
554 impl_->associateInputRun(run);
563 msg <<
"<AnalysisFile>\n"
564 <<
" <FileName>" << TiXmlText(fileName) <<
"</FileName>\n";
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 <<
"\" />"
572 msg <<
"</AnalysisFile>\n";
581 int const& exitCode) {
586 msg <<
"<FrameworkError ExitStatus=\""<< exitCode
587 <<
"\" Type=\"" << shortDesc <<
"\" >\n";
588 msg <<
"<![CDATA[\n" << longDesc <<
"\n]]>\n";
589 msg <<
"</FrameworkError>\n";
600 TiXmlElement skipped(
"SkippedFile");
601 skipped.SetAttribute(
"Pfn", pfn);
602 skipped.SetAttribute(
"Lfn", lfn);
605 msg << skipped <<
"\n";
615 TiXmlElement fallback(
"FallbackAttempt");
616 fallback.SetAttribute(
"Pfn", pfn);
617 fallback.SetAttribute(
"Lfn", lfn);
620 msg << fallback <<
"\n";
621 msg <<
"<![CDATA[\n" << err <<
"\n]]>\n";
631 msg <<
"<MemoryService>\n";
633 typedef std::vector<std::string>::const_iterator const_iterator;
634 for(const_iterator pos = memoryData.begin(), posEnd = memoryData.end(); pos != posEnd; ++pos) {
637 msg <<
"</MemoryService>\n";
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 <<
"\" />"
653 msg <<
"</MessageSummary>\n";
660 if(
impl_->printedReadBranches_)
return;
661 impl_->printedReadBranches_ =
true;
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";
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";
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";
686 ost <<
"</SecondarySourceReadBranches>\n";
696 std::set<std::string>
const& clonedBranches =
impl_->inputFiles_.at(
impl_->lastOpenedPrimaryInputFile_).fastClonedBranches;
697 if(clonedBranches.find(branchName) == clonedBranches.end()) {
698 ++
impl_->readBranches_[branchName];
701 ++
impl_->readBranchesSecFile_[branchName];
703 ++
impl_->readBranchesSecSource_[branchName].value();
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();
712 if(clonedBranches.insert(*it).second) {
723 msg <<
"<RandomServiceStateFile>\n"
724 << TiXmlText(name) <<
"\n"
725 <<
"</RandomServiceStateFile>\n";
733 std::map<std::string, std::string>
const& metrics) {
736 msg <<
"<PerformanceReport>\n"
737 <<
" <PerformanceSummary Metric=\"" << metricClass <<
"\">\n";
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";
745 msg <<
" </PerformanceSummary>\n"
746 <<
"</PerformanceReport>\n";
755 std::map<std::string, std::string>
const& metrics) {
758 msg <<
"<PerformanceReport>\n"
759 <<
" <PerformanceModule Metric=\"" << metricClass <<
"\" "
760 <<
" Module=\"" << moduleName <<
"\" >\n";
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";
768 msg <<
" </PerformanceModule>\n"
769 <<
"</PerformanceReport>\n";
777 std::ostringstream
msg;
779 typedef std::vector<JobReport::OutputFile>::iterator iterator;
781 for(iterator
f =
impl_->outputFiles_.begin(), fEnd =
impl_->outputFiles_.end();
f != fEnd; ++
f) {
786 msg <<
"\n<LumiSections>";
788 typedef std::vector<JobReport::Token>::iterator iterator;
789 for(iterator iInput = f->contributingInputs.begin(),
790 iInputEnd = f->contributingInputs.end();
791 iInput != iInputEnd; ++iInput) {
799 msg <<
"\n</Inputs>";
void reportSkippedFile(std::string const &pfn, std::string const &lfn)
std::string outputModuleClassName
std::string physicalFileName
void associateRun(JobReport::Token token, unsigned int runNumber)
void reportMemoryInfo(std::vector< std::string > const &memoryData)
void associateLumiSection(JobReport::Token token, unsigned int runNumber, unsigned int lumiSection)
void reportInputRunNumber(unsigned int run)
void eventReadFromFile(InputType inputType, Token fileToken)
void reportFallbackAttempt(std::string const &pfn, std::string const &lfn, std::string const &err)
unsigned long long EventNumber_t
std::map< std::string, bool > fastCopyingInputs
std::string logicalFileName
void reportFastCopyingStatus(Token t, std::string const &inputFileName, bool fastCopying)
void reportRunNumber(JobReport::Token token, unsigned int run)
void reportRandomStateFile(std::string const &name)
S & print(S &os, JobReport::InputFile const &f)
edm::propagate_const< std::unique_ptr< JobReportImpl > > impl_
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)
std::vector< InputFile > inputFiles_
void reportPerformanceForModule(std::string const &metricClass, std::string const &moduleName, std::map< std::string, std::string > const &metrics)
std::vector< Token > contributingInputs
tuple InputFile
Open Root file and provide MEs ############.
void reportSkippedEvent(RunNumber_t run, EventNumber_t event)
void insertInputForOutputs(InputType inputType, Token t)
std::string moduleName(Provenance const &provenance)
void writeInputFile(InputFile const &f)
void reportInputLumiSection(unsigned int run, unsigned int lumiSectId)
void reportPerformanceSummary(std::string const &metricClass, std::map< std::string, std::string > const &metrics)
void childAfterFork(std::string const &jobReportFile, unsigned int childIndex, unsigned int numberOfChildren)
New output file for child.
std::set< unsigned int > lumiSections
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)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void reportError(std::string const &shortDesc, std::string const &longDesc, int const &exitCode)
void associateInputRun(unsigned int runNumber)
S & formatFile(T const &f, S &os)
void reportReadBranch(InputType inputType, std::string const &branchName)
Inform the job report that a branch has been read.
std::size_t numEventsWritten
void reportFastClonedBranches(std::set< std::string > const &fastClonedBranches, long long nEvents)
Inform the job report that branches have been fast Cloned.
Value const & findOrDefault(std::map< Key, Value > const &m, Key const &k, Value const &defaultValue)
void eventWrittenToFile(Token fileToken, RunNumber_t run, EventNumber_t event)
tbb::concurrent_vector< InputFile > inputFilesSecSource_
void parentAfterFork(std::string const &jobReportFile)
void reportMessageInfo(std::map< std::string, double > const &messageData)
double S(const TLorentzVector &, const TLorentzVector &)
std::string dumpFiles(void)
debug/test util
void parentBeforeFork(std::string const &jobReportFile, unsigned int numberOfChildren)
void reportAnalysisFile(std::string const &fileName, std::map< std::string, std::string > const &fileData)
void outputFileClosed(Token fileToken)
void writeOutputFile(OutputFile const &f)
InputFile & getInputFileForToken(InputType inputType, Token t)
void reportLumiSection(JobReport::Token token, unsigned int run, unsigned int lumiSectId)
void reportDataType(Token fileToken, std::string const &dataType)
tbb::concurrent_vector< Token > contributingInputsSecSource
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
void inputFileClosed(InputType inputType, Token fileToken)
void associateInputLumiSection(unsigned int runNumber, unsigned int lumiSection)
void reportReadBranches()
OutputFile & getOutputFileForToken(Token t)