Skip to content

Commit 2f21500

Browse files
committed
DPL: fix dependency check with output-proxies and devices with sporadic input in TopologyPolicy
1 parent a399e59 commit 2f21500

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

Framework/Core/src/TopologyPolicy.cxx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ bool expendableDataDeps(DataProcessorSpec const& a, DataProcessorSpec const& b)
147147
if (!isAExpendable && !isBExpendable) {
148148
bool sporadic = sporadicDataDeps(a, b);
149149
if (sporadic) {
150-
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "false. Neither %s nor %s are expendable. However the former has sporadic inputs so we sort it after.",
150+
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "true. Neither %s nor %s are expendable. However the former has sporadic inputs so we sort it after.",
151151
a.name.c_str(), b.name.c_str());
152152
return true;
153153
}
@@ -159,7 +159,7 @@ bool expendableDataDeps(DataProcessorSpec const& a, DataProcessorSpec const& b)
159159
if (isAExpendable && isBExpendable) {
160160
bool sporadic = sporadicDataDeps(a, b);
161161
if (sporadic) {
162-
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "false. Both %s and %s are expendable. However the former has sporadic inputs, so we sort it after.",
162+
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "true. Both %s and %s are expendable. However the former has sporadic inputs, so we sort it after.",
163163
a.name.c_str(), b.name.c_str());
164164
return true;
165165
}
@@ -172,7 +172,7 @@ bool expendableDataDeps(DataProcessorSpec const& a, DataProcessorSpec const& b)
172172
if (isAExpendable && bResilient) {
173173
bool sporadic = sporadicDataDeps(a, b);
174174
if (sporadic) {
175-
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "false. %s is expendable but %s is resilient, however the former also has sporadic inputs, so we sort it after.",
175+
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "true. %s is expendable but %s is resilient, however the former also has sporadic inputs, so we sort it after.",
176176
a.name.c_str(), b.name.c_str());
177177
return true;
178178
}
@@ -185,11 +185,9 @@ bool expendableDataDeps(DataProcessorSpec const& a, DataProcessorSpec const& b)
185185
if (isAExpendable) {
186186
bool hasDependency = dataDeps(b, a);
187187
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "%s is expendable. %s from %s to %s => %s.",
188-
a.name.c_str(), hasDependency ? "There is however an inverse dependency" : "No inverse dependency", b.name.c_str(), a.name.c_str(),
188+
a.name .c_str(), hasDependency ? "There is however an inverse dependency" : "No inverse dependency", b.name.c_str(), a.name.c_str(),
189189
!hasDependency ? "true" : "false");
190190
if (!hasDependency) {
191-
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "%s is expendable. There is however an inverse dependecy from %s to %s => true.",
192-
a.name.c_str(), b.name.c_str(), a.name.c_str());
193191
return true;
194192
}
195193
bool sporadic = sporadicDataDeps(a, b);
@@ -205,7 +203,7 @@ bool expendableDataDeps(DataProcessorSpec const& a, DataProcessorSpec const& b)
205203
// b is expendable and a is not. We are fine with no dependency.
206204
bool sporadic = sporadicDataDeps(a, b);
207205
if (sporadic) {
208-
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "false. %s is expendable but %s is not. However the former has an sporadic input => true.",
206+
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "true. %s is expendable but %s is not. However the former has an sporadic input => true.",
209207
b.name.c_str(), a.name.c_str());
210208
return true;
211209
}
@@ -270,6 +268,13 @@ TopologyPolicy::DependencyChecker TopologyPolicyHelpers::alwaysDependent()
270268
hasDependency ? "true" : "false", dependent.name.c_str(), hasDependency ? "has" : "has not", ancestor.name.c_str());
271269
return hasDependency;
272270
}
271+
272+
bool hasAncestorSporadic = sporadicDataDeps(ancestor, dependent);
273+
if (hasAncestorSporadic) {
274+
O2_SIGNPOST_END(topology, sid, "alwaysDependent", "false. Dependent %s is an output proxy and ancestor %s has sporadic inputs", dependent.name.c_str(), ancestor.name.c_str());
275+
return false;
276+
}
277+
273278
O2_SIGNPOST_END(topology, sid, "alwaysDependent", "true by default. Ancestor %s is not an output proxy.", ancestor.name.c_str());
274279
return true;
275280
};

0 commit comments

Comments
 (0)