mp_alltoall_r11v Subroutine

private subroutine mp_alltoall_r11v(sb, scount, sdispl, rb, rcount, rdispl, group)

All-to-all data exchange, rank-1 data of different sizes

MPI mapping mpi_alltoallv

Array sizes The scount, rcount, and the sdispl and rdispl arrays have a size equal to the number of processes.

Offsets Values in sdispl and rdispl start with 0.

Arguments

Type IntentOptional Attributes Name
real(kind=real_4), intent(in), CONTIGUOUS :: sb(:)

Data to send

integer, intent(in), CONTIGUOUS :: scount(:)

Data counts for data sent to other processes Respective data offsets for data sent to process

integer, intent(in), CONTIGUOUS :: sdispl(:)

Data counts for data sent to other processes Respective data offsets for data sent to process

real(kind=real_4), intent(inout), CONTIGUOUS :: rb(:)

Buffer into which to receive data

integer, intent(in), CONTIGUOUS :: rcount(:)

Data counts for data received from other processes Respective data offsets for data received from other processes

integer, intent(in), CONTIGUOUS :: rdispl(:)

Data counts for data received from other processes Respective data offsets for data received from other processes

type(mp_comm_type), intent(in) :: group

Message passing environment identifier


Source Code

      SUBROUTINE mp_alltoall_r11v(sb, scount, sdispl, rb, rcount, rdispl, group)
      !! All-to-all data exchange, rank-1 data of different sizes
      !!
      !! MPI mapping
      !! mpi_alltoallv
      !!
      !! Array sizes
      !! The scount, rcount, and the sdispl and rdispl arrays have a
      !! size equal to the number of processes.
      !!
      !! Offsets
      !! Values in sdispl and rdispl start with 0.

         REAL(kind=real_4), CONTIGUOUS, INTENT(IN)        :: sb(:)
         !! Data to send
         INTEGER, CONTIGUOUS, INTENT(IN)          :: scount(:), sdispl(:)
         !! Data counts for data sent to other processes
         !! Respective data offsets for data sent to process
         REAL(kind=real_4), CONTIGUOUS, INTENT(INOUT)     :: rb(:)
         !! Buffer into which to receive data
         INTEGER, CONTIGUOUS, INTENT(IN)          :: rcount(:), rdispl(:)
         !! Data counts for data received from other processes
         !! Respective data offsets for data received from other processes
         TYPE(mp_comm_type), INTENT(IN)                      :: group
         !! Message passing environment identifier

         CHARACTER(LEN=*), PARAMETER :: routineN = 'mp_alltoall_r11v'

         INTEGER                                  :: handle, ierr
#if defined(__parallel)
         INTEGER                                  :: msglen
#else
         INTEGER                                  :: i
#endif

         CALL timeset(routineN, handle)

         ierr = 0
#if defined(__parallel)
         CALL mpi_alltoallv(sb, scount, sdispl, MPI_REAL, &
                            rb, rcount, rdispl, MPI_REAL, group%handle, ierr)
         IF (ierr /= 0) CALL mp_stop(ierr, "mpi_alltoallv @ "//routineN)
         msglen = SUM(scount) + SUM(rcount)
         CALL add_perf(perf_id=6, msg_size=msglen*real_4_size)
#else
         MARK_USED(group)
         MARK_USED(scount)
         MARK_USED(sdispl)
!$OMP     PARALLEL DO DEFAULT(NONE) PRIVATE(i) SHARED(rcount,rdispl,sdispl,rb,sb)
         DO i = 1, rcount(1)
            rb(rdispl(1) + i) = sb(sdispl(1) + i)
         END DO
#endif
         CALL timestop(handle)

      END SUBROUTINE mp_alltoall_r11v