Gathers data from all processes to one.
Data length Data can have different lengths
Offsets Offsets start at 0
MPI mapping mpi_gather
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex(kind=real_8), | intent(in), | DIMENSION(:), CONTIGUOUS | :: | sendbuf |
Data to send to root |
|
complex(kind=real_8), | intent(out), | DIMENSION(:), CONTIGUOUS | :: | recvbuf |
Received data (on root) |
|
integer, | intent(in), | DIMENSION(:), CONTIGUOUS | :: | recvcounts |
Sizes of data received from processes Offsets of data received from processes |
|
integer, | intent(in), | DIMENSION(:), CONTIGUOUS | :: | displs |
Sizes of data received from processes Offsets of data received from processes |
|
integer, | intent(in) | :: | root |
Process which gathers the data Message passing environment identifier |
||
integer, | intent(in) | :: | comm |
Process which gathers the data Message passing environment identifier |
SUBROUTINE mp_gatherv_zv(sendbuf, recvbuf, recvcounts, displs, root, comm)
!! Gathers data from all processes to one.
!!
!! Data length
!! Data can have different lengths
!!
!! Offsets
!! Offsets start at 0
!!
!! MPI mapping
!! mpi_gather
COMPLEX(kind=real_8), DIMENSION(:), CONTIGUOUS, INTENT(IN) :: sendbuf
!! Data to send to root
COMPLEX(kind=real_8), DIMENSION(:), CONTIGUOUS, INTENT(OUT) :: recvbuf
!! Received data (on root)
INTEGER, DIMENSION(:), CONTIGUOUS, INTENT(IN) :: recvcounts, displs
!! Sizes of data received from processes
!! Offsets of data received from processes
INTEGER, INTENT(IN) :: root, comm
!! Process which gathers the data
!! Message passing environment identifier
CHARACTER(LEN=*), PARAMETER :: routineN = 'mp_gatherv_zv'
INTEGER :: handle, ierr
#if defined(__parallel)
INTEGER :: sendcount
#endif
ierr = 0
CALL timeset(routineN, handle)
#if defined(__parallel)
sendcount = SIZE(sendbuf)
CALL mpi_gatherv(sendbuf, sendcount, MPI_DOUBLE_COMPLEX, &
recvbuf, recvcounts, displs, MPI_DOUBLE_COMPLEX, &
root, comm, ierr)
IF (ierr /= 0) CALL mp_stop(ierr, "mpi_gatherv @ "//routineN)
CALL add_perf(perf_id=4, &
msg_size=sendcount*(2*real_8_size))
#else
MARK_USED(recvcounts)
MARK_USED(root)
MARK_USED(comm)
recvbuf(1 + displs(1):) = sendbuf
#endif
CALL timestop(handle)
END SUBROUTINE mp_gatherv_zv