mp_recv_cv Subroutine

private subroutine mp_recv_cv(msg, source, tag, gid)

Receive rank-1 data from another process

Note

see mp_recv_c

Arguments

Type IntentOptional Attributes Name
complex(kind=real_4), intent(inout), CONTIGUOUS :: msg(:)

Place received data into this rank-1 array

integer, intent(inout) :: source
integer, intent(inout) :: tag
type(mp_comm_type), intent(in) :: gid

Source Code

      SUBROUTINE mp_recv_cv(msg, source, tag, gid)
      !! Receive rank-1 data from another process
      !! @note see mp_recv_c

         COMPLEX(kind=real_4), CONTIGUOUS, INTENT(INOUT)     :: msg(:)
         !! Place received data into this rank-1 array
         INTEGER, INTENT(INOUT)                   :: source, tag
         TYPE(mp_comm_type), INTENT(IN)                      :: gid

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

         INTEGER                                  :: handle, ierr, msglen
#if defined(__parallel)
         MPI_STATUS_TYPE                          :: status
#endif

         ierr = 0
         CALL timeset(routineN, handle)

         msglen = SIZE(msg)
#if defined(__parallel)
         CALL mpi_recv(msg, msglen, MPI_COMPLEX, source, tag, gid%handle, status, ierr)
         IF (ierr /= 0) CALL mp_stop(ierr, "mpi_recv @ "//routineN)
         CALL add_perf(perf_id=14, msg_size=msglen*(2*real_4_size))
         source = status MPI_STATUS_EXTRACT(MPI_SOURCE)
         tag = status MPI_STATUS_EXTRACT(MPI_TAG)
#else
         MARK_USED(msg)
         MARK_USED(source)
         MARK_USED(tag)
         MARK_USED(gid)
         ! only defined in parallel
         DBCSR_ABORT("not in parallel mode")
#endif
         CALL timestop(handle)
      END SUBROUTINE mp_recv_cv