Skip to content

Commit 63f9a7d

Browse files
conditioning for next superstep
1 parent 9215295 commit 63f9a7d

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

include/osp/bsp/scheduler/GreedySchedulers/GrowLocalMaxBsp.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,15 @@ ReturnStatus GrowLocalSSP<GraphT>::ComputeSchedule(MaxBspSchedule<GraphT> &sched
130130
currentlyReady.insert(currentlyReady.end(), stepFutureReady.begin(), stepFutureReady.end());
131131
std::inplace_merge(currentlyReady.begin(), std::next(currentlyReady.begin(), lengthCurrentlyReady), currentlyReady.end());
132132

133+
const typename std::deque<VertexType>::difference_type maxCurrentlyReadyUsage
134+
= (staleness == 1U) ? std::distance(currentlyReady.begin(), currentlyReady.end())
135+
: ((std::distance(currentlyReady.begin(), currentlyReady.end())
136+
+ std::distance(futureReady[(superStep + 1U) % staleness].begin(),
137+
futureReady[(superStep + 1U) % staleness].end())
138+
+ 2)
139+
/ 3)
140+
* 2;
141+
133142
std::vector<std::vector<std::pair<VertexType, unsigned>>> &stepProcReady = procReady[reducedSuperStep];
134143
for (auto &procHeap : stepProcReady) {
135144
std::make_heap(procHeap.begin(), procHeap.end(), std::greater<>{}); // min heap
@@ -295,6 +304,10 @@ ReturnStatus GrowLocalSSP<GraphT>::ComputeSchedule(MaxBspSchedule<GraphT> &sched
295304
continueSuperstepAttemps = false;
296305
}
297306

307+
if (std::distance(currentlyReady.cbegin(), currentlyReadyIter) > maxCurrentlyReadyUsage) {
308+
continueSuperstepAttemps = false;
309+
}
310+
298311
if (totalAssigned + newTotalAssigned == numVertices) {
299312
continueSuperstepAttemps = false;
300313
}

0 commit comments

Comments
 (0)