mpiwg-rma / rma-issues

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

Clarify alignment requirements #3

Open jdinan opened 7 years ago

jdinan commented 7 years ago

Alignment requirements on window buffers and RMA operations are not currently clear.

My current understanding is that window buffers have no alignment requirement, but that the effective target address (base + offset*disp_unit) for RMA operations must be naturally aligned for the datatype used in the operation.

I can't seem to locate text for this semantic. This issue is a placeholder to track down the semantic and add a clarification somewhere in the RMA chapter.

devreal commented 2 years ago

From the discussion at the WG meeting 03/01/2022:

devreal commented 2 years ago

I was sure I had seen language requiring a mapping between specified datatypes and objects in the buffer but couldn't find the place in the standard during the discussion at the meeting today.

Here it is: Section 3.3.1 says

One can think of message transfer as consisting of the following three phases.

  1. Data is pulled out of the send buffer and a message is assembled.
  2. A message is transferred from sender to receiver.
  3. Data is pulled from the incoming message and disassembled into the receive buffer.

Type matching has to be observed at each of these three phases: The type of each variable in the sender buffer has to match the type specified for that entry by the send operation; the type specified by the send operation has to match the type specified by the receive operation; and the type of each variable in the receive buffer has to match the type specified for that entry by the receive operation. A program that fails to observe these three rules is erroneous.

and then

The type of a variable in a host program matches the type specified in the communication operation if the datatype name used by that operation corresponds to the basic type of the host program variable.

That mapping is then specified in tables 3.1 and 3.2. Section 5.1.11 then extends this to general datatypes.

Long story short: the P2P chapter specifies that the specified type has to match the types of the objects in the input and output buffers. We will need to extend that to RMA and require that the type of each variable in the origin and target window buffer of an RMA operation has to match the type specified for that operation. It seems natural that the rules governing datatype usage in P2P and collectives also apply to RMA, it just hasn't been specified (as far as I can see).