Skip to content

Commit 8b84b26

Browse files
authored
Update rcb.c
Make changes so that the "group_blocks" option does what it says. The previous code tried to do something a little different from that and was incorrect in its implementation.
1 parent 19ecfdc commit 8b84b26

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

ref/rcb.c

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -380,29 +380,16 @@ void sort(int div, int fact, int dir)
380380
}
381381

382382
if (group_blocks) {
383-
for (j = 0; j < (fact-1); j++) {
384-
my_extra[j] = 0;
385-
if (extra[j]) {
386-
MPI_Scan(&bin[point[j]], &i, 1, MPI_INT, MPI_SUM, comms[div]);
387-
if (i >= extra[j])
388-
my_extra[j] = 0;
389-
else if ((i + bin[point[j]]) <= extra[j])
390-
my_extra[j] = bin[point[j]];
391-
else
392-
my_extra[j] = extra[j] - i;
393-
}
394-
}
395383
for (i = 0; i < max_active_dot; i++)
396384
if (dots[i].number >= 0) {
397385
for (j = 0; j < (fact-1); j++)
398386
if (dots[i].cen[dir] < point[j]) {
399387
dots[i].new_proc = j;
400388
break;
401389
} else if (dots[i].cen[dir] == point[j]) {
402-
if (my_extra[j]) {
390+
if (extra[j] > bin1[j]/2)
403391
dots[i].new_proc = j + 1;
404-
my_extra[j]--;
405-
} else
392+
else
406393
dots[i].new_proc = j;
407394
break;
408395
}

0 commit comments

Comments
 (0)