- edited description
Programmer Guide Sample Code Fix
Issue #213
resolved
This is a very small detail. On page 9 of the Programmer's Guide, the code for a red-black solver
for (long stepi = 0; stepi < MAX_ITER; stepi++) {
// alternate between red and black
int start = stepi % 2;
// get the values for the ghost cells
if (!start) u[0] = upcxx::rget(uL + block).wait();
else u[n_local - 1] = upcxx::rget(uR + 1).wait();
// some more stuff
Doesn't fill in the ghost cell of both ends in each iteration. If block
is even this would be fine, but if block
is odd this results in not updating the value of a ghost cell that is used for computation.
It's not a big deal, but it's kind of confusing to a new reader.
Comments (3)
-
reporter -
Hi @alexding123 - thanks for the note.
I agree this code is assuming
block
is even and that should be stated.Proposed fix in pull request #85
-
- changed status to resolved
- Log in to comment