Going back to the old semantics where the free_fn is called at the
call to MPI_REQUEST_FREE does not solve this problem.
Rolf's suggestion was to distinguish between "using" the handle and
"providing" the handle. That is you can still look at the info that
the pointer in the handle used to point to. I also thought of this
but do not like it. One major reason for having the weak freeing
rules is to avoid stale copies. If the user creates a copy of the
request pointer behind the back of MPI then when the request is
completed you have a bad reference in the copy.
Dick's suggestion was say once you call MPI_REQUEST_FREE on a GR
then you are in an undefined state. That has the negative property
that we have broken the symmetry between GR and other requests. What
we are basically saying is that you should never all MPI_REQUEST_FREE
on a GR because then you can't be sure it completes. (Except in the
strange case that you check with MPI_GET_STATUS and then do the
Another thought I had is to put the request argument back in the
callbacks. If the user calls MPI_REQUEST_FREE then MPI keeps its
internal copy around and provides a pointer to it in each callback.
This precludes calling MPI_GREQUEST_COMPLETE outside the callback
which is something we wanted to allow.
I am hoping some has a cleaver insight to get around this.