mp_allgather_i2 Subroutine

private subroutine mp_allgather_i2(msgout, msgin, gid)

Gathers a datum from all processes and all processes receive the same data

Data size All processes send equal-sized data

MPI mapping mpi_allgather

Arguments

TypeIntentOptionalAttributesName
integer(kind=int_4), intent(in) :: msgout

Datum to send

integer(kind=int_4), intent(out), CONTIGUOUS:: msgin(:,:)

Received data

integer, intent(in) :: gid

Message passing environment identifier


Contents

Source Code


Source Code

      SUBROUTINE mp_allgather_i2(msgout, msgin, gid)
      !! Gathers a datum from all processes and all processes receive the
      !! same data
      !!
      !! Data size
      !! All processes send equal-sized data
      !!
      !! MPI mapping
      !! mpi_allgather

         INTEGER(KIND=int_4), INTENT(IN)                    :: msgout
         !! Datum to send
         INTEGER(KIND=int_4), CONTIGUOUS, INTENT(OUT)       :: msgin(:, :)
         !! Received data
         INTEGER, INTENT(IN)                      :: gid
         !! Message passing environment identifier

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

         INTEGER                                  :: handle, ierr
#if defined(__parallel)
         INTEGER                                  :: rcount, scount
#endif

         ierr = 0
         CALL timeset(routineN, handle)

#if defined(__parallel)
         scount = 1
         rcount = 1
         CALL MPI_ALLGATHER(msgout, scount, MPI_INTEGER, &
                            msgin, rcount, MPI_INTEGER, &
                            gid, ierr)
         IF (ierr /= 0) CALL mp_stop(ierr, "mpi_allgather @ "//routineN)
#else
         MARK_USED(gid)
         msgin = msgout
#endif
         CALL timestop(handle)
      END SUBROUTINE mp_allgather_i2