37 int ndim, gp, nleft, nright, tag1, tag2;
50 printf(
"AL_Decompose: wrong SZ pointer\n");
60 for(nd=0;nd<ndim;nd++){
65 nright = s->
right[nd];
71 MPI_Sendrecv(&buf[sendb], 1, itype, nleft, tag1,
72 &buf[recvb], 1, itype, nright,tag1,
76 nright = s->
right[nd];
83 MPI_Sendrecv(&buf[sendb], 1, itype, nright, tag2,
84 &buf[recvb], 1, itype, nleft,tag2,
91 if(myrank==0) printf(
"AL_Exchange: filled ghost regions\n");
114 int ndim, gp, nleft, nright, tag1, tag2;
120 int is_beg[3], is_end[3];
128 printf(
"AL_Decompose: wrong SZ pointer\n");
131 s = sz_stack[sz_ptr];
140 for(nd=0;nd<ndim;nd++){
147 nright = s->
right[nd];
149 if (is_beg[nd] && periods[nd] == 0) nleft = MPI_PROC_NULL;
150 if (is_end[nd] && periods[nd] == 0) nright = MPI_PROC_NULL;
158 MPI_Sendrecv(&buf[sendb], 1, itype, nleft, tag1,
159 &buf[recvb], 1, itype, nright,tag1,
163 nright = s->
right[nd];
165 if (is_beg[nd] && periods[nd] == 0) nleft = MPI_PROC_NULL;
166 if (is_end[nd] && periods[nd] == 0) nright = MPI_PROC_NULL;
174 MPI_Sendrecv(&buf[sendb], 1, itype, nright, tag2,
175 &buf[recvb], 1, itype, nleft,tag2,
182 printf(
"AL_Exchange: filled ghost regions\n");
int AL_Is_boundary(int sz_ptr, int *is_gbeg, int *is_gend)
int AL_Exchange_periods(void *vbuf, int *periods, int sz_ptr)
SZ * sz_stack[AL_MAX_ARRAYS]
MPI_Datatype type_rl[AL_MAX_DIM]
int AL_Exchange(void *vbuf, int sz_ptr)
int stack_ptr[AL_MAX_ARRAYS]
Internal include file for the ArrayLib.
MPI_Datatype type_lr[AL_MAX_DIM]