Re: clarification requested
Steve Huss-Lederman (lederman@cs.wisc.edu)
Mon, 14 Apr 1997 14:43:22 -0500 (CDT)
> For the query_fn for generalized requests, the spec states that the
> status provided to this function is the one provided to MPI in the
> call to MPI_{WAIT|TEST}{...} or MPI_GET_STATUS. Should the latter
> be MPI_GET_ELEMENTS? While I can clearly see the role that the
> query_fn plays for harvesting the status of a GR via MPI_WAIT or
> MPI_TEST, I am perplexed as to how the query_fn should be used after this
> status is harvested. That is, I think of the query_fn being associated
> with the request object and not a status object. Can someone explain
> the motivation for this?
>
> Also, I am wondering about the statement that the query_fn can be called
> several times for the same request; if the request in nonpersistent, isn't
> the request freed after MPI_WAIT or a successful MPI_TEST, implying that
> the query_fn could be called only once?
First, the name is a mistake. It should be MPI_REQUEST_GET_STATUS.
However, I think the concept is correct. You can use this function to
get the status while also seeing if it is done. If it is, you get the
status, if not, you don't. You can call this function several times
and must call wait/test later to complete the request. This is why
you can have query_fn called several times. Each time one of these is
called, MPI may need to fill in the status given. We do not assume
(or require) MPI to remember the fields filled in from a previous call.
MPI_GET_ELEMENTS, on the other hand, gets information from the
status. Once the status is returned, the query_fn is done with this
copy of status. Thus, I don't think the function names are backward.
Steve