Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |  

This web mail archive is frozen.

This page is part of a frozen web archive of this mailing list.

You can still navigate around this archive, but know that no new mails have been added to it since July of 2016.

Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.

Subject: [OMPI users] Bug in return status of MPI_WAIT()?
From: Katz, Jacob (jacob.katz_at_[hidden])
Date: 2009-05-10 05:51:31


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.katz_at_[hidden]<mailto:jacob.katz_at_[hidden]> | 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.