Gathers vector data from all processes and all processes receive the same data
Data size Processes can send different-sized data
Ranks The last rank counts the processes
Offsets Offsets are from 0
MPI mapping mpi_allgather
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real_8), | intent(in), | CONTIGUOUS | :: | msgout(:) |
Rank-1 data to send |
|
real(kind=real_8), | intent(out), | CONTIGUOUS | :: | msgin(:) |
Received data |
|
integer, | intent(in), | CONTIGUOUS | :: | rcount(:) | ||
integer, | intent(in), | CONTIGUOUS | :: | rdispl(:) | ||
type(mp_comm_type), | intent(in) | :: | gid |
Size of sent data for every process Offset of sent data for every process Message passing environment identifier |
SUBROUTINE mp_allgatherv_dv(msgout, msgin, rcount, rdispl, gid) !! Gathers vector data from all processes and all processes receive the !! same data !! !! Data size !! Processes can send different-sized data !! !! Ranks !! The last rank counts the processes !! !! Offsets !! Offsets are from 0 !! !! MPI mapping !! mpi_allgather REAL(kind=real_8), CONTIGUOUS, INTENT(IN) :: msgout(:) !! Rank-1 data to send REAL(kind=real_8), CONTIGUOUS, INTENT(OUT) :: msgin(:) !! Received data INTEGER, CONTIGUOUS, INTENT(IN) :: rcount(:), rdispl(:) TYPE(mp_comm_type), INTENT(IN) :: gid !! Size of sent data for every process !! Offset of sent data for every process !! Message passing environment identifier CHARACTER(LEN=*), PARAMETER :: routineN = 'mp_allgatherv_dv' INTEGER :: handle, ierr #if defined(__parallel) INTEGER :: scount #endif ierr = 0 CALL timeset(routineN, handle) #if defined(__parallel) scount = SIZE(msgout) CALL MPI_ALLGATHERV(msgout, scount, MPI_DOUBLE_PRECISION, msgin, rcount, & rdispl, MPI_DOUBLE_PRECISION, gid%handle, ierr) IF (ierr /= 0) CALL mp_stop(ierr, "mpi_allgatherv @ "//routineN) #else MARK_USED(rcount) MARK_USED(rdispl) MARK_USED(gid) msgin = msgout #endif CALL timestop(handle) END SUBROUTINE mp_allgatherv_dv