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(std::vector<std::string>::const_iterator iBranch = f.branchNames.begin(),
54 iBranchEnd = f.branchNames.end();
55 iBranch != iBranchEnd;
57 os <<
"\n <Branch>" <<
TiXmlText(*iBranch) <<
"</Branch>";
59 os <<
"\n</Branches>";
71 os <<
"\n<InputFile>";
73 os <<
"\n<InputType>" << f.
inputType <<
"</InputType>";
75 <<
"</InputSourceClass>";
84 os <<
"\n<OutputModuleClass>"
86 <<
"</OutputModuleClass>";
87 os <<
"\n<TotalEvents>"
89 <<
"</TotalEvents>\n";
93 os <<
"\n<BranchHash>"
100 template <
typename S>
108 typedef std::set<unsigned int>::iterator iterator;
110 os <<
" <LumiSection ID=\"" << *il <<
"\"/>\n";
146 <<
"Access reported for input file with token "
148 <<
" but no matching input file is found\n";
153 <<
"Access reported for input file with token "
155 <<
" after this file has been closed.\n"
156 <<
"File record follows:\n"
165 if(t >= outputFiles_.size()) {
167 <<
"Access reported for output file with token "
169 <<
" but no matching output file is found\n";
171 if(outputFiles_[t].fileHasBeenClosed) {
173 <<
"Access reported for output file with token "
175 <<
" after this file has been closed.\n"
176 <<
"File record follows:\n"
180 return outputFiles_[
t];
190 typedef std::vector<JobReport::OutputFile>::iterator iterator;
191 for(iterator
outFile = outputFiles_.begin(), outFileEnd = outputFiles_.end();
outFile != outFileEnd; ++
outFile) {
192 outFile->contributingInputs.push_back(t);
202 result.reserve(inputFiles_.size());
203 for(
unsigned int i = 0;
i < inputFiles_.size(); ++
i) {
204 if(inputFiles_[
i].fileHasBeenClosed ==
false) {
216 result.reserve(outputFiles_.size());
217 for(
unsigned int i = 0;
i < outputFiles_.size(); ++
i) {
218 if(outputFiles_[
i].fileHasBeenClosed ==
false) {
233 typedef std::map<JobReport::RunNumber, JobReport::RunReport>::const_iterator const_iterator;
234 for(const_iterator iRun = f.runReports.begin(), iRunEnd = f.runReports.end(); iRun != iRunEnd; ++iRun) {
235 *ost_ << iRun->second;
237 *ost_ <<
"\n</Runs>\n";
238 *ost_ <<
"</InputFile>\n";
264 typedef std::map<JobReport::RunNumber, JobReport::RunReport>::const_iterator const_iterator;
265 for(const_iterator iRun = f.runReports.begin(), iRunEnd = f.runReports.end(); iRun != iRunEnd; ++iRun) {
266 *ost_ << iRun->second;
268 *ost_ <<
"\n</Runs>\n";
270 *ost_ <<
"\n<Inputs>";
271 for(std::vector<JobReport::Token>::const_iterator
272 iInput = f.contributingInputs.begin(),
273 iInputEnd = f.contributingInputs.end();
274 iInput != iInputEnd; ++iInput) {
276 *ost_ <<
"\n<Input>";
280 *ost_ <<
"\n</Input>";
282 *ost_ <<
"\n</Inputs>";
283 *ost_ <<
"\n</File>\n";
292 for(std::vector<JobReport::InputFile>::iterator ipos = inputFiles_.begin(), iposEnd = inputFiles_.end();
293 ipos != iposEnd; ++ipos) {
294 if(!(ipos->fileHasBeenClosed)) {
295 writeInputFile(*ipos);
298 for(std::vector<JobReport::OutputFile>::iterator opos = outputFiles_.begin(), oposEnd = outputFiles_.end();
299 opos != oposEnd; ++opos) {
300 if(!(opos->fileHasBeenClosed)) {
301 writeOutputFile(*opos);
307 std::string
const&
value) {
314 *ost_ <<
"\n<GeneratorInfo>\n";
315 for(std::map<std::string, std::string>::iterator
pos = generatorInfo_.begin(),
316 posEnd = generatorInfo_.end();
318 std::ostringstream
msg;
319 msg <<
"\n<Data Name=\"" <<
pos->first
320 <<
"\" Value=\"" <<
pos->second <<
"\"/>";
323 *ost_ <<
"</GeneratorInfo>\n";
328 std::vector<Token> openFiles;
329 openOutputFiles(openFiles);
330 for(std::vector<Token>::iterator iToken = openFiles.begin(), iTokenEnd = openFiles.end(); iToken != iTokenEnd; ++iToken) {
336 if(theFile.
runReports.count(runNumber) == 0) {
340 std::make_pair(runNumber, newReport)
348 std::vector<Token> openFiles;
349 openInputFiles(openFiles);
350 for(std::vector<Token>::iterator iToken = openFiles.begin(), iTokenEnd = openFiles.end(); iToken != iTokenEnd; ++iToken) {
356 if(theFile.
runReports.count(runNumber) == 0) {
359 theFile.
runReports.insert(std::make_pair(runNumber, newReport));
366 std::vector<Token> openFiles;
367 openOutputFiles(openFiles);
368 for(std::vector<Token>::iterator iToken = openFiles.begin(), iTokenEnd = openFiles.end(); iToken != iTokenEnd; ++iToken) {
377 if(theFile.
runReports.count(runNumber) == 0) {
380 theFile.
runReports.insert(std::make_pair(runNumber, newReport));
386 std::map<JobReport::RunNumber, JobReport::RunReport>::iterator finder;
392 (finder->second).lumiSections.insert(lumiSect);
397 std::vector<Token> openFiles;
398 openInputFiles(openFiles);
399 for(std::vector<Token>::iterator iToken = openFiles.begin(), iTokenEnd = openFiles.end(); iToken != iTokenEnd; ++iToken) {
408 if(theFile.
runReports.count(runNumber) == 0) {
411 theFile.
runReports.insert(std::make_pair(runNumber, newReport));
417 std::map<JobReport::RunNumber, JobReport::RunReport>::iterator finder;
423 (finder->second).lumiSections.insert(lumiSect);
428 impl_->writeGeneratorInfo();
431 *(
impl_->ost_) <<
"</FrameworkJobReport>\n" << std::flush;
441 *(
impl_->ost_) <<
"<FrameworkJobReport>\n";
447 toFileName(std::string
const& jobReportFile,
unsigned int childIndex,
unsigned int numberOfChildren, std::ostringstream& ofilename) {
448 char filler = ofilename.fill();
449 unsigned int numberOfDigitsInIndex = 0U;
450 while (numberOfChildren != 0) {
451 ++numberOfDigitsInIndex;
452 numberOfChildren /= 10;
454 if(numberOfDigitsInIndex == 0) {
455 numberOfDigitsInIndex = 3;
458 if(offset == std::string::npos) {
459 ofilename << jobReportFile;
460 ofilename <<
'_' << std::setw(numberOfDigitsInIndex) << std::setfill(
'0') << childIndex << std::setfill(filler);
462 ofilename << jobReportFile.substr(0, offset);
463 ofilename <<
'_' << std::setw(numberOfDigitsInIndex) << std::setfill(
'0') << childIndex << std::setfill(filler);
464 ofilename << jobReportFile.substr(offset);
472 *(
impl_->ost_) <<
"<ChildProcessFiles>\n";
473 for(
unsigned int i = 0;
i < numberOfChildren; ++
i) {
474 std::ostringstream ofilename;
475 toFileName(jobReportFile,
i, numberOfChildren, ofilename);
476 *(
impl_->ost_) <<
" <ChildProcessFile>" << ofilename.str() <<
"</ChildProcessFile>\n";
478 *(
impl_->ost_) <<
"</ChildProcessFiles>\n";
479 *(
impl_->ost_) <<
"</FrameworkJobReport>\n";
480 std::ofstream*
p =
dynamic_cast<std::ofstream *
>(
impl_->ost_);
493 std::ofstream*
p =
dynamic_cast<std::ofstream*
>(
impl_->ost_);
495 std::ostringstream ofilename;
496 toFileName(jobReportFile, childIndex, numberOfChildren, ofilename);
497 p->open(ofilename.str().c_str());
498 *p <<
"<FrameworkJobReport>\n";
503 std::string
const& logicalFileName,
505 std::string
const& inputType,
506 std::string
const& inputSourceClassName,
507 std::string
const& moduleLabel,
508 std::string
const& guid,
509 std::vector<std::string>
const& branchNames) {
532 impl_->insertInputForOutputs(newToken);
557 impl_->writeInputFile(f);
562 std::string
const& logicalFileName,
564 std::string
const& outputModuleClassName,
565 std::string
const& moduleLabel,
566 std::string
const& guid,
568 std::string
const& branchHash,
569 std::vector<std::string>
const& branchNames) {
589 return impl_->outputFiles_.size()-1;
607 impl_->writeOutputFile(f);
634 std::vector<Token>
const& inputTokens) {
645 msg <<
"<SkippedEvent Run=\"" << run <<
"\"";
646 msg <<
" Event=\"" <<
event <<
"\" />\n";
654 impl_->associateLumiSection(run, lumiSectId);
659 impl_->associateInputLumiSection(run, lumiSectId);
664 impl_->associateRun(run);
668 impl_->associateInputRun(run);
673 std::string
const& longDesc) {
676 msg <<
"<FrameworkError ExitStatus=\"1\" Type=\"" << shortDesc <<
"\" >\n";
677 msg <<
"<![CDATA[\n" << longDesc <<
"\n]]>\n";
678 msg <<
"</FrameworkError>\n";
689 msg <<
"<AnalysisFile>\n"
690 <<
" <FileName>" <<
TiXmlText(fileName) <<
"</FileName>\n";
692 typedef std::map<std::string, std::string>::const_iterator const_iterator;
693 for(const_iterator
pos = fileData.begin(), posEnd = fileData.end();
pos != posEnd; ++
pos) {
694 msg <<
" <" <<
pos->first
695 <<
" Value=\"" <<
pos->second <<
"\" />"
698 msg <<
"</AnalysisFile>\n";
706 std::string
const& longDesc,
707 int const& exitCode) {
711 msg <<
"<FrameworkError ExitStatus=\""<< exitCode
712 <<
"\" Type=\"" << shortDesc <<
"\" >\n";
713 msg <<
"<![CDATA[\n" << longDesc <<
"\n]]>\n";
714 msg <<
"</FrameworkError>\n";
722 std::string
const& lfn) {
728 msg << skipped <<
"\n";
741 msg << fallback <<
"\n";
742 msg <<
"<![CDATA[\n" << err <<
"\n]]>\n";
752 msg <<
"<MemoryService>\n";
754 typedef std::vector<std::string>::const_iterator const_iterator;
755 for(const_iterator
pos = memoryData.begin(), posEnd = memoryData.end();
pos != posEnd; ++
pos) {
758 msg <<
"</MemoryService>\n";
767 msg <<
"<MessageSummary>\n";
768 typedef std::map<std::string, double>::const_iterator const_iterator;
769 for(const_iterator
pos = messageData.begin(), posEnd = messageData.end();
pos != posEnd; ++
pos) {
770 msg <<
" <" <<
pos->first
771 <<
" Value=\"" <<
pos->second <<
"\" />"
774 msg <<
"</MessageSummary>\n";
782 std::ostream& ost = *(
impl_->ost_);
783 ost <<
"<ReadBranches>\n";
784 typedef std::map<std::string, long long>::const_iterator const_iterator;
785 for(const_iterator it =
impl_->readBranches_.begin(), itEnd =
impl_->readBranches_.end(); it != itEnd; ++it) {
789 ost << branch <<
"\n";
792 ost <<
"</ReadBranches>\n";
800 if(
impl_->fastClonedBranches_->find(branchName) ==
impl_->fastClonedBranches_->end()) {
801 ++
impl_->readBranches_[branchName];
807 for(std::set<std::string>::const_iterator it = fastClonedBranches.begin(), itEnd = fastClonedBranches.end();
809 if(
impl_->fastClonedBranches_->insert(*it).second) {
817 impl_->addGeneratorInfo(name, value);
823 msg <<
"<RandomServiceStateFile>\n"
825 <<
"</RandomServiceStateFile>\n";
845 std::map<std::string, std::string>
const& metrics) {
848 msg <<
"<PerformanceReport>\n"
849 <<
" <PerformanceSummary Metric=\"" << metricClass <<
"\">\n";
851 typedef std::map<std::string, std::string>::const_iterator const_iterator;
852 for(const_iterator iter = metrics.begin(), iterEnd = metrics.end(); iter != iterEnd; ++iter) {
853 msg <<
" <Metric Name=\"" << iter->first <<
"\" "
854 <<
"Value=\"" << iter->second <<
"\"/>\n";
857 msg <<
" </PerformanceSummary>\n"
858 <<
"</PerformanceReport>\n";
866 std::string
const& moduleName,
867 std::map<std::string, std::string>
const& metrics) {
870 msg <<
"<PerformanceReport>\n"
871 <<
" <PerformanceModule Metric=\"" << metricClass <<
"\" "
872 <<
" Module=\"" << moduleName <<
"\" >\n";
874 typedef std::map<std::string, std::string>::const_iterator const_iterator;
875 for(const_iterator iter = metrics.begin(), iterEnd = metrics.end(); iter != iterEnd; ++iter) {
876 msg <<
" <Metric Name=\"" << iter->first <<
"\" "
877 <<
"Value=\"" << iter->second <<
"\"/>\n";
880 msg <<
" </PerformanceModule>\n"
881 <<
"</PerformanceReport>\n";
889 std::ostringstream
msg;
891 typedef std::vector<JobReport::OutputFile>::iterator iterator;
893 for(iterator
f =
impl_->outputFiles_.begin(), fEnd =
impl_->outputFiles_.end();
f != fEnd; ++
f) {
898 msg <<
"\n<LumiSections>";
907 typedef std::vector<JobReport::Token>::iterator iterator;
908 for(iterator iInput = f->contributingInputs.begin(),
909 iInputEnd = f->contributingInputs.end();
910 iInput != iInputEnd; ++iInput) {
918 msg <<
"\n</Inputs>";
void openInputFiles(std::vector< Token > &tokens)
void reportReadBranch(std::string const &branchName)
Inform the job report that a branch has been read.
void associateRun(unsigned int runNumber)
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 eventWrittenToFile(Token fileToken, unsigned int run, unsigned int event)
std::string outputModuleClassName
std::string physicalFileName
void reportFastCopyingStatus(Token t, std::string const &inputFileName, bool fastCopying)
void reportFallbackAttempt(std::string const &pfn, std::string const &lfn, std::string const &err)
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)
void reportFastClonedBranches(std::set< std::string > const &fastClonedBranches, long long nEvents)
Inform the job report that branches have been fast Cloned.
void overrideEventsWritten(Token fileToken, int const eventsWritten)
void reportAnalysisFile(std::string const &fileName, std::map< std::string, std::string > const &fileData)
void reportRandomStateFile(std::string const &name)
std::map< std::string, bool > fastCopyingInputs
std::string logicalFileName
void reportDataType(Token fileToken, std::string const &dataType)
S & print(S &os, JobReport::InputFile const &f)
void outputFileClosed(Token fileToken)
std::vector< InputFile > inputFiles_
std::vector< Token > contributingInputs
void writeInputFile(InputFile const &f)
void inputFileClosed(Token fileToken)
void SetAttribute(const char *name, const char *_value)
std::map< RunNumber, RunReport > runReports
std::set< unsigned int > lumiSections
void parentAfterFork(std::string const &jobReportFile)
void reportSkippedEvent(unsigned int run, unsigned int event)
void openOutputFiles(std::vector< Token > &tokens)
unsigned int offset(bool)
void reportPSetHash(std::string const &hashValue)
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 eventReadFromFile(Token fileToken, unsigned int run, unsigned int event)
void reportInputRunNumber(unsigned int run)
void associateInputRun(unsigned int runNumber)
InputFile & getInputFileForToken(Token t)
S & formatFile(T const &f, S &os)
void childAfterFork(std::string const &jobReportFile, unsigned int childIndex, unsigned int numberOfChildren)
New output file for child.
boost::scoped_ptr< JobReportImpl > impl_
void reportGeneratorInfo(std::string const &name, std::string const &value)
void reportLumiSection(unsigned int run, unsigned int lumiSectId)
Value const & findOrDefault(std::map< Key, Value > const &m, Key const &k, Value const &defaultValue)
void reportMemoryInfo(std::vector< std::string > const &memoryData)
std::string dumpFiles(void)
debug/test util
void reportError(std::string const &shortDesc, std::string const &longDesc)
void reportInputLumiSection(unsigned int run, unsigned int lumiSectId)
void writeOutputFile(OutputFile const &f)
void overrideEventsRead(Token fileToken, int const eventsRead)
void reportPerformanceSummary(std::string const &metricClass, std::map< std::string, std::string > const &metrics)
void insertInputForOutputs(Token t)
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
void parentBeforeFork(std::string const &jobReportFile, unsigned int numberOfChildren)
void associateInputLumiSection(unsigned int runNumber, unsigned int lumiSection)
void writeGeneratorInfo(void)
void addGeneratorInfo(std::string const &name, std::string const &value)
void reportPerformanceForModule(std::string const &metricClass, std::string const &moduleName, std::map< std::string, std::string > const &metrics)
void reportMessageInfo(std::map< std::string, double > const &messageData)
void overrideContributingInputs(Token outputToken, std::vector< Token > const &inputTokens)
void reportReadBranches()
void associateLumiSection(unsigned int runNumber, unsigned int lumiSection)
OutputFile & getOutputFileForToken(Token t)
void reportRunNumber(unsigned int run)
void reportSkippedFile(std::string const &pfn, std::string const &lfn)