Broken parallel helpers (again)
The current implementation does not work for grids that cannot communicate since the functions are actually called regardless of whether the grid can communicate or not trusting that the function will handle it.
There at least two ways to solve this. Example
- check if num processors is more than 1 otherwise return, if grid cannot communicate but num processors is greater 1 throw
- do none of the checks inside the function but outside
I'm tending to the latter because otherwise
makeNonOverlappingConsistent is doing more than one thing (SRP).
If you call the function and read the name you expect it to do something. So you should just call it if your grid can communicate and if the number of processors is more than 1. But it also means more code at the call site but also more transparent.