- Instead of manually transfering and summing up the sub-sums of the slaves, use MPI_Reduce.
- Since "sum" needs to be a global variable for this, rename the local "sum" variable of the sequential reference implementation to "s".
Use MPI_Scatter and MPI_Reduce instead of manually distributing / collecting the data:
- This turned out to be almost a full rewrite. Sorry. But it is the proper solution for this particular problem
Fix misnaming: "max_rank" is actually the node count
Move global variables to main to make this tutorial even more compact and easier to read.