Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix edmProvDump handling of processing history #21469

Merged
merged 1 commit into from Nov 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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