Gathers matrix data from all processes and all processes receive the same data
see mp_allgather_r12
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real_4), | intent(in), | CONTIGUOUS | :: | msgout(:,:) |
Rank-2 data to send |
|
real(kind=real_4), | intent(out), | CONTIGUOUS | :: | msgin(:,:,:) | ||
integer, | intent(in) | :: | gid |
SUBROUTINE mp_allgather_r23(msgout, msgin, gid)
!! Gathers matrix data from all processes and all processes receive the
!! same data
!! @note see mp_allgather_r12
REAL(kind=real_4), CONTIGUOUS, INTENT(IN) :: msgout(:, :)
!! Rank-2 data to send
REAL(kind=real_4), CONTIGUOUS, INTENT(OUT) :: msgin(:, :, :)
INTEGER, INTENT(IN) :: gid
CHARACTER(LEN=*), PARAMETER :: routineN = 'mp_allgather_r23'
INTEGER :: handle, ierr
#if defined(__parallel)
INTEGER :: rcount, scount
#endif
ierr = 0
CALL timeset(routineN, handle)
#if defined(__parallel)
scount = SIZE(msgout(:, :))
rcount = scount
CALL MPI_ALLGATHER(msgout, scount, MPI_REAL, &
msgin, rcount, MPI_REAL, &
gid, ierr)
IF (ierr /= 0) CALL mp_stop(ierr, "mpi_allgather @ "//routineN)
#else
MARK_USED(gid)
msgin(:, :, 1) = msgout(:, :)
#endif
CALL timestop(handle)
END SUBROUTINE mp_allgather_r23