mp_iallgather_i24 Subroutine

private subroutine mp_iallgather_i24(msgout, msgin, gid, request)

Gathers rank-2 data from all processes and all processes receive the same data

Note

see mp_allgather_i12

Arguments

Type IntentOptional Attributes Name
integer(kind=int_4), intent(in), CONTIGUOUS :: msgout(:,:)

Rank-2 data to send

integer(kind=int_4), intent(out), CONTIGUOUS :: msgin(:,:,:,:)
type(mp_comm_type), intent(in) :: gid
type(mp_request_type), intent(out) :: request

Source Code

      SUBROUTINE mp_iallgather_i24(msgout, msgin, gid, request)
      !! Gathers rank-2 data from all processes and all processes receive the
      !! same data
      !! @note see mp_allgather_i12

         INTEGER(KIND=int_4), CONTIGUOUS, INTENT(IN)        :: msgout(:, :)
         !! Rank-2 data to send
         INTEGER(KIND=int_4), CONTIGUOUS, INTENT(OUT)       :: msgin(:, :, :, :)
         TYPE(mp_comm_type), INTENT(IN)           :: gid
         TYPE(mp_request_type), INTENT(OUT)       :: request

         CHARACTER(LEN=*), PARAMETER :: routineN = 'mp_iallgather_i24'

         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_IALLGATHER(msgout, scount, MPI_INTEGER, &
                             msgin, rcount, MPI_INTEGER, &
                             gid%handle, request%handle, ierr)
         IF (ierr /= 0) CALL mp_stop(ierr, "mpi_iallgather @ "//routineN)
#else
         MARK_USED(gid)
         msgin(:, :, 1, 1) = msgout(:, :)
         request = mp_request_null
#endif
         CALL timestop(handle)
      END SUBROUTINE mp_iallgather_i24