Let a n by m matrix (A(n,m) in Fortran) be created on processor 0. For
example, it might be read in from memory, or it might have been computed.
Assume that there are four processors, and processor zero will send a part of
this matrix to the other processors. Processor 1 gets A(i,j) for
i=n/2+1,...,n, and j=1,...,m/2. Processor 2 gets A(i,j) for i=1,...,n/2 and
j=m/2+1,...,m, and processor 3 gets A(i,j) for i=n/2+1,...,n and j=m/2,...,m .
This is just a two-dimensional decomposition of A across four processors.
Use MPI_Scatterv to send the data from process 0 to all other processes
(including process 0). For simplicity, choose n = m = 8.