Example: Red-black iteration
Procs p = new Procs2(NP, NP) ;
Range x = new BlockRange(N, p.dim(0), 1) ; // ghost width 1
Range y = new BlockRange(N, p.dim(1), 1) ; // …
float [[,]] u = new float [[x, y]] ;
for(int parity = 0 ; parity < 2 ; parity++) { // red and black
Adlib.writeHalo(u, widths) ; // Communicate Ghost Cells
overall(i = x [1 : N - 2])
overall(j = y [1 + (x.idx(i) + parity) % 2 : N - 2 : 2])
u [i, j] = 0.25 * (u [i - 1, j] + u [i + 1, j] +
u [i, j - 1] + u [i, j + 1]) ;