openshmem-org / specification

OpenSHMEM Application Programming Interface
http://www.openshmem.org
49 stars 32 forks source link

Contradicting test_all semantics #442

Closed naveen-rn closed 3 years ago

naveen-rn commented 4 years ago

In the API description of shmem_test_all, we have the following statement:

If all elements in status are nonzero or nelems is 0, the test set is empty and this routine returns 0.

And in the return values - we have the following:

shmem_test_all returns 1 if all variables in ivars satisfy the test condition or if nelems is 0, otherwise this routine returns 0.

So, when the nelems is 0 - should we return 0 or 1?

davidozog commented 4 years ago

The API description also says:

If nelems is 0, the test set is empty and this routine returns 1.

So I think the intent was to return 1 when nelems is 0, and the text in the status array description should read:

If all elements in status are nonzero or nelems is 0, the test set is empty and this routine returns 1.

Also note that shmem_test_all_vector has the same issue. Sorry about that, and good catch.

jdinan commented 4 years ago

We have been getting by without an errata document, but it might be helpful since issues like one this can't wait until the next release to be clarified. What do you think?

naveen-rn commented 4 years ago

+1

jdinan commented 3 years ago

I started an errata page on the wiki: https://github.com/openshmem-org/specification/wiki/OpenSHMEM-1.5-Errata