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

Please consider the following formatting changes to #12536 #243

Closed
wants to merge 2 commits into from
Closed
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
7 changes: 6 additions & 1 deletion Framework/Core/src/CompletionPolicyHelpers.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ CompletionPolicy CompletionPolicyHelpers::consumeWhenAll(const char* name, Compl

size_t si = 0;
bool missingSporadic = false;
bool needsProcessing = false;
size_t currentTimeslice = -1;
for (auto& input : inputs) {
assert(si < specs.size());
Expand All @@ -126,6 +127,9 @@ CompletionPolicy CompletionPolicyHelpers::consumeWhenAll(const char* name, Compl
if (dph && !TimingInfo::timesliceIsTimer(dph->startTime)) {
currentTimeslice = dph->startTime;
}
// If we have at least some data, we can consume, otherwise we can Discard once
// we are sure that no more data will come.
needsProcessing |= (spec.lifetime != Lifetime::Condition);
}
}
// If some sporadic inputs are missing, we wait for them util we are sure they will not come,
Expand All @@ -136,7 +140,8 @@ CompletionPolicy CompletionPolicyHelpers::consumeWhenAll(const char* name, Compl
if (missingSporadic && currentTimeslice >= oldestPossibleTimeslice) {
return CompletionPolicy::CompletionOp::Retry;
}
return CompletionPolicy::CompletionOp::Consume;
// We only consume if we have something which needs processing.
return needsProcessing ? CompletionPolicy::CompletionOp::Consume : CompletionPolicy::CompletionOp::Discard;
};
return CompletionPolicy{name, matcher, callback};
}
Expand Down