mp_alltoall_d22 Subroutine

private subroutine mp_alltoall_d22(sb, rb, count, group)

All-to-all data exchange, rank-2 arrays, equal sizes

Arguments

TypeIntentOptionalAttributesName
real(kind=real_8), intent(in), CONTIGUOUS:: sb(:,:)
real(kind=real_8), intent(out), CONTIGUOUS:: rb(:,:)
integer, intent(in) :: count
integer, intent(in) :: group

Contents

Source Code


Source Code

      SUBROUTINE mp_alltoall_d22(sb, rb, count, group)
      !! All-to-all data exchange, rank-2 arrays, equal sizes
      !! @note see mp_alltoall_d

         REAL(kind=real_8), CONTIGUOUS, INTENT(IN)        :: sb(:, :)
         REAL(kind=real_8), CONTIGUOUS, INTENT(OUT)       :: rb(:, :)
         INTEGER, INTENT(IN)                      :: count, group

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

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

         ierr = 0
         CALL timeset(routineN, handle)

#if defined(__parallel)
         CALL mpi_alltoall(sb, count, MPI_DOUBLE_PRECISION, &
                           rb, count, MPI_DOUBLE_PRECISION, group, ierr)
         IF (ierr /= 0) CALL mp_stop(ierr, "mpi_alltoall @ "//routineN)
         CALL mpi_comm_size(group, np, ierr)
         IF (ierr /= 0) CALL mp_stop(ierr, "mpi_comm_size @ "//routineN)
         msglen = 2*SIZE(sb)*np
         CALL add_perf(perf_id=6, msg_size=msglen*real_8_size)
#else
         MARK_USED(count)
         MARK_USED(group)
         rb = sb
#endif
         CALL timestop(handle)

      END SUBROUTINE mp_alltoall_d22