MPI Datatype Examples (3)
For example, to send 10´10 blocks from the diagonal to five other processors
scdispls[0]=0; scdispls[1]=10*50+10;
scdispls[2]=1020; scdispls[3]=1530;
scdispls[4]=2040;
MPI_Scatterv( R, sendcnts, scdispls, blk2, recvbuf, recvcnt, MPI_REAL, 0, MPI_COMM_WORLD );
Doing a matrix transpose via MPI datatypes left as an exercise for the reader