Skip to content

Commit fe1d400

Browse files
ehellbarktf
authored andcommitted
keeping the previous logic that output-proxies should be last
1 parent 9d56f5d commit fe1d400

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Framework/Core/src/TopologyPolicy.cxx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,14 @@ bool expendableDataDeps(DataProcessorSpec const& a, DataProcessorSpec const& b)
142142
bool isBExpendable = std::find_if(b.labels.begin(), b.labels.end(), checkExpendable) != b.labels.end();
143143
bool isAExpendable = std::find_if(a.labels.begin(), a.labels.end(), checkExpendable) != a.labels.end();
144144
bool bResilient = std::find_if(b.labels.begin(), b.labels.end(), checkResilient) != b.labels.end();
145+
const std::regex matcher(".*output-proxy.*");
146+
std::cmatch m;
147+
bool isBOutputProxy = std::regex_match(b.name.data(), m, matcher);
145148

146149
// If none is expendable. We simply return false and sort as usual.
147150
if (!isAExpendable && !isBExpendable) {
148151
bool sporadic = sporadicDataDeps(a, b);
149-
if (sporadic) {
152+
if (sporadic && !isBOutputProxy) {
150153
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "true. Neither %s nor %s are expendable. However the former has sporadic inputs so we sort it after.",
151154
a.name.c_str(), b.name.c_str());
152155
return true;
@@ -158,7 +161,7 @@ bool expendableDataDeps(DataProcessorSpec const& a, DataProcessorSpec const& b)
158161
// If both are expendable. We return false and sort as usual.
159162
if (isAExpendable && isBExpendable) {
160163
bool sporadic = sporadicDataDeps(a, b);
161-
if (sporadic) {
164+
if (sporadic && !isBOutputProxy) {
162165
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "true. Both %s and %s are expendable. However the former has sporadic inputs, so we sort it after.",
163166
a.name.c_str(), b.name.c_str());
164167
return true;
@@ -171,7 +174,7 @@ bool expendableDataDeps(DataProcessorSpec const& a, DataProcessorSpec const& b)
171174
// If a is expendable but b is resilient, we can keep the same order.
172175
if (isAExpendable && bResilient) {
173176
bool sporadic = sporadicDataDeps(a, b);
174-
if (sporadic) {
177+
if (sporadic && !isBOutputProxy) {
175178
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.",
176179
a.name.c_str(), b.name.c_str());
177180
return true;
@@ -191,7 +194,7 @@ bool expendableDataDeps(DataProcessorSpec const& a, DataProcessorSpec const& b)
191194
return true;
192195
}
193196
bool sporadic = sporadicDataDeps(a, b);
194-
if (sporadic) {
197+
if (sporadic && !isBOutputProxy) {
195198
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "%s is expendable. No inverse dependency from %s to %s. However the former has an occasioanl input => true.",
196199
a.name.c_str(), b.name.c_str(), a.name.c_str());
197200
return true;
@@ -262,11 +265,6 @@ TopologyPolicy::DependencyChecker TopologyPolicyHelpers::alwaysDependent()
262265
return hasDependency;
263266
}
264267

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-
270268
O2_SIGNPOST_END(topology, sid, "alwaysDependent", "true by default. Ancestor %s is not an output proxy.", ancestor.name.c_str());
271269
return true;
272270
};

0 commit comments

Comments
 (0)