Move wait for send down in partition_for_coarsen.
Expose partition_for_coarsening to API
partition_for_coarsening: fix bad conditional.

We only want to read the array when we haven't gone past the end, the
other half of the conditionall wasn't necessary, and caused segfaults in
some situations.