[mpi-21] Ballot 4 - 0-dim MPI_CART_CREATE and MPI_CART_SUB

Rolf Rabenseifner rabenseifner at [hidden]
Thu Jan 24 10:30:03 CST 2008



On Thu, 24 Jan 2008 21:26:09 +0800
 "William Yu" <wyu_at_[hidden]> wrote:
>Understood. Nice work. Thanks!

Thank you. 
And here is the proposal to correct all the unclear specifications
on Cartesian topologies.

This is a proposal for MPI 2.1, Ballot 4.
________________________________________________________________
Proposal about handling zero-dimensional Cartesian communicators
that are produced with  MPI_Cart_sub if all remain_dims are 
false.

MPI-1.1 Sect.6.5.4, page 187, lines 38-42 (definition of MPI_Cart_sub) 
reads
    If a cartesian topology has been created with MPI_CART_CREATE, 
  the function MPI_CART_SUB can be used to partition the 
  communicator group into subgroups that form lower-dimensional 
  cartesian subgrids, and to build for each subgroup a 
  communicator with the associated subgrid cartesian topology. 
  (This function is closely related to MPI_COMM_SPLIT.)
but should read
    If a cartesian topology has been created with MPI_CART_CREATE, 
  the function MPI_CART_SUB can be used to partition the 
  communicator group into subgroups that form lower-dimensional 
  cartesian subgrids, and to build for each subgroup a 
  communicator with the associated subgrid cartesian topology.
  If all entries in remain_dims are false or comm is already
  associated with a zero-dimensional Cartesian topology
  then newcomm is associated with a zero-dimensional Cartesian 
  topology. (This function is closely related to MPI_COMM_SPLIT.)

Rationale for this clarification (not to be included into the 
MPI standard): Several MPI implementations have implemented
the MPI-1 standard which requires a "lower-dimensional 
cartesian" subgrid and that newcomm is "associated" with the
"subgrid Cartesian topology". Other MPI implementations
did not or only partially. Therefore, a clarification may help
that all MPI implementations implment the same interface. 
________________________

MPI-1.1 Sect.6.5.4, page 183, lines 29-30 (definition of MPI_Cartdim_get 
and MPI_Cart_get) reads:
    The functions MPI_CARTDIM_GET and MPI_CART_GET return the 
  cartesian topology information that was associated with a 
  communicator by MPI_CART_CREATE.
but should read
    The functions MPI_CARTDIM_GET and MPI_CART_GET return the 
  cartesian topology information that was associated with a 
  communicator by MPI_CART_CREATE. If comm is associated with a
  zero-dimensional Cartesian topology, MPI_Cartdim_get returns
  ndims=0 and MPI_Cart_get will keep all output arguments 
  unchanged.

Rationale for this clarification (not to be included into the 
MPI standard): Zero-dimensional topologies have zero coords,
i.e., do not have coords and therefore also no dims, or periods.  
________________________

MPI-1.1 Sect.6.5.4, page 184, lines 17-23 (definition of MPI_Cart_rank) 
reads
    For a process group with cartesian structure, the function 
  MPI_CART_RANK translates the logical process coordinates to 
  process ranks as they are used by the point-to-point routines.
    For dimension i with periods(i) = true, if the coordinate,
  coords(i), is out of range, that is, coords(i) < 0 or 
  coords(i) >= dims(i), it is shifted back to the interval
  0 <= coords(i) < dims(i) automatically. Out-of-range 
  coordinates are erroneous for non-periodic dimensions.
but should read
    For a process group with cartesian structure, the function 
  MPI_CART_RANK translates the logical process coordinates to 
  process ranks as they are used by the point-to-point routines.
    For dimension i with periods(i) = true, if the coordinate,
  coords(i), is out of range, that is, coords(i) < 0 or 
  coords(i) >= dims(i), it is shifted back to the interval
  0 <= coords(i) < dims(i) automatically. Out-of-range 
  coordinates are erroneous for non-periodic dimensions.
    If comm is associated with a zero-dimensional Cartesian 
  topology, coord is not significant and 0 is returned in rank.

Rationale for this clarification (not to be included into the 
MPI standard): Zero-dimensional topologies have zero coords,
i.e., do not have coords. The communicator has only one process
and therefore only the rank 0 is valid.
________________________

MPI-1.1 Sect.6.5.4, page 184, lines 38-39 (definition of MPI_Cart_coords) 
reads
    The inverse mapping, rank-to-coordinates translation is 
  provided by MPI CART COORDS.
but should read
    The inverse mapping, rank-to-coordinates translation is 
  provided by MPI CART COORDS.
    If comm is associated with a zero-dimensional Cartesian 
  topology, coords will be unchanged.

Rationale for this clarification (not to be included into the 
MPI standard): Zero-dimensional topologies have zero coords,
i.e., do not have coords. 
________________________

Alternative 1:
--------------
MPI-1.1 Sect.6.5.5, page 186, after line 47 (end of definition 
of MPI_Cart_shift), the following paragraph is added:
    It is erroneous to call MPI_CART_SHIFT with comm that is
  associated with a zero-dimensional Cartesian topology.

Rationale for this clarification (not to be included into the 
MPI standard): It is impossible to define a correct input for
direction because there does not exist any directions in a 
zero-dimensional topology. (This is currently implemented
by several MPI implementations.)

Alternative 2:
--------------
MPI-1.1 Sect.6.5.5, page 186, after line 47 (end of definition 
of MPI_Cart_shift), the following paragraph is added:
    If comm is associated with a zero-dimensional Cartesian 
  topology, then the input arguments direction and disp are 
  ignored and always MPI_PROC_NULL is returned in rank_source
  and rank_dest.

Rationale for this clarification (not to be included into the 
MPI standard): It is impossible to define a correct input for
direction because there does not exist any directions in a 
zero-dimensional topology. For convenience, the routine
returns MPI_PROC_NULL.
_______________________

MPI-1.1 Sect.6.5.1, page 179, lines 29-30 (end of definition 
of MPI_Cart_create) reads
  The call is erroneous if it specifies a grid that is 
  larger than the group size.    
but should read
  The call is erroneous if it specifies a grid that is 
  larger than the group size or ndims is zero or negative.

Rationale for this clarification (not to be included into the 
MPI standard): 
Although it is allowed to produce zero-dimensional subgrids 
with MPI_CART_SUB, it makes no sense to establish a 
zero-dimensional grid a priori with MPI_CART_CREATE.
_______________________

MPI-1.1 Sect.6.5.4, page 184, lines 30 (definition of 
MPI_Cart_coords) reads
  IN    maxdims    length of vector coord in the calling program (integer)
 
but should read (missing “s” at coords)
  IN    maxdims    length of vector coords in the calling program (integer)

Rationale for this clarification (not to be included into the 
MPI standard): Typo.
_______________________

Best regards
Rolf Rabenseifner

PS: All background informations with reports from 5 
    different MPI implementations and their differences
    have been in my previous mail on Wed, 23 Jan 2008 18:42:43.

Dr. Rolf Rabenseifner . . . . . . . . . .. email rabenseifner_at_[hidden]
High Performance Computing Center (HLRS) . phone ++49(0)711/685-65530
University of Stuttgart . . . . . . . . .. fax ++49(0)711 / 685-65832
Head of Dpmt Parallel Computing . . . www.hlrs.de/people/rabenseifner
Nobelstr. 19, D-70550 Stuttgart, Germany . (Office: Allmandring 30)



More information about the Mpi-21 mailing list