On 03/13/12 13:25, Jeffrey Squyres wrote:
> On Mar 9, 2012, at 5:17 PM, Jeremiah Willcock wrote:
>> On Open MPI 1.5.1, when I call MPI_Testsome with incount=0 and the two output arrays NULL, I get an argument error (MPI_ERR_ARG). Is this the intended behavior? If incount=0, no requests can complete, so the output arrays can never be written to. I do not see anything in the MPI 2.2 standard that says either way whether this is allowed.
> I have no strong opinions here, so I coded up a patch to just return MPI_SUCCESS in this scenario (attached).
> If no one objects, we can probably get this in 1.6.
It isn't enough just to return MPI_SUCCESS when the count is zero. The
man pages indicate what behavior is expected when count==0 and the MTT
tests (ibm/pt2pt/[test|wait][any|some|all].c) check for this behavior.
Put another way, a bunch of MTT tests started failing since r26138 due
to quick return on count=0.
Again, the trunk since r26138 sets no output values when count=0. In
contrast, the ibm/pt2pt/*.c tests correctly check for the count=0
behavior that we document in our man pages. Here are excerpts from our
Returns flag = true if all communications associated
with active handles in the array have completed (this
includes the case where no handle in the list is active).
MPI_Testany tests for completion of either one or none
of the operations associated with active handles. In
the latter case (no operation completed), it returns
flag = false, returns a value of MPI_UNDEFINED in index,
and status is undefined.
The array may contain null or inactive handles. If the
array contains no active handles then the call returns
immediately with flag = true, index = MPI_UNDEFINED,
and an empty status.
If there is no active handle in the list, it returns
outcount = MPI_UNDEFINED.
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.
If the list contains no active handles, then the call
returns immediately with outcount = MPI_UNDEFINED.
I'll test and put back the attached patch.