Skip to content

Commit

Permalink
DPL: improve message for missing data
Browse files Browse the repository at this point in the history
  • Loading branch information
ktf authored and davidrohr committed Oct 4, 2023
1 parent 1a6f6e4 commit 230c821
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Framework/Core/src/ExternalFairMQDeviceProxy.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,19 @@ void injectMissingData(fair::mq::Device& device, fair::mq::Parts& parts, std::ve
bool hassih = false;

// Do not check anything which has DISTSUBTIMEFRAME in it.
size_t expectedDataSpecs = 0;
for (size_t pi = 0; pi < present.size(); ++pi) {
auto& spec = routes[pi].matcher;
if (DataSpecUtils::asConcreteDataTypeMatcher(spec).description == header::DataDescription("DISTSUBTIMEFRAME")) {
present[pi] = true;
continue;
}
if (routes[pi].timeslice == 0) {
++expectedDataSpecs;
}
}

size_t foundDataSpecs = 0;
for (int msgidx = 0; msgidx < parts.Size(); msgidx += 2) {
const auto dh = o2::header::get<DataHeader*>(parts.At(msgidx)->GetData());
auto const sih = o2::header::get<SourceInfoHeader*>(parts.At(msgidx)->GetData());
Expand Down Expand Up @@ -294,6 +299,7 @@ void injectMissingData(fair::mq::Device& device, fair::mq::Parts& parts, std::ve
OutputSpec query{dh->dataOrigin, dh->dataDescription, dh->subSpecification};
if (DataSpecUtils::match(spec, query)) {
present[pi] = true;
++foundDataSpecs;
break;
}
}
Expand Down Expand Up @@ -357,7 +363,7 @@ void injectMissingData(fair::mq::Device& device, fair::mq::Parts& parts, std::ve
static int maxWarn = 10; // Correct would be o2::conf::VerbosityConfig::Instance().maxWarnDeadBeef, but Framework does not depend on CommonUtils..., but not so critical since receives will send correct number of DEADBEEF messages
static int contDeadBeef = 0;
if (++contDeadBeef <= maxWarn) {
LOGP(alarm, "Found {}/{} data specs, missing data specs: {}, injecting 0xDEADBEEF", present.size() - unmatchedDescriptions.size(), present.size(), missing);
LOGP(alarm, "Found {}/{} data specs, missing data specs: {}, injecting 0xDEADBEEF", foundDataSpecs, expectedDataSpecs, missing);
}
}
}
Expand Down

0 comments on commit 230c821

Please sign in to comment.