Disp_unit in dynamic windows should not be signed
Hi All, The MPI spec states that the disp_unit argument to RMA calls must be a non-negative integer (of type MPI_Aint). For dynamic windows, the displacement is the address relative to MPI_BOTTOM (i.e. NULL), which can be in the negative range when interpreted as a signed integer. We currently implement MPI_Aint as a signed integer. Is this correct? If so, we need to make changes to the RMA chapter to account for disp_units on dynamic windows (e.g. to allow us to ignore signedness of disp_unit for windows of this flavor). ~Jim.
Just to get the terminology right, you are referring to the "target_disp" parameter to put/get/accumulate calls, not the "disp_unit" passed to window creation functions, right? Rajeev On Aug 27, 2012, at 12:57 PM, Jim Dinan wrote:
Hi All,
The MPI spec states that the disp_unit argument to RMA calls must be a non-negative integer (of type MPI_Aint). For dynamic windows, the displacement is the address relative to MPI_BOTTOM (i.e. NULL), which can be in the negative range when interpreted as a signed integer.
We currently implement MPI_Aint as a signed integer. Is this correct? If so, we need to make changes to the RMA chapter to account for disp_units on dynamic windows (e.g. to allow us to ignore signedness of disp_unit for windows of this flavor).
~Jim.
MPI_Aint cannot be defined as unsigned because the sign is needed in other functions that take Aint. For example, in MPI_Type_create_hindexed the displacements can be negative Aints. I checked that in Open MPI it is defined as the C type ptrdiff_t, which is a signed integer. Rajeev On Aug 27, 2012, at 8:04 PM, Rajeev Thakur wrote:
Just to get the terminology right, you are referring to the "target_disp" parameter to put/get/accumulate calls, not the "disp_unit" passed to window creation functions, right?
Rajeev
On Aug 27, 2012, at 12:57 PM, Jim Dinan wrote:
Hi All,
The MPI spec states that the disp_unit argument to RMA calls must be a non-negative integer (of type MPI_Aint). For dynamic windows, the displacement is the address relative to MPI_BOTTOM (i.e. NULL), which can be in the negative range when interpreted as a signed integer.
We currently implement MPI_Aint as a signed integer. Is this correct? If so, we need to make changes to the RMA chapter to account for disp_units on dynamic windows (e.g. to allow us to ignore signedness of disp_unit for windows of this flavor).
~Jim.
On 08/27/2012 08:14 PM, Rajeev Thakur wrote:
MPI_Aint cannot be defined as unsigned because the sign is needed in other functions that take Aint. For example, in MPI_Type_create_hindexed the displacements can be negative Aints.
I checked that in Open MPI it is defined as the C type ptrdiff_t, which is a signed integer.
Ahh, right. I think we will need to make a change to the 3.0 standard so that the target displacements are interpreted as unsigned when using dynamic windows. It would be more consistent to make this change everywhere (and it wouldn't break anything, since target displacements already must be non-negative) -- but, would this require us to change the function signature?
Just to get the terminology right, you are referring to the "target_disp" parameter to put/get/accumulate calls, not the "disp_unit" passed to window creation functions, right?
You're right, terminology mixup. ~Jim.
Maybe something to bring up on the mpi3-rma list. Rajeev On Aug 27, 2012, at 11:01 PM, Jim Dinan wrote:
On 08/27/2012 08:14 PM, Rajeev Thakur wrote:
MPI_Aint cannot be defined as unsigned because the sign is needed in other functions that take Aint. For example, in MPI_Type_create_hindexed the displacements can be negative Aints.
I checked that in Open MPI it is defined as the C type ptrdiff_t, which is a signed integer.
Ahh, right. I think we will need to make a change to the 3.0 standard so that the target displacements are interpreted as unsigned when using dynamic windows. It would be more consistent to make this change everywhere (and it wouldn't break anything, since target displacements already must be non-negative) -- but, would this require us to change the function signature?
Just to get the terminology right, you are referring to the "target_disp" parameter to put/get/accumulate calls, not the "disp_unit" passed to window creation functions, right?
You're right, terminology mixup.
~Jim.
Hi All, Here is the suggested change to address this issue. On page 425, line 1, add the bracketed sentence: In the case of a window created with MPI_WIN_CREATE_DYNAMIC, the target_disp for all RMA functions is the address at the target; i.e., the effective window_base is MPI_BOTTOM and the disp_unit is one. [Thus, for dynamic windows, the target_disp argument to all RMA functions in interpreted as unsigned.] Users should use MPI_GET_ADDRESS at the target process to determine the address of a target memory location and communicate this address to the origin process. ~Jim. On 8/27/12 12:57 PM, Jim Dinan wrote:
Hi All,
The MPI spec states that the disp_unit argument to RMA calls must be a non-negative integer (of type MPI_Aint). For dynamic windows, the displacement is the address relative to MPI_BOTTOM (i.e. NULL), which can be in the negative range when interpreted as a signed integer.
We currently implement MPI_Aint as a signed integer. Is this correct? If so, we need to make changes to the RMA chapter to account for disp_units on dynamic windows (e.g. to allow us to ignore signedness of disp_unit for windows of this flavor).
~Jim.
Whoops, I meant to send this to the RMA WG list. Apologies for the spam. ~Jim. On 8/28/12 2:27 PM, Jim Dinan wrote:
Hi All,
Here is the suggested change to address this issue. On page 425, line 1, add the bracketed sentence:
In the case of a window created with MPI_WIN_CREATE_DYNAMIC, the target_disp for all RMA functions is the address at the target; i.e., the effective window_base is MPI_BOTTOM and the disp_unit is one. [Thus, for dynamic windows, the target_disp argument to all RMA functions in interpreted as unsigned.] Users should use MPI_GET_ADDRESS at the target process to determine the address of a target memory location and communicate this address to the origin process.
~Jim.
On 8/27/12 12:57 PM, Jim Dinan wrote:
Hi All,
The MPI spec states that the disp_unit argument to RMA calls must be a non-negative integer (of type MPI_Aint). For dynamic windows, the displacement is the address relative to MPI_BOTTOM (i.e. NULL), which can be in the negative range when interpreted as a signed integer.
We currently implement MPI_Aint as a signed integer. Is this correct? If so, we need to make changes to the RMA chapter to account for disp_units on dynamic windows (e.g. to allow us to ignore signedness of disp_unit for windows of this flavor).
~Jim.
participants (2)
-
Jim Dinan -
Rajeev Thakur