Fwd'ing to devel list as a bug report...
Thanks.
--------------------------------
Jacob M. Katz | jacob.k...@intel.com<mailto:jacob.k...@intel.com> | Work: 
+972-4-865-5726 | iNet: (8)-465-5726

From: users-boun...@open-mpi.org [mailto:users-boun...@open-mpi.org] On Behalf 
Of Katz, Jacob
Sent: Sunday, May 10, 2009 12:52
To: Open MPI Users
Subject: [OMPI users] Bug in return status of MPI_WAIT()?

Hi,
While trying error-related functionality of OMPI, I came across a situation 
where when I use MPI_ERRORS_RETURN error handler, the errors do not come out 
correctly from WAIT calls.
The program below correctly terminates with a fatal "message truncated" error, 
but when the line setting the error handler to MPI_ERRORS_RETURN is 
uncommented, it silently completes. I expected the print out that checks the 
status after WAIT call to be executed, but it wasn't.
The issue didn't happen when using blocking recv.

A bug or my incorrect usage?

Thanks!

// mpic++ -o test test.cpp
// mpirun -np2 ./test
#include "mpi.h"
#include <iostream>
using namespace std;

int main (int argc, char *argv[])
{
    int rank;
    char buf[100] = "hmmmm";
    MPI::Status stat;

    MPI::Init(argc, argv);
    rank = MPI::COMM_WORLD.Get_rank();

//    MPI::COMM_WORLD.Set_errhandler(MPI::ERRORS_RETURN);

    if (rank == 0)
    {
        MPI::Request r = MPI::COMM_WORLD.Irecv(buf, 1, MPI_CHAR, 
MPI::ANY_SOURCE, MPI::ANY_TAG);
        r.Wait(stat);
        if (stat.Get_error() != MPI::SUCCESS)
        {
            cout << "0: Error during recv" << endl;
        }
    }
    else
    {
        MPI::COMM_WORLD.Send(buf, 2, MPI_CHAR, 0, 0);
    }

    MPI::Finalize();
    return (0);
}

--------------------------------
Jacob M. Katz | jacob.k...@intel.com<mailto:jacob.k...@intel.com> | Work: 
+972-4-865-5726 | iNet: (8)-465-5726

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

Reply via email to