/********************************************************************** * Derived datatypes in MPI/C * **********************************************************************/ #include #include #include int main(int argc, char *argv[]) { int rank, size,nx,ny,row,col,count,blocklen,stride; double *A; MPI_Status status; MPI_Datatype newtype; MPI_Init(&argc, &argv); /* Initialize MPI */ MPI_Comm_size(MPI_COMM_WORLD, &size); /* Get the number of processors */ MPI_Comm_rank(MPI_COMM_WORLD, &rank); /* Get my number */ nx=100; ny=150; A=(double *)malloc(nx*ny*sizeof(double)); for (row=0; row