Skip to content

Commit f155460

Browse files
added explanation of encoding
1 parent 223d353 commit f155460

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,14 @@ class GrowLocalAutoCoresParallel : public Scheduler<GraphT> {
234234
const unsigned pp1 = p + 1U;
235235
const unsigned base = pp1 * totalAttempts;
236236
const unsigned remainder = schedule.AssignedProcessor(succ) - base;
237-
if ((remainder < pp1) & (remainder != 0U)) {
237+
// Encoding into processor of children where they can be sheduled locally through
238+
// iteration * (p + 1) + proc
239+
// where proc is either the processor where is can be enqueued in the processor local queue
240+
// or equal to p when it can't be enqueued in any local queue.
241+
// The extra encoding of iteration ensures that previous superstep attempts do not affect the current superstep
242+
if ((remainder < pp1) & (remainder != 0U)) { // The first condition implies that the iteration is
243+
// the same as the current and the second checks if
244+
// it has already been to a different processor
238245
schedule.SetAssignedProcessor(succ, base + p);
239246
} else {
240247
schedule.SetAssignedProcessor(succ, base + 0U);
@@ -304,7 +311,14 @@ class GrowLocalAutoCoresParallel : public Scheduler<GraphT> {
304311
const unsigned pp1 = p + 1U;
305312
const unsigned base = pp1 * totalAttempts;
306313
const unsigned remainder = schedule.AssignedProcessor(succ) - base;
307-
if ((remainder < pp1) & (remainder != proc)) {
314+
// Encoding into processor of children where they can be sheduled locally through
315+
// iteration * (p + 1) + proc
316+
// where proc is either the processor where is can be enqueued in the processor local queue
317+
// or equal to p when it can't be enqueued in any local queue.
318+
// The extra encoding of iteration ensures that previous superstep attempts do not affect the current superstep
319+
if ((remainder < pp1) & (remainder != proc)) { // The first condition implies that the iteration is
320+
// the same as the current and the second checks if
321+
// it has already been to a different processor
308322
schedule.SetAssignedProcessor(succ, base + p);
309323
} else {
310324
schedule.SetAssignedProcessor(succ, base + proc);

0 commit comments

Comments
 (0)