39 template <
typename S,
typename T>
42 if(f.fileHasBeenClosed) {
43 os <<
"\n<State Value=\"closed\"/>";
45 os <<
"\n<State Value=\"open\"/>";
48 os <<
"\n<LFN>" <<
TiXmlText(f.logicalFileName) <<
"</LFN>";
49 os <<
"\n<PFN>" <<
TiXmlText(f.physicalFileName) <<
"</PFN>";
50 os <<
"\n<Catalog>" <<
TiXmlText(f.catalog) <<
"</Catalog>";
51 os <<
"\n<ModuleLabel>" <<
TiXmlText(f.moduleLabel) <<
"</ModuleLabel>";
52 os <<
"\n<GUID>" << f.guid <<
"</GUID>";
54 for(
auto const& branch : f.branchNames) {
55 os <<
"\n <Branch>" <<
TiXmlText(branch) <<
"</Branch>";
57 os <<
"\n</Branches>";
68 os <<
"\n<InputFile>";
70 os <<
"\n<InputType>" << f.
inputType <<
"</InputType>";
72 <<
"</InputSourceClass>";
80 os <<
"\n<OutputModuleClass>"
82 <<
"</OutputModuleClass>";
83 os <<
"\n<TotalEvents>"
85 <<
"</TotalEvents>\n";
89 os <<
"\n<BranchHash>"
103 os <<
" <LumiSection ID=\"" << il <<
"\"/>\n";
125 <<
"Access reported for secondary source input file with token "
127 <<
" but no matching input file is found\n";
133 <<
"Access reported for input file with token "
135 <<
" but no matching input file is found\n";
141 <<
"Access reported for input file with token "
143 <<
" after this file has been closed.\n"
144 <<
"File record follows:\n"
152 if(t >= outputFiles_.size()) {
154 <<
"Access reported for output file with token "
156 <<
" but no matching output file is found\n";
158 if(outputFiles_[t].fileHasBeenClosed) {
160 <<
"Access reported for output file with token "
162 <<
" after this file has been closed.\n"
163 <<
"File record follows:\n"
167 return outputFiles_[
t];
180 outputFile.contributingInputsSecSource.push_back(t);
197 for(
auto const& runReport : f.runReports) {
198 *ost_ << runReport.second;
200 *ost_ <<
"\n</Runs>\n";
201 *ost_ <<
"</InputFile>\n";
226 for(
auto const& runReport : f.runReports) {
227 *ost_ << runReport.second;
229 *ost_ <<
"\n</Runs>\n";
231 *ost_ <<
"\n<Inputs>";
232 for(
auto token : f.contributingInputs) {
234 *ost_ <<
"\n<Input>";
238 *ost_ <<
"\n</Input>";
240 for(
auto token : f.contributingInputsSecSource) {
242 *ost_ <<
"\n<Input>";
246 *ost_ <<
"\n</Input>";
248 *ost_ <<
"\n</Inputs>";
249 *ost_ <<
"\n</File>\n";
258 for(
auto const&
inputFile : inputFiles_) {
263 for(
auto const&
inputFile : inputFilesSecSource_) {
276 std::map<RunNumber, RunReport>& theMap = outputFiles_.at(token).runReports;
277 std::map<RunNumber, RunReport>::iterator iter(theMap.lower_bound(runNumber));
278 if(iter == theMap.end() || runNumber < iter->first) {
286 std::map<RunNumber, RunReport>& theMap =
inputFile.runReports;
287 std::map<RunNumber, RunReport>::iterator iter(theMap.lower_bound(runNumber));
288 if(iter == theMap.end() || runNumber < iter->first) {
296 std::map<RunNumber, RunReport>& theMap = outputFiles_.at(token).runReports;
297 std::map<RunNumber, RunReport>::iterator iter(theMap.lower_bound(runNumber));
298 if(iter == theMap.end() || runNumber < iter->first) {
301 iter->second.lumiSections.insert(lumiSect);
308 std::map<RunNumber, RunReport>& theMap =
inputFile.runReports;
309 std::map<RunNumber, RunReport>::iterator iter(theMap.lower_bound(runNumber));
310 if(iter == theMap.end() || runNumber < iter->first) {
313 iter->second.lumiSections.insert(lumiSect);
322 *(
impl_->ost_) <<
"</FrameworkJobReport>\n" << std::flush;
332 *(
impl_->ost_) <<
"<FrameworkJobReport>\n";
338 toFileName(
std::string const& jobReportFile,
unsigned int childIndex,
unsigned int numberOfChildren, std::ostringstream& ofilename) {
339 char filler = ofilename.fill();
340 unsigned int numberOfDigitsInIndex = 0U;
341 while (numberOfChildren != 0) {
342 ++numberOfDigitsInIndex;
343 numberOfChildren /= 10;
345 if(numberOfDigitsInIndex == 0) {
346 numberOfDigitsInIndex = 3;
349 if(offset == std::string::npos) {
350 ofilename << jobReportFile;
351 ofilename <<
'_' << std::setw(numberOfDigitsInIndex) << std::setfill(
'0') << childIndex << std::setfill(filler);
353 ofilename << jobReportFile.substr(0, offset);
354 ofilename <<
'_' << std::setw(numberOfDigitsInIndex) << std::setfill(
'0') << childIndex << std::setfill(filler);
355 ofilename << jobReportFile.substr(offset);
363 *(
impl_->ost_) <<
"<ChildProcessFiles>\n";
364 for(
unsigned int i = 0;
i < numberOfChildren; ++
i) {
365 std::ostringstream ofilename;
366 toFileName(jobReportFile,
i, numberOfChildren, ofilename);
367 *(
impl_->ost_) <<
" <ChildProcessFile>" << ofilename.str() <<
"</ChildProcessFile>\n";
369 *(
impl_->ost_) <<
"</ChildProcessFiles>\n";
370 *(
impl_->ost_) <<
"</FrameworkJobReport>\n";
371 std::ofstream*
p =
dynamic_cast<std::ofstream *
>(
impl_->ost_);
384 std::ofstream*
p =
dynamic_cast<std::ofstream*
>(
impl_->ost_);
386 std::ostringstream ofilename;
387 toFileName(jobReportFile, childIndex, numberOfChildren, ofilename);
388 p->open(ofilename.str().c_str());
389 *p <<
"<FrameworkJobReport>\n";
400 std::vector<std::string>
const& branchNames) {
406 if (inputType ==
"mixingFiles") {
409 newFile = &
impl_->inputFilesSecSource_.back();
410 newToken =
impl_->inputFilesSecSource_.size() - 1;
412 if (inputType ==
"secondaryFiles") {
415 impl_->inputFiles_.emplace_back();
416 newFile = &
impl_->inputFiles_.back();
417 newToken =
impl_->inputFiles_.size() - 1;
421 impl_->lastOpenedPrimaryInputFile_ =
impl_->inputFiles_.size() - 1;
429 newFile->
guid = guid;
436 impl_->insertInputForOutputs(theInputType, newToken);
457 impl_->writeInputFile(f);
461 impl_->writeInputFile(f);
475 std::vector<std::string>
const& branchNames) {
476 impl_->outputFiles_.emplace_back();
494 if(!
impl_->inputFiles_[
i].fileHasBeenClosed) {
499 if(!
impl_->inputFilesSecSource_[
i].fileHasBeenClosed) {
503 return impl_->outputFiles_.size()-1;
516 impl_->writeOutputFile(f);
525 msg <<
"<SkippedEvent Run=\"" << run <<
"\"";
526 msg <<
" Event=\"" <<
event <<
"\" />\n";
540 impl_->associateLumiSection(token, run, lumiSectId);
545 impl_->associateInputLumiSection(run, lumiSectId);
550 impl_->associateRun(token, run);
555 impl_->associateInputRun(run);
564 msg <<
"<AnalysisFile>\n"
565 <<
" <FileName>" <<
TiXmlText(fileName) <<
"</FileName>\n";
567 typedef std::map<std::string, std::string>::const_iterator const_iterator;
568 for(const_iterator pos = fileData.begin(), posEnd = fileData.end(); pos != posEnd; ++pos) {
569 msg <<
" <" << pos->first
570 <<
" Value=\"" << pos->second <<
"\" />"
573 msg <<
"</AnalysisFile>\n";
582 int const& exitCode) {
587 msg <<
"<FrameworkError ExitStatus=\""<< exitCode
588 <<
"\" Type=\"" << shortDesc <<
"\" >\n";
589 msg <<
"<![CDATA[\n" << longDesc <<
"\n]]>\n";
590 msg <<
"</FrameworkError>\n";
606 msg << skipped <<
"\n";
621 msg << fallback <<
"\n";
622 msg <<
"<![CDATA[\n" << err <<
"\n]]>\n";
632 msg <<
"<MemoryService>\n";
634 typedef std::vector<std::string>::const_iterator const_iterator;
635 for(const_iterator pos = memoryData.begin(), posEnd = memoryData.end(); pos != posEnd; ++pos) {
638 msg <<
"</MemoryService>\n";
647 msg <<
"<MessageSummary>\n";
648 typedef std::map<std::string, double>::const_iterator const_iterator;
649 for(const_iterator pos = messageData.begin(), posEnd = messageData.end(); pos != posEnd; ++pos) {
650 msg <<
" <" << pos->first
651 <<
" Value=\"" << pos->second <<
"\" />"
654 msg <<
"</MessageSummary>\n";
661 if(
impl_->printedReadBranches_)
return;
662 impl_->printedReadBranches_ =
true;
664 std::ostream& ost = *(
impl_->ost_);
665 ost <<
"<ReadBranches>\n";
666 for(
auto const& iBranch :
impl_->readBranches_) {
670 ost << branch <<
"\n";
672 for(
auto const& iBranch :
impl_->readBranchesSecFile_) {
676 ost << branch <<
"\n";
678 ost <<
"</ReadBranches>\n";
679 if(!
impl_->readBranchesSecSource_.empty()) {
680 ost <<
"<SecondarySourceReadBranches>\n";
681 for(
auto const& iBranch :
impl_->readBranchesSecSource_) {
684 branch.
SetAttribute(
"ReadCount", iBranch.second.value().load());
685 ost << branch <<
"\n";
687 ost <<
"</SecondarySourceReadBranches>\n";
697 std::set<std::string>
const& clonedBranches =
impl_->inputFiles_.at(
impl_->lastOpenedPrimaryInputFile_).fastClonedBranches;
698 if(clonedBranches.find(branchName) == clonedBranches.end()) {
699 ++
impl_->readBranches_[branchName];
702 ++
impl_->readBranchesSecFile_[branchName];
704 ++
impl_->readBranchesSecSource_[branchName].value();
710 std::set<std::string>& clonedBranches =
impl_->inputFiles_.at(
impl_->lastOpenedPrimaryInputFile_).fastClonedBranches;
711 for(std::set<std::string>::const_iterator it = fastClonedBranches.begin(), itEnd = fastClonedBranches.end();
713 if(clonedBranches.insert(*it).second) {
724 msg <<
"<RandomServiceStateFile>\n"
726 <<
"</RandomServiceStateFile>\n";
734 std::map<std::string, std::string>
const& metrics) {
737 msg <<
"<PerformanceReport>\n"
738 <<
" <PerformanceSummary Metric=\"" << metricClass <<
"\">\n";
740 typedef std::map<std::string, std::string>::const_iterator const_iterator;
741 for(const_iterator iter = metrics.begin(), iterEnd = metrics.end(); iter != iterEnd; ++iter) {
742 msg <<
" <Metric Name=\"" << iter->first <<
"\" "
743 <<
"Value=\"" << iter->second <<
"\"/>\n";
746 msg <<
" </PerformanceSummary>\n"
747 <<
"</PerformanceReport>\n";
756 std::map<std::string, std::string>
const& metrics) {
759 msg <<
"<PerformanceReport>\n"
760 <<
" <PerformanceModule Metric=\"" << metricClass <<
"\" "
761 <<
" Module=\"" << moduleName <<
"\" >\n";
763 typedef std::map<std::string, std::string>::const_iterator const_iterator;
764 for(const_iterator iter = metrics.begin(), iterEnd = metrics.end(); iter != iterEnd; ++iter) {
765 msg <<
" <Metric Name=\"" << iter->first <<
"\" "
766 <<
"Value=\"" << iter->second <<
"\"/>\n";
769 msg <<
" </PerformanceModule>\n"
770 <<
"</PerformanceReport>\n";
778 std::ostringstream
msg;
780 typedef std::vector<JobReport::OutputFile>::iterator iterator;
782 for(iterator
f =
impl_->outputFiles_.begin(), fEnd =
impl_->outputFiles_.end();
f != fEnd; ++
f) {
787 msg <<
"\n<LumiSections>";
789 typedef std::vector<JobReport::Token>::iterator iterator;
790 for(iterator iInput = f->contributingInputs.begin(),
791 iInputEnd = f->contributingInputs.end();
792 iInput != iInputEnd; ++iInput) {
800 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)
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)
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 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 SetAttribute(const char *name, const char *_value)
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)
unsigned int offset(bool)
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.
boost::scoped_ptr< JobReportImpl > impl_
Value const & findOrDefault(std::map< Key, Value > const &m, Key const &k, Value const &defaultValue)
tbb::concurrent_vector< InputFile > inputFilesSecSource_
void parentAfterFork(std::string const &jobReportFile)
void reportMessageInfo(std::map< std::string, double > const &messageData)
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 eventWrittenToFile(Token fileToken, unsigned int run, unsigned int event)
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 reportSkippedEvent(unsigned int run, unsigned int event)
void reportReadBranches()
OutputFile & getOutputFileForToken(Token t)