Skip to content

Commit

Permalink
Fix edmProvDump handling of processing history
Browse files Browse the repository at this point in the history
Recording the processing history was not always correct for
edmProvDump. This did not affect the default print out from the
program but did affect getting additional information. Previously,
only the earliest process would get its additional information dumped
if there was only one process history associated with the file.
  • Loading branch information
Dr15Jones committed Nov 27, 2017
1 parent a712be6 commit 3803b9b
Showing 1 changed file with 28 additions and 31 deletions.
59 changes: 28 additions & 31 deletions IOPool/Common/bin/EdmProvDump.cc
Expand Up @@ -646,43 +646,38 @@ ProvenanceDumper::dumpParameterSetForID_(edm::ParameterSetID const& id) {
void
ProvenanceDumper::dumpProcessHistory_() {
std::cout << "Processing History:" << std::endl;
if(1 == phv_.size()) {
std::cout << *phv_.begin();
historyGraph_.addChild(HistoryNode(*(phv_.begin()->begin()), 1));
} else {
std::map<edm::ProcessConfigurationID, unsigned int> simpleIDs;
for(auto const& ph : phv_) {
//loop over the history entries looking for matches
HistoryNode* parent = &historyGraph_;
for(auto const& pc : ph) {
if(parent->size() == 0) {
unsigned int id = simpleIDs[pc.id()];
if(0 == id) {
id = 1;
simpleIDs[pc.id()] = id;
std::map<edm::ProcessConfigurationID, unsigned int> simpleIDs;
for(auto const& ph : phv_) {
//loop over the history entries looking for matches
HistoryNode* parent = &historyGraph_;
for(auto const& pc : ph) {
if(parent->size() == 0) {
unsigned int id = simpleIDs[pc.id()];
if(0 == id) {
id = 1;
simpleIDs[pc.id()] = id;
}
parent->addChild(HistoryNode(pc, id));
parent = parent->lastChildAddress();
} else {
//see if this is unique
bool isUnique = true;
for(auto& child : *parent) {
if(child.configurationID() == pc.id()) {
isUnique = false;
parent = &child;
break;
}
parent->addChild(HistoryNode(pc, id));
}
if(isUnique) {
simpleIDs[pc.id()] = parent->size() + 1;
parent->addChild(HistoryNode(pc, simpleIDs[pc.id()]));
parent = parent->lastChildAddress();
} else {
//see if this is unique
bool isUnique = true;
for(auto& child : *parent) {
if(child.configurationID() == pc.id()) {
isUnique = false;
parent = &child;
break;
}
}
if(isUnique) {
simpleIDs[pc.id()] = parent->size() + 1;
parent->addChild(HistoryNode(pc, simpleIDs[pc.id()]));
parent = parent->lastChildAddress();
}
}
}
}
historyGraph_.printHistory();
}
historyGraph_.printHistory();
}

void
Expand Down Expand Up @@ -875,6 +870,7 @@ ProvenanceDumper::work_() {

dumpProcessHistory_();


if (productRegistryPresent_) {
std::cout << "---------Producers with data in file---------" << std::endl;
}
Expand Down Expand Up @@ -1021,6 +1017,7 @@ ProvenanceDumper::work_() {
std::cout <<sout.str()<<std::endl;
}
} // end loop over module label/process

if(productRegistryPresent_ && showOtherModules_) {
std::cout << "---------Other Modules---------" << std::endl;
historyGraph_.printOtherModulesHistory(psm_, moduleToIdBranches, findMatch_, errorLog_);
Expand Down

0 comments on commit 3803b9b

Please sign in to comment.