Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: [OMPI devel] MPI_Grequest_start and MPI_Wait clarification
From: Christopher Yeoh (cyeoh_at_[hidden])
Date: 2009-10-25 21:10:11


I've been running some threaded test suites against OpenMPI and was
just wanting to clarify something in the specification and how OpenMPI
implements it.

One page 360 of the 2.1 spec there is (in reference to
mpi_grequest_start query function):

     Advice to users. query_fn must not set the error field of status
     since query_fn may be called by MPI_WAIT or MPI_TEST, in which
     case the error field of status should not change. The MPI library
     knows the “context” in which query_fn is invoked and can decide
     correctly when to put in the error field of status the returned
     error code. (End of advice to users.)

So presumably this means that you just return an error code in the
return value of query function. But in ompi/request/req_wait.c there is

   /* return status. If it's a generalized request, we *have* to
      invoke the query_fn, even if the user procided STATUS_IGNORE.
      MPI-2:8.2. */
    if (OMPI_REQUEST_GEN == req->req_type) {
        ompi_grequest_invoke_query(req, &req->req_status);

which ignores the value returned by the quesry function. And it just
uses the MPI_ERROR value in the status object instead.

So is this just incorrect on the part of OpenMPI? Am happy to provide a
patch if its not right.