Dot Product Example
Assume that n is divisible by P
Assume that the data is block distributed (i.e. process 0 had the first n/p components of x and y, processor 1 the next n/p, etc.)
float local_x[] /* in */,
float local_y[] /* in */,
float Serial_dot(float x[], float y[], int m);
local_dot = Serial_dot(local_x, local_y, n_bar);
MPI_Reduce(&local_dot, &dot, 1, MPI_FLOAT,
MPI_SUM, 0, MPI_COMM_WORLD);