mp_recv_r Subroutine

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

Receive one datum from another process

MPI mapping mpi_send

Arguments

TypeIntentOptionalAttributesName
real(kind=real_4), intent(inout) :: msg

Place received data into this variable

integer, intent(inout) :: source

Process to receive from Transfer identifier

integer, intent(inout) :: tag

Process to receive from Transfer identifier

integer, intent(in) :: gid

Message passing environment identifier


Contents

Source Code


Source Code

      SUBROUTINE mp_recv_r (msg, source, tag, gid)
      !! Receive one datum from another process
      !!
      !! MPI mapping
      !! mpi_send

         REAL(kind=real_4), INTENT(INOUT)                 :: msg
         !! Place received data into this variable
         INTEGER, INTENT(INOUT)                   :: source, tag
         !! Process to receive from
         !! Transfer identifier
         INTEGER, INTENT(IN)                      :: gid
         !! Message passing environment identifier

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

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

         ierr = 0
         CALL timeset(routineN, handle)

         msglen = 1
#if defined(__parallel)
         ALLOCATE (status(MPI_STATUS_SIZE))
         CALL mpi_recv(msg, msglen, MPI_REAL, source, tag, gid, status, ierr)
         IF (ierr /= 0) CALL mp_stop(ierr, "mpi_recv @ "//routineN)
         CALL add_perf(perf_id=14, msg_size=msglen*real_4_size)
         source = status(MPI_SOURCE)
         tag = status(MPI_TAG)
         DEALLOCATE (status)
#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_r