mp_isendrecv_d Subroutine

private subroutine mp_isendrecv_d(msgin, dest, msgout, source, comm, send_request, recv_request, tag)

Non-blocking send and receive of a scalar

Implementation Calls mpi_isend and mpi_irecv.

Arguments

TypeIntentOptionalAttributesName
real(kind=real_8) :: msgin

Scalar data to send

integer, intent(in) :: dest

Which process to send to

real(kind=real_8) :: msgout

Receive data into this pointer

integer, intent(in) :: source

Process to receive from Message passing environment identifier

integer, intent(in) :: comm

Process to receive from Message passing environment identifier

integer, intent(out) :: send_request

Request handle for the send Request handle for the receive

integer, intent(out) :: recv_request

Request handle for the send Request handle for the receive

integer, intent(in), optional :: tag

tag to differentiate requests


Contents

Source Code


Source Code

      SUBROUTINE mp_isendrecv_d (msgin, dest, msgout, source, comm, send_request, &
                                             recv_request, tag)
      !! Non-blocking send and receive of a scalar
      !!
      !! Implementation
      !! Calls mpi_isend and mpi_irecv.

         REAL(kind=real_8)                                :: msgin
         !! Scalar data to send
         INTEGER, INTENT(IN)                      :: dest
         !! Which process to send to
         REAL(kind=real_8)                                :: msgout
         !! Receive data into this pointer
         INTEGER, INTENT(IN)                      :: source, comm
         !! Process to receive from
         !! Message passing environment identifier
         INTEGER, INTENT(out)                     :: send_request, recv_request
         !! Request handle for the send
         !! Request handle for the receive
         INTEGER, INTENT(in), OPTIONAL            :: tag
         !! tag to differentiate requests

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

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

         ierr = 0
         CALL timeset(routineN, handle)

#if defined(__parallel)
         my_tag = 0
         IF (PRESENT(tag)) my_tag = tag

         CALL mpi_irecv(msgout, 1, MPI_DOUBLE_PRECISION, source, my_tag, &
                        comm, recv_request, ierr)
         IF (ierr /= 0) CALL mp_stop(ierr, "mpi_irecv @ "//routineN)

         CALL mpi_isend(msgin, 1, MPI_DOUBLE_PRECISION, dest, my_tag, &
                        comm, send_request, ierr)
         IF (ierr /= 0) CALL mp_stop(ierr, "mpi_isend @ "//routineN)

         CALL add_perf(perf_id=8, msg_size=2*real_8_size)
#else
         MARK_USED(dest)
         MARK_USED(source)
         MARK_USED(comm)
         MARK_USED(tag)
         send_request = 0
         recv_request = 0
         msgout = msgin
#endif
         CALL timestop(handle)
      END SUBROUTINE mp_isendrecv_d