mp_allgather_c34 Subroutine

private subroutine mp_allgather_c34(msgout, msgin, gid)

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

Note

see mp_allgather_c12

Arguments

Type IntentOptional Attributes Name
complex(kind=real_4), intent(in), CONTIGUOUS :: msgout(:,:,:)

Rank-3 data to send

complex(kind=real_4), intent(out), CONTIGUOUS :: msgin(:,:,:,:)
type(mp_comm_type), intent(in) :: gid

Source Code

      SUBROUTINE mp_allgather_c34(msgout, msgin, gid)
      !! Gathers rank-3 data from all processes and all processes receive the
      !! same data
      !! @note see mp_allgather_c12

         COMPLEX(kind=real_4), CONTIGUOUS, INTENT(IN)        :: msgout(:, :, :)
         !! Rank-3 data to send
         COMPLEX(kind=real_4), CONTIGUOUS, INTENT(OUT)       :: msgin(:, :, :, :)
         TYPE(mp_comm_type), INTENT(IN)                      :: gid

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

         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_ALLGATHER(msgout, scount, MPI_COMPLEX, &
                            msgin, rcount, MPI_COMPLEX, &
                            gid%handle, ierr)
         IF (ierr /= 0) CALL mp_stop(ierr, "mpi_allgather @ "//routineN)
#else
         MARK_USED(gid)
         msgin(:, :, :, 1) = msgout(:, :, :)
#endif
         CALL timestop(handle)
      END SUBROUTINE mp_allgather_c34