mp_iallgather_d Subroutine

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

Gathers a datum from all processes and all processes receive the same data

Data size All processes send equal-sized data

MPI mapping mpi_allgather

Arguments

TypeIntentOptionalAttributesName
real(kind=real_8), intent(in) :: msgout

Datum to send

real(kind=real_8), intent(out), CONTIGUOUS:: msgin(:)

Received data

integer, intent(in) :: gid

Message passing environment identifier

integer, intent(inout) :: request

Contents

Source Code


Source Code

      SUBROUTINE mp_iallgather_d (msgout, msgin, gid, request)
      !! Gathers a datum from all processes and all processes receive the
      !! same data
      !!
      !! Data size
      !! All processes send equal-sized data
      !!
      !! MPI mapping
      !! mpi_allgather

         REAL(kind=real_8), INTENT(IN)                    :: msgout
         !! Datum to send
         REAL(kind=real_8), CONTIGUOUS, INTENT(OUT)       :: msgin(:)
         !! Received data
         INTEGER, INTENT(IN)                      :: gid
         !! Message passing environment identifier
         INTEGER, INTENT(INOUT)                   :: request

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

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

         ierr = 0
         CALL timeset(routineN, handle)

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