You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If none is expendable. We simply return false and sort as usual.
116
151
if (!isAExpendable && !isBExpendable) {
152
+
bool sporadic = sporadicDataDeps(a, b);
153
+
if (sporadic) {
154
+
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "false. Neither %s nor %s are expendable. However the former has sporadic inputs so we sort it after.",
155
+
a.name.c_str(), b.name.c_str());
156
+
returntrue;
157
+
}
117
158
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "false. Neither %s nor %s are expendable. No dependency beyond data deps.",
118
159
a.name.c_str(), b.name.c_str());
119
160
returnfalse;
120
161
}
121
162
// If both are expendable. We return false and sort as usual.
122
163
if (isAExpendable && isBExpendable) {
164
+
bool sporadic = sporadicDataDeps(a, b);
165
+
if (sporadic) {
166
+
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "false. Both %s and %s are expendable. However the former has sporadic inputs, so we sort it after.",
167
+
a.name.c_str(), b.name.c_str());
168
+
returntrue;
169
+
}
123
170
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "false. Both %s and %s are expendable. No dependency.",
124
171
a.name.c_str(), b.name.c_str());
125
172
returnfalse;
126
173
}
127
174
128
-
// If b is expendable but b is resilient, we can keep the same order.
175
+
// If a is expendable but b is resilient, we can keep the same order.
129
176
if (isAExpendable && bResilient) {
130
-
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "false. %s is expendable but %s is resilient, no need to add an unneeded dependency",
177
+
bool sporadic = sporadicDataDeps(a, b);
178
+
if (sporadic) {
179
+
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.",
180
+
a.name.c_str(), b.name.c_str());
181
+
returntrue;
182
+
}
183
+
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "false. %s is expendable but %s is resilient. No need to do do anything.",
131
184
a.name.c_str(), b.name.c_str());
132
185
returnfalse;
133
186
}
@@ -138,11 +191,31 @@ bool expendableDataDeps(DataProcessorSpec const& a, DataProcessorSpec const& b)
138
191
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "%s is expendable. %s from %s to %s => %s.",
139
192
a.name.c_str(), hasDependency ? "There is however an inverse dependency" : "No inverse dependency", b.name.c_str(), a.name.c_str(),
140
193
!hasDependency ? "true" : "false");
141
-
return !hasDependency;
194
+
if (!hasDependency) {
195
+
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "%s is expendable. There is however an inverse dependecy from %s to %s => true.",
196
+
a.name.c_str(), b.name.c_str(), a.name.c_str());
197
+
returntrue;
198
+
}
199
+
bool sporadic = sporadicDataDeps(a, b);
200
+
if (sporadic) {
201
+
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "%s is expendable. No inverse dependency from %s to %s. However the former has an occasioanl input => true.",
202
+
a.name.c_str(), b.name.c_str(), a.name.c_str());
203
+
}
204
+
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "%s is expendable. No inverse dependency from %s to %s => false.",
205
+
a.name.c_str(), b.name.c_str(), a.name.c_str());
206
+
returnfalse;
207
+
}
208
+
// b is expendable and a is not. We are fine with no dependency.
209
+
bool sporadic = sporadicDataDeps(a, b);
210
+
if (sporadic) {
211
+
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "false. %s is expendable but %s is not. However the former has an sporadic input => true.",
212
+
b.name.c_str(), a.name.c_str());
213
+
returntrue;
142
214
}
143
215
// b is expendable and a is not. We are fine with no dependency.
144
216
O2_SIGNPOST_END(topology, sid, "expendableDataDeps", "false. %s is expendable but %s is not. No need to add an unneeded dependency.",
0 commit comments