41 int is[ndims], ie[ndims], index[ndims], bounds[ndims], size;
43 for (d=0; d<ndims; d++) {
45 ie[d] = limits[2*d+1];
46 size *= (ie[d] - is[d]);
50 if (source_rank == dest_rank) {
61 fprintf(stderr,
"Error in MPIGetArrayDatanD(): This is a serial run. Source and ");
62 fprintf(stderr,
"destination ranks must be equal. Instead they are %d and %d.\n",
63 source_rank,dest_rank);
66 if (mpi->
rank == source_rank) {
67 double *buf = (
double*) calloc (size*nvars,
sizeof(
double));
75 MPI_Send(buf,size*nvars,MPI_DOUBLE,dest_rank,2211,mpi->
world);
77 }
else if (mpi->
rank == dest_rank) {
79 MPI_Recv(xbuf,size*nvars,MPI_DOUBLE,source_rank,2211,mpi->
world,&status);
81 fprintf(stderr,
"Error in MPIGetArrayData3D(): Process %d shouldn't have entered this function.\n",
int MPIRank1D(int, int *, int *)
#define _ArraySetValue_(x, size, value)
#define _ArrayIncrementIndex_(N, imax, i, done)
MPI related function definitions.
#define _ArraySubtract1D_(x, a, b, size)
#define _ArrayIndex1D_(N, imax, i, ghost, index)
#define _ArrayIndex1DWO_(N, imax, i, offset, ghost, index)
#define _ArrayCopy1D_(x, y, size)
Some basic definitions and macros.
Contains macros and function definitions for common array operations.
int MPIGetArrayDatanD(double *, double *, int *, int *, int *, int *, int, int, int, void *)
Structure of MPI-related variables.