Gathers a datum from all processes to one
MPI mapping mpi_gather
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int_8), | intent(in) | :: | msg |
Datum to send to root |
||
integer(kind=int_8), | intent(out), | CONTIGUOUS | :: | msg_gather(:) |
Received data (on root) |
|
integer, | intent(in) | :: | root |
Process which gathers the data |
||
type(mp_comm_type), | intent(in) | :: | gid |
Message passing environment identifier |
SUBROUTINE mp_gather_l (msg, msg_gather, root, gid) !! Gathers a datum from all processes to one !! !! MPI mapping !! mpi_gather INTEGER(KIND=int_8), INTENT(IN) :: msg !! Datum to send to root INTEGER(KIND=int_8), CONTIGUOUS, INTENT(OUT) :: msg_gather(:) !! Received data (on root) INTEGER, INTENT(IN) :: root !! Process which gathers the data TYPE(mp_comm_type), INTENT(IN) :: gid !! Message passing environment identifier CHARACTER(LEN=*), PARAMETER :: routineN = 'mp_gather_l' INTEGER :: handle, ierr, msglen ierr = 0 CALL timeset(routineN, handle) msglen = 1 #if defined(__parallel) CALL mpi_gather(msg, msglen, MPI_INTEGER8, msg_gather, & msglen, MPI_INTEGER8, root, gid%handle, ierr) IF (ierr /= 0) CALL mp_stop(ierr, "mpi_gather @ "//routineN) CALL add_perf(perf_id=4, msg_size=msglen*int_8_size) #else MARK_USED(root) MARK_USED(gid) msg_gather(1) = msg #endif CALL timestop(handle) END SUBROUTINE mp_gather_l