To help narrow down the problem, can you try your code with some other MPI implementation on any system? If it works, can you send us a small test program that reproduces the problem?

 

Rajeev

 

 

From: "Mccall, Kurt E. (MSFC-EV41) via discuss" <discuss@mpich.org>
Reply-To: "discuss@mpich.org" <discuss@mpich.org>
Date: Wednesday, June 14, 2023 at 4:13 PM
To: "discuss@mpich.org" <discuss@mpich.org>
Cc: "Mccall, Kurt E. (MSFC-EV41)" <kurt.e.mccall@nasa.gov>
Subject: [mpich-discuss] Duplicate reception of messages

 

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