Using MPI to write parallel programs

Although MPI is a library of 125 routines, we can already write meaningful parallel programs using only a limited number of routines.

To illustrate MPI_Scatter and MPI_Gather, we consider par_sum.c, which sums the first 100 positive natural numbers using 4 processors.

To illustrate MPI_Send and MPI_Recv, we consider square_c, to square p integer numbers using p processors.

Bibliography