Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: [OMPI users] Question about MPI_Waitany
From: Francisco Jesús Martínez Serrano (franjesus_at_[hidden])
Date: 2008-01-30 13:32:07


Hello Users,

the man page for MPI_Waitany states that

"The array_of_requests list *may contain null* or inactive handles. If
the list contains no active handles (list has length zero or all
entries are null or inactive), then the call returns immediately with
index = MPI_UNDEFINED, and an empty status."

I've been having problems with Open MPI and a code that runs fine with
LAM, I have managed to trace it to a call to MPI_Waitany with some
requests set to null (but properly allocated).

The current trunk code for ompi/mpi/c/waitany.c states:

int MPI_Waitany(int count, MPI_Request *requests, int *index,
MPI_Status *status)
{

    OPAL_CR_TEST_CHECKPOINT_READY();

    if ( MPI_PARAM_CHECK ) {
        int i, rc = MPI_SUCCESS;
        OMPI_ERR_INIT_FINALIZE(FUNC_NAME);
        if ((NULL == requests) && (0 != count)) {
            rc = MPI_ERR_REQUEST;
        } else {
            for (i = 0; i < count; i++) {
                if (NULL == requests[i]) {
                    rc = MPI_ERR_REQUEST;
                    break;
                }
            }
        }
        if ((NULL == index) || (0 > count)) {
            rc = MPI_ERR_ARG;
        }
        OMPI_ERRHANDLER_CHECK(rc, MPI_COMM_WORLD, rc, FUNC_NAME);
    }
(...)

>From what I understand in this code, if any of the requests is NULL
then an MPI_ERR_REQUEST error will be issued.

Is this a limitation of Open MPI (i.e. further processing of this
query will result in an error if a request is null), or a simple bug?
Of course, I could be mistaken... :-)

Cheers!