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 | ||
---|---|---|---|---|---|---|
complex(kind=real_8), | intent(in), | CONTIGUOUS | :: | msgout(:) |
Rank-1 data to send |
|
complex(kind=real_8), | intent(out), | CONTIGUOUS | :: | msgin(:) |
Received data |
|
integer, | intent(in), | CONTIGUOUS | :: | rcount(:) | ||
integer, | intent(in), | CONTIGUOUS | :: | rdispl(:) | ||
integer, | intent(in) | :: | gid |
Size of sent data for every process Offset of sent data for every process Message passing environment identifier |
SUBROUTINE mp_allgatherv_zv(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
COMPLEX(kind=real_8), CONTIGUOUS, INTENT(IN) :: msgout(:)
!! Rank-1 data to send
COMPLEX(kind=real_8), CONTIGUOUS, INTENT(OUT) :: msgin(:)
!! Received data
INTEGER, CONTIGUOUS, INTENT(IN) :: rcount(:), rdispl(:)
INTEGER, 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_zv'
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_COMPLEX, msgin, rcount, &
rdispl, MPI_DOUBLE_COMPLEX, gid, 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_zv