mpiwg-rma / rma-issues

Repository to discuss internal RMA working group issues
1 stars 0 forks source link

Wording of accumulate ordering for source == target #11

Closed devreal closed 2 years ago

devreal commented 5 years ago

While working on #10, I noticed that Section 11.7.2 states:

Accumulate calls enable element-wise atomic read and write to remote memory locations. MPI specifies ordering between accumulate operations from one process to the same (or overlapping) memory locations at another process on a per-datatype granularity. (highlights mine)

In my understanding (and according to Merriam Webster) another means different or distinct from the one first considered [1]. It also restricts atomic operations to remote memory locations, which in my understanding excludes the local part of the window. Is the exclusion of ordering for cases in which the source and target are the same process intentional? Is my reading overly pedantic? Is it something worth fixing?

[1] https://www.merriam-webster.com/dictionary/another

jdinan commented 5 years ago

It would be good to replace "one process" with "an origin process" and "another process" with "a target process".

devreal commented 5 years ago

Another nit to pick in 11.7.2:

The default ordering is strict ordering, which guarantees that overlapping updates from the same source to a remote location are committed in program order and that reads (e.g., with MPI_GET_ACCUMULATE) and writes (e.g., with MPI_ACCUMULATE) are executed and committed in program order.

That wording is a bit convoluted as the first half repeats the same-origin-same-target-overlapping-memory constraint from the previous sentence but the second part doesn't, which may give the impression that the constraint doesn't apply there. Also, MPI_GET_ACCUMULATE entails both a read and a write (reading is done before writing, unless used in combination with MPI_NO_OP for which no update occurs) so in the general case the order between MPI_GET_ACCUMULATE and MPI_ACCUMULATE follows from the first part of the sentence (overlapping updates). I propose to change the sentence to:

The default ordering is strict ordering, which guarantees that overlapping reads (e.g., with MPI_NO_OP) and writes (e.g., with MPI_ACCUMULATE) are executed and committed in program order.

There are two more occurrences of the same-origin-same-target constraint. In the first paragraph:

Ordering only applies to operations originating at the same origin that access overlapping target memory regions.

And again later on, this time without mentioning overlapping memory locations:

These ordering requirements apply only to operations issued by the same origin process and targeting the same target process.

In total, that's four places in the text where the constraints are laid out, in varying combinations of same-origin-same-target and same-target-overlapping-memory. Since the constraints are clearly outlined in the first paragraph it is not necessary to repeat them. I propose to simplify the text by dropping all but the first mentioning in the first paragraph.

devreal commented 2 years ago

Fixed in https://github.com/mpi-forum/mpi-issues/issues/144