/** Compile and link with: /opt/mpich_mx/bin/mpicc -static -o transp transp.c */ #include #include "mpi.h" int n=4, nb=4, lda=16; int main(int argc, char *argv[]) { float A[lda][n],AB[nb][nb],aa; /* The matrix is stored in a column vector of blocks : A'=(A0,A1,A2,A3) */ int i,j,ib,count=n*n,rank,size,tag; MPI_Status status; int ip[4]={0,2,1,3}; /** Initialize MPI */ ... ... /** Test the number of processors; print a message and exit if there are not enough */ ... ... /* Processor 0 put the matrix into the array A */ if (rank==0) { for (ib=0; ib