Calculate rightmost point through collective reduction.

NOTE: Relevant changes still containg debug printing statements.
Refactor last commit.

* Put reduction op initialization in the corresponding code section
* Extract function for the collective reduction operation