Further cleanup. v3 not working.
This commit is contained in:
parent
f639b787be
commit
3e020396c5
@ -252,15 +252,18 @@ void commPartition(Comm* c, int jmax, int imax)
|
|||||||
MPI_Cart_shift(c->comm, JDIM, 1, &c->neighbours[BOTTOM], &c->neighbours[TOP]);
|
MPI_Cart_shift(c->comm, JDIM, 1, &c->neighbours[BOTTOM], &c->neighbours[TOP]);
|
||||||
MPI_Cart_get(c->comm, NDIMS, c->dims, periods, c->coords);
|
MPI_Cart_get(c->comm, NDIMS, c->dims, periods, c->coords);
|
||||||
|
|
||||||
c->imaxLocal = sizeOfRank(c->rank, dims[IDIM], imax);
|
int imaxLocal = sizeOfRank(c->rank, dims[IDIM], imax);
|
||||||
c->jmaxLocal = sizeOfRank(c->rank, dims[JDIM], jmax);
|
int jmaxLocal = sizeOfRank(c->rank, dims[JDIM], jmax);
|
||||||
|
|
||||||
|
c->imaxLocal = imaxLocal;
|
||||||
|
c->jmaxLocal = jmaxLocal;
|
||||||
|
|
||||||
MPI_Datatype jBufferType;
|
MPI_Datatype jBufferType;
|
||||||
MPI_Type_contiguous(c->imaxLocal, MPI_DOUBLE, &jBufferType);
|
MPI_Type_contiguous(imaxLocal, MPI_DOUBLE, &jBufferType);
|
||||||
MPI_Type_commit(&jBufferType);
|
MPI_Type_commit(&jBufferType);
|
||||||
|
|
||||||
MPI_Datatype iBufferType;
|
MPI_Datatype iBufferType;
|
||||||
MPI_Type_vector(c->jmaxLocal, 1, c->imaxLocal + 2, MPI_DOUBLE, &iBufferType);
|
MPI_Type_vector(jmaxLocal, 1, imaxLocal + 2, MPI_DOUBLE, &iBufferType);
|
||||||
MPI_Type_commit(&iBufferType);
|
MPI_Type_commit(&iBufferType);
|
||||||
|
|
||||||
c->bufferTypes[LEFT] = iBufferType;
|
c->bufferTypes[LEFT] = iBufferType;
|
||||||
@ -268,14 +271,15 @@ void commPartition(Comm* c, int jmax, int imax)
|
|||||||
c->bufferTypes[BOTTOM] = jBufferType;
|
c->bufferTypes[BOTTOM] = jBufferType;
|
||||||
c->bufferTypes[TOP] = jBufferType;
|
c->bufferTypes[TOP] = jBufferType;
|
||||||
|
|
||||||
c->rdispls[LEFT] = (c->imaxLocal + 2);
|
c->sdispls[LEFT] = (imaxLocal + 2) + 1;
|
||||||
c->rdispls[RIGHT] = (c->imaxLocal + 2) + (c->imaxLocal + 1);
|
c->sdispls[RIGHT] = (imaxLocal + 2) + imaxLocal;
|
||||||
|
c->sdispls[BOTTOM] = (imaxLocal + 2) + 1;
|
||||||
|
c->sdispls[TOP] = jmaxLocal * (imaxLocal + 2) + 1;
|
||||||
|
|
||||||
|
c->rdispls[LEFT] = (imaxLocal + 2);
|
||||||
|
c->rdispls[RIGHT] = (imaxLocal + 2) + (imaxLocal + 1);
|
||||||
c->rdispls[BOTTOM] = 1;
|
c->rdispls[BOTTOM] = 1;
|
||||||
c->rdispls[TOP] = (c->jmaxLocal + 1) * (c->imaxLocal + 2) + 1;
|
c->rdispls[TOP] = (jmaxLocal + 1) * (imaxLocal + 2) + 1;
|
||||||
c->sdispls[LEFT] = (c->imaxLocal + 2) + 1;
|
|
||||||
c->sdispls[RIGHT] = (c->imaxLocal + 2) + (c->imaxLocal);
|
|
||||||
c->sdispls[BOTTOM] = (c->imaxLocal + 2) + 1;
|
|
||||||
c->sdispls[TOP] = (c->jmaxLocal) * (c->imaxLocal + 2) + 1;
|
|
||||||
#else
|
#else
|
||||||
c->imaxLocal = imax;
|
c->imaxLocal = imax;
|
||||||
c->jmaxLocal = jmax;
|
c->jmaxLocal = jmax;
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
* Use of this source code is governed by a MIT style
|
* Use of this source code is governed by a MIT style
|
||||||
* license that can be found in the LICENSE file.
|
* license that can be found in the LICENSE file.
|
||||||
*/
|
*/
|
||||||
#include <stddef.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
@ -234,27 +233,26 @@ void commPartition(Comm* c, int jmax, int imax)
|
|||||||
MPI_Cart_shift(c->comm, JDIM, 1, &c->neighbours[BOTTOM], &c->neighbours[TOP]);
|
MPI_Cart_shift(c->comm, JDIM, 1, &c->neighbours[BOTTOM], &c->neighbours[TOP]);
|
||||||
MPI_Cart_get(c->comm, NDIMS, c->dims, periods, c->coords);
|
MPI_Cart_get(c->comm, NDIMS, c->dims, periods, c->coords);
|
||||||
|
|
||||||
c->imaxLocal = sizeOfRank(c->rank, dims[IDIM], imax);
|
int imaxLocal = sizeOfRank(c->rank, dims[IDIM], imax);
|
||||||
c->jmaxLocal = sizeOfRank(c->rank, dims[JDIM], jmax);
|
int jmaxLocal = sizeOfRank(c->rank, dims[JDIM], jmax);
|
||||||
|
|
||||||
|
c->imaxLocal = imaxLocal;
|
||||||
|
c->jmaxLocal = jmaxLocal;
|
||||||
|
|
||||||
MPI_Datatype jBufferType;
|
MPI_Datatype jBufferType;
|
||||||
MPI_Type_contiguous(c->imaxLocal, MPI_DOUBLE, &jBufferType);
|
MPI_Type_contiguous(imaxLocal, MPI_DOUBLE, &jBufferType);
|
||||||
MPI_Type_commit(&jBufferType);
|
MPI_Type_commit(&jBufferType);
|
||||||
|
|
||||||
MPI_Datatype iBufferType;
|
MPI_Datatype iBufferType;
|
||||||
MPI_Type_vector(c->jmaxLocal, 1, c->imaxLocal + 2, MPI_DOUBLE, &iBufferType);
|
MPI_Type_vector(jmaxLocal, 1, imaxLocal + 2, MPI_DOUBLE, &iBufferType);
|
||||||
MPI_Type_commit(&iBufferType);
|
MPI_Type_commit(&iBufferType);
|
||||||
|
|
||||||
// in the order of the dimensions i->0, j->1
|
|
||||||
// first negative direction, then positive direction
|
|
||||||
size_t dblsize = sizeof(double);
|
|
||||||
int imaxLocal = c->imaxLocal;
|
|
||||||
int jmaxLocal = c->jmaxLocal;
|
|
||||||
c->bufferTypes[LEFT] = iBufferType;
|
c->bufferTypes[LEFT] = iBufferType;
|
||||||
c->bufferTypes[RIGHT] = iBufferType;
|
c->bufferTypes[RIGHT] = iBufferType;
|
||||||
c->bufferTypes[BOTTOM] = jBufferType;
|
c->bufferTypes[BOTTOM] = jBufferType;
|
||||||
c->bufferTypes[TOP] = jBufferType;
|
c->bufferTypes[TOP] = jBufferType;
|
||||||
|
|
||||||
|
size_t dblsize = sizeof(double);
|
||||||
c->sdispls[LEFT] = ((imaxLocal + 2) + 1) * dblsize; // send left
|
c->sdispls[LEFT] = ((imaxLocal + 2) + 1) * dblsize; // send left
|
||||||
c->sdispls[RIGHT] = ((imaxLocal + 2) + imaxLocal) * dblsize; // send right
|
c->sdispls[RIGHT] = ((imaxLocal + 2) + imaxLocal) * dblsize; // send right
|
||||||
c->sdispls[BOTTOM] = ((imaxLocal + 2) + 1) * dblsize; // send bottom
|
c->sdispls[BOTTOM] = ((imaxLocal + 2) + 1) * dblsize; // send bottom
|
||||||
|
Loading…
Reference in New Issue
Block a user