My code seems to be receiving particular messages more than once -- I can tell from the unique variables they contain.
I have verified that each unique variable is being sent exactly once. The sender simply calls MPI_ISend to send a single
message containing an array of variables.
The receiver pseudo-code is as follows. Have I made a mistake in my use of MPI_Iprobe?
MPI_Status status;
int flag;
// loop in case there was more than one message queued up due to asynchrony between
// sender and receiver. Most of the time, there is only one message.
do {
flag = false;
MPI_Iprobe (sender_rank, tag, intercom, &flag, &status);
if (flag)
{
int len;
MPI_Get_count (&status, data_type, &len);
MPI_Recv (buffer, len, data_type, sender_rank, tag, intercom, MPI_STATUS_IGNORE);
// at this point, sometimes I see duplicate variable values in the buffer, in different
// calls to MPI_Recv. That is, s supposedly unique variable appears in two different
// message.
}
} while(flag);
Thanks for your help. Here is my build information:
MPICH Version: 4.0.1
MPICH Release date: Tue Feb 22 16:37:51 CST 2022
MPICH Device: ch3:nemesis
MPICH configure: --prefix=/opt/mpich --with-device=ch3:nemesis --with-slurm --disable-fortran -enable-debuginfo --enable-g=debug
MPICH CC: gcc -g -O2
MPICH CXX: g++ -g -O2
MPICH F77: -g
MPICH FC: -g