Skip to content

Commit 9d56f5d

Browse files
ehellbarktf
authored andcommitted
DPL: fixes for dependency checks of devices with sporadic inputs in TopologyPolicy
1 parent 1013f69 commit 9d56f5d

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

Framework/Core/src/TopologyPolicy.cxx

Lines changed: 9 additions & 12 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
}
@@ -188,8 +188,6 @@ bool expendableDataDeps(DataProcessorSpec const& a, DataProcessorSpec const& b)
188188
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);
@@ -203,13 +201,6 @@ bool expendableDataDeps(DataProcessorSpec const& a, DataProcessorSpec const& b)
203201
return false;
204202
}
205203
// b is expendable and a is not. We are fine with no dependency.
206-
bool sporadic = sporadicDataDeps(a, b);
207-
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.",
209-
b.name.c_str(), a.name.c_str());
210-
return true;
211-
}
212-
// b is expendable and a is not. We are fine with no dependency.
213204
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "false. %s is expendable but %s is not. No need to add an unneeded dependency.",
214205
b.name.c_str(), a.name.c_str());
215206

@@ -270,6 +261,12 @@ TopologyPolicy::DependencyChecker TopologyPolicyHelpers::alwaysDependent()
270261
hasDependency ? "true" : "false", dependent.name.c_str(), hasDependency ? "has" : "has not", ancestor.name.c_str());
271262
return hasDependency;
272263
}
264+
265+
if (sporadicDataDeps(ancestor, dependent)) {
266+
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());
267+
return false;
268+
}
269+
273270
O2_SIGNPOST_END(topology, sid, "alwaysDependent", "true by default. Ancestor %s is not an output proxy.", ancestor.name.c_str());
274271
return true;
275272
};

0 commit comments

Comments
 (0)