[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MPI-2.1 corrections, Batch 2 / AlltoallW



Topic: The displacements in MPI_ALLTOALLW are in bytes but the 
       language binding uses int and INTEGER instead of MPI_Aint 
       and INTEGER (KIND=MPI_ADDRESS_KIND). 
 
After the discussion on this topic, it seems to be the time to summarize 
the discussion to a clear new proposal B.

--------------------------------- 
 
Proposal A: text as currently on the Web page, i.e. to change
            the type of the displacements for integer to address-integer
            in the interface of MPI_Alltoallw.

[For my opinion, the "Proposal A" can be removed, because there seems
to be no positive vote on proposal A.]
 
---------------------------------- 

Proposal B: to add a new interface to MPI-2: MPI_Alltoallx

   Page 164, line 16-30 should read:
   
      7.3.5. Generalized All-to-all Functions
      
      One of the basic data movement operations needed in parallel signal processing is the 2-D 
      matrix transpose. This operation has motivated two generalizations of the MPI_ALLTOALLV 
      function. These new collective operations are MPI_ALLTOALLW and MPI_ALLTOALLX; 
      the ``W'' indicates that it is an extension to MPI_ALLTOALLV, 
      and ``X'' indicates that it is an extension to MPI_ALLTOALLW. 
      
      MPI_ALLTOALLX is the most general form of All-to-all. Like MPI_TYPE_CREATE_STRUCT, 
      the most general type constructor, MPI_ALLTOALLW and MPI_ALLTOALLX allow separate
      specification of count, displacement and datatype. 
      In addition, to allow maximum flexibility, the displacement of blocks within the send 
      and receive buffers is specified in bytes. In MPI_ALLTOALLW, these displacements are 
      specified as integer arguments and in MPI_ALLTOALLX they are specified as {\bf address} integer. 
      
      Rationale.  The MPI_ALLTOALLW function generalizes several MPI functions by 
      carefully selecting the input arguments. For example, by making all but one 
      process have sendcounts[i] = 0, this achieves an MPI_SCATTERW function. 
      MPI_ALLTOALLX allows the usage of MPI_BOTTOM as buffer argument and defining
      the different buffer location via the displacement arguments rather than only
      via different datatype arguments. 
      (End of rationale.) 

   Add to page 165, after line 38:

      MPI_ALLTOALLX(sendbuf, sendcounts, sdispls, sendtypes, recvbuf, recvcounts, rdispls, recvtypes, comm) 
       
      [ IN sendbuf] starting address of send buffer (choice) 
       
      [ IN sendcounts] integer array equal to the group size specifying the
      number of elements to send to each processor (array of integers)
      
      [ IN sdispls] integer array (of length group size). Entry j specifies
      the displacement in bytes (relative to sendbuf) from which to take the
      outgoing data destined for process j (array of  integers)
      
      [ IN sendtypes] array of datatypes (of length group size). Entry j
      specifies the type of data to send to process j (array of handles)
      
      [ OUT recvbuf] address of receive buffer (choice) 
      
      [ IN recvcounts] integer array equal to the group size specifying the
      number of elements that can be received from each processor (array of
      integers)
      
      [ IN rdispls] integer array (of length group size). Entry i specifies
      the displacement in bytes (relative to recvbuf) at which to place the
      incoming data from process i (array of integers)
      
      [ IN recvtypes] array of datatypes (of length group size). Entry i
      specifies the type of data received from process i (array of handles)
       
      [ IN comm] communicator (handle) 
      
      int MPI_Alltoallx(void *sendbuf, int sendcounts[], MPI_Aint sdispls[], 
      MPI_Datatype sendtypes[], void *recvbuf, int recvcounts[], MPI_Aint rdispls[], 
      MPI_Datatype recvtypes[], MPI_Comm comm)
      
      MPI_ALLTOALLx(SENDBUF, SENDCOUNTS, SDISPLS, SENDTYPES, RECVBUF, RECVCOUNTS, 
                    RDISPLS, RECVTYPES, COMM, IERROR) 
      <type> SENDBUF(*), RECVBUF(*)
      INTEGER SENDCOUNTS(*), SENDTYPES(*), RECVCOUNTS(*), RECVTYPES(*), COMM, IERROR
      INTEGER (KIND=MPI_ADDRESS_KIND) SDISPLS(*), RDISPLS(*)
      
      void MPI::Comm::Alltoallx(const void* sendbuf, const int sendcounts[], 
      const MPI::Aint sdispls[], const MPI::Datatype sendtypes[], void* recvbuf, 
      const int recvcounts[], const MPI::Aint rdispls[], 
      const MPI::Datatype recvtypes[]) const = 0 

   Add to page 312, after line 37:
      
      int MPI_Alltoallx(void *sendbuf, int sendcounts[], MPI_Aint sdispls[], 
      MPI_Datatype sendtypes[], void *recvbuf, int recvcounts[], MPI_Aint rdispls[], 
      MPI_Datatype recvtypes[], MPI_Comm comm)
      
   Add to page 322, after line 45:
      
      MPI_ALLTOALLx(SENDBUF, SENDCOUNTS, SDISPLS, SENDTYPES, RECVBUF, RECVCOUNTS, 
                    RDISPLS, RECVTYPES, COMM, IERROR) 
      <type> SENDBUF(*), RECVBUF(*)
      INTEGER SENDCOUNTS(*), SENDTYPES(*), RECVCOUNTS(*), RECVTYPES(*), COMM, IERROR
      INTEGER (KIND=MPI_ADDRESS_KIND) SDISPLS(*), RDISPLS(*)
      
   Add to page 335, after line 19:
      
      void MPI::Comm::Alltoallx(const void* sendbuf, const int sendcounts[], 
      const MPI::Aint sdispls[], const MPI::Datatype sendtypes[], void* recvbuf, 
      const int recvcounts[], const MPI::Aint rdispls[], 
      const MPI::Datatype recvtypes[]) const = 0 
       
 

Dr. Rolf Rabenseifner                      High Performance Computing
Parallel Computing                         Center Stuttgart    (HLRS)
Rechenzentrum Universitaet Stuttgart (RUS) Phone:    ++49 711 6855530
Allmandring 30                             FAX:      ++49 711 6787626
D-70550 Stuttgart                   rabenseifner@rus.uni-stuttgart.de
Germany                        http://www.hlrs.de/people/rabenseifner