You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following demonstrates a bug in using mpi derived types in the receive buffer, this is showing up when running (cesm) cam-se using mpi-serial. @gold2718 reported to pio, but it's an mpi-serial bug. Run using mpi on a single processor the result is:
-1 0 -1 1 -1 2 -1 3
however with mpi-serial the derived type is not respected and you get
0 1 2 3 -1 -1 -1 -1
#include <stdio.h>
#include <mpi.h>
int main(int argc, char **argv)
{
int mpierr;
int blocksize=1;
int len=4;
int displace[len];
MPI_Datatype mtype;
int sbuf[8];
int rbuf[8];
int i;
MPI_Request rcvid;
MPI_Status status;
mpierr = MPI_Init(&argc, &argv);
for (i=0;i<8;i++){
sbuf[i] = i;
}
for (i=0;i<8;i++){
rbuf[i] = -1;
}
for (i=0;i<len;i++)
displace[i]=1+i*2;
mpierr = MPI_Type_create_indexed_block(len, blocksize, displace,
MPI_INT, &mtype);
mpierr = MPI_Type_commit(&mtype);
mpierr = MPI_Irecv(rbuf, 1, mtype,
0, 1, MPI_COMM_WORLD, &rcvid);
mpierr = MPI_Send(sbuf, 4, MPI_INT,
0, 1, MPI_COMM_WORLD);
mpierr = MPI_Wait(&rcvid, &status);
for (i=0;i<8;i++)
printf(" %d",rbuf[i]);
printf("\n");
mpierr = MPI_Finalize();
}
The text was updated successfully, but these errors were encountered:
I added tests (one C, one Fortran) to my fork which demonstrate this failure with make tests. If someone can help with the irecv bug, I can submit a PR with those tests.
The following demonstrates a bug in using mpi derived types in the receive buffer, this is showing up when running (cesm) cam-se using mpi-serial. @gold2718 reported to pio, but it's an mpi-serial bug. Run using mpi on a single processor the result is:
-1 0 -1 1 -1 2 -1 3
however with mpi-serial the derived type is not respected and you get
0 1 2 3 -1 -1 -1 -1
The text was updated successfully, but these errors were encountered: