[Mpi3-rma] Target displacement sign issue
dinan at mcs.anl.gov
Tue Aug 28 10:00:07 CDT 2012
Sorry, this wasn't too clear. A more detailed explanation of the
Passing a dynamic window displacement to an RMA operation currently
requires the user to put an address (which is an unsigned quantity) into
an MPI_Aint (which is signed). With the current spec, passing a
negative displacement to an RMA operation is an error. When interpreted
as signed integers, dynamic window displacements (i.e. addresses) can be
negative because the unsigned to signed conversion effectively overflows.
On 8/28/12 9:49 AM, Jeff Hammond wrote:
> I do not understand this:
> "displacements associated with dynamic windows are addresses
> (unsigned) and can range into the space of negative integers"
> How can they "range into the space of negative integers" if they are unsigned?
> On Tue, Aug 28, 2012 at 9:46 AM, Jim Dinan <dinan at mcs.anl.gov> wrote:
>> Hi All,
>> Currently, target displacements in put/get/acc/etc are defined to be
>> non-negative integers of type, MPI_Aint. MPI_Aint is defined to be a signed
>> integer. However, displacements associated with dynamic windows are
>> addresses (unsigned) and can range into the space of negative integers.
>> It seems like the least impact change would be to add a special case that
>> the displacement argument will be interpreted as unsigned for dynamic
>> windows. Changing the interface to take an 'unsigned MPI_Aint' would be the
>> most clear (and preserve the existing and intended new semantics), but would
>> break backward compatibility.
>> Interested to hear your thoughts.
More information about the mpiwg-rma