[Mvapich-discuss] MPI_ANY_SOURCE not receiving message on MVAPICH 3.0

Shineman, Nat shineman.5 at osu.edu
Thu Oct 3 10:31:50 EDT 2024


Hi Everett,

Are you able to try this test case with MVAPICH-Plus 4.0, the Beta version is available on our website as RPMs for various systems. This issue should be resolved in the latest version.

Thanks,
Nat
________________________________
From: Mvapich-discuss <mvapich-discuss-bounces at lists.osu.edu> on behalf of Schnetzer, Everett - 1002 - MITLL via Mvapich-discuss <mvapich-discuss at lists.osu.edu>
Sent: Wednesday, October 2, 2024 16:41
To: mvapich-discuss at lists.osu.edu <mvapich-discuss at lists.osu.edu>
Subject: [Mvapich-discuss] MPI_ANY_SOURCE not receiving message on MVAPICH 3.0


Hello,



We had an application break when moving up to v3.0, and the error was a failure to receive a message when the receiver sets the source to MPI_ANY_SOURCE. Below is code for a simple test case, which is run as a single process. On MVAPICH2 v2.3.7, the code completes normally, and on v3.0 the receiver thread never receives the second message and the main program hangs on the join. Our build is on Red Hat Enterprise Linux 9.4, using gcc-13.2.0.



Sincerely,

Everett Schnetzer

MIT Lincoln Laboratory



Test code:



#include <iostream>

#include <stdlib.h>

#include <mpi.h>

#include <assert.h>

#include <thread>

#include <unistd.h>



void receiverTest()

{

    std::cout << "thread calling receive from rank 0" << std::endl;

    MPI_Status status;

    uint64_t parameters[2];

    int retval = MPI_Recv(parameters, 2, MPI_UINT64_T, 0, 0, MPI_COMM_WORLD, &status);

    assert(retval == MPI_SUCCESS);



    std::cout << "thread calling receive from any rank" << std::endl;

    retval = MPI_Recv(parameters, 2, MPI_UINT64_T, MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &status);

    assert(retval == MPI_SUCCESS);



    std::cout << "receive done" << std::endl;

}



int main(int argc, char** argv)

{

    int provided;

    MPI_Init_thread(nullptr, nullptr, MPI_THREAD_MULTIPLE, &provided);

    assert(provided == MPI_THREAD_MULTIPLE);



    std::thread rcvThread = std::thread(&receiverTest);



    sleep(1);



    std::cout << "first send to thread" << std::endl;

    uint64_t parameters[2];

    int retval = MPI_Send(parameters, 2, MPI_UINT64_T, 0, 0, MPI_COMM_WORLD);

    assert(retval == MPI_SUCCESS);



    sleep(1);



    std::cout << "second send to thread" << std::endl;

    retval = MPI_Send(parameters, 2, MPI_UINT64_T, 0, 0, MPI_COMM_WORLD);

    assert(retval == MPI_SUCCESS);



    assert(rcvThread.joinable());

    rcvThread.join();



    MPI_Finalize();



    return 0;

}


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osu.edu/pipermail/mvapich-discuss/attachments/20241003/842dca1b/attachment-0002.html>


More information about the Mvapich-discuss mailing list