mp_iallgather_l33 Subroutine

private subroutine mp_iallgather_l33(msgout, msgin, gid, request)

Gathers rank-3 data from all processes and all processes receive the same data

Arguments

TypeIntentOptionalAttributesName
integer(kind=int_8), intent(in), CONTIGUOUS:: msgout(:,:,:)

Rank-3 data to send

integer(kind=int_8), intent(out), CONTIGUOUS:: msgin(:,:,:)
integer, intent(in) :: gid
integer, intent(out) :: request

Contents

Source Code


Source Code

      SUBROUTINE mp_iallgather_l33(msgout, msgin, gid, request)
      !! Gathers rank-3 data from all processes and all processes receive the
      !! same data
      !! @note see mp_allgather_l12

         INTEGER(KIND=int_8), CONTIGUOUS, INTENT(IN)        :: msgout(:, :, :)
         !! Rank-3 data to send
         INTEGER(KIND=int_8), CONTIGUOUS, INTENT(OUT)       :: msgin(:, :, :)
         INTEGER, INTENT(IN)                      :: gid
         INTEGER, INTENT(OUT)                     :: request

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

         INTEGER                                  :: handle, ierr
#if defined(__parallel)
         INTEGER                                  :: rcount, scount
#endif

         ierr = 0
         CALL timeset(routineN, handle)

#if defined(__parallel)
#if __MPI_VERSION > 2
         scount = SIZE(msgout(:, :, :))
         rcount = scount
         CALL MPI_IALLGATHER(msgout, scount, MPI_INTEGER8, &
                             msgin, rcount, MPI_INTEGER8, &
                             gid, request, ierr)
#else
         MARK_USED(msgout)
         MARK_USED(msgin)
         MARK_USED(rcount)
         MARK_USED(scount)
         MARK_USED(gid)
         request = mp_request_null
         DBCSR_ABORT("mp_iallgather requires MPI-3 standard")
#endif
         IF (ierr /= 0) CALL mp_stop(ierr, "mpi_iallgather @ "//routineN)
#else
         MARK_USED(gid)
         msgin(:, :, :) = msgout(:, :, :)
         request = mp_request_null
#endif
         CALL timestop(handle)
      END SUBROUTINE mp_iallgather_l33