Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct CompletionPolicyHelpers {
return consumeWhenAll("consume-all", matcher);
}

/// as consumeWhenAll, but ensures that records are processed with incremental DataHeader::tfCounter
/// as consumeWhenAll, but ensures that records are processed with incremental timeSlice (DataHeader::startTime)
static CompletionPolicy consumeWhenAllOrdered(const char* name, CompletionPolicy::Matcher matcher);
/// Default matcher applies for all devices
static CompletionPolicy consumeWhenAllOrdered(CompletionPolicy::Matcher matcher = [](auto const&) -> bool { return true; })
Expand Down
8 changes: 4 additions & 4 deletions Framework/Core/src/CompletionPolicyHelpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,17 @@ CompletionPolicy CompletionPolicyHelpers::consumeWhenAll(const char* name, Compl

CompletionPolicy CompletionPolicyHelpers::consumeWhenAllOrdered(const char* name, CompletionPolicy::Matcher matcher)
{
auto nextTfCounter = std::make_shared<long int>(0);
auto callback = [nextTfCounter](InputSpan const& inputs) -> CompletionPolicy::CompletionOp {
auto nextTimeSlice = std::make_shared<long int>(0);
auto callback = [nextTimeSlice](InputSpan const& inputs) -> CompletionPolicy::CompletionOp {
for (auto& input : inputs) {
if (input.header == nullptr) {
return CompletionPolicy::CompletionOp::Wait;
}
if (framework::DataRefUtils::isValid(input) && framework::DataRefUtils::getHeader<o2::header::DataHeader*>(input)->tfCounter != *nextTfCounter) {
if (framework::DataRefUtils::isValid(input) && framework::DataRefUtils::getHeader<o2::framework::DataProcessingHeader*>(input)->startTime != *nextTimeSlice) {
return CompletionPolicy::CompletionOp::Wait;
}
}
(*nextTfCounter)++;
(*nextTimeSlice)++;
return CompletionPolicy::CompletionOp::ConsumeAndRescan;
};
return CompletionPolicy{name, matcher, callback};
Expand Down