/* * (C) 2001 by Argonne National Laboratory. * See COPYRIGHT in top-level directory. */ #include "mpi.h" #include #include /* Prototypes for picky compilers */ void SetData ( double *, double *, int, int, int, int, int, int ); int CheckData ( double *, int, int, int, int, int ); /* This is an example of using scatterv to send a matrix from one process to all others, with the matrix stored in Fortran order. Note the use of an explicit UB to enable the sources to overlap. This tests scatterv to make sure that it uses the datatype size and extent correctly. It requires number of processors that can be split with MPI_Dims_create. */ void SetData( double *sendbuf, double *recvbuf, int nx, int ny, int myrow, int mycol, int nrow, int ncol ) { int coldim, i, j, m, k; double *p; if (myrow == 0 && mycol == 0) { coldim = nx * nrow; for (j=0; j