mp_irecv_zv Subroutine

private subroutine mp_irecv_zv(msgout, source, comm, request, tag)

Non-blocking receive of vector data

Note

see mp_isendrecv_zv

Note

arrays can be pointers or assumed shape, but they must be contiguous!

Arguments

Type IntentOptional Attributes Name
complex(kind=real_8), CONTIGUOUS, DIMENSION(:) :: msgout
integer, intent(in) :: source
type(mp_comm_type), intent(in) :: comm
type(mp_request_type), intent(out) :: request
integer, intent(in), optional :: tag

Source Code

      SUBROUTINE mp_irecv_zv(msgout, source, comm, request, tag)
      !! Non-blocking receive of vector data
      !! @note see mp_isendrecv_zv
      !! @endnote
      !! @note
      !! arrays can be pointers or assumed shape, but they must be contiguous!

         COMPLEX(kind=real_8), CONTIGUOUS, DIMENSION(:)      :: msgout
         INTEGER, INTENT(IN)                      :: source
         TYPE(mp_comm_type), INTENT(IN)           :: comm
         TYPE(mp_request_type), INTENT(out)       :: request
         INTEGER, INTENT(in), OPTIONAL            :: tag

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

         INTEGER                                  :: handle, ierr
#if defined(__parallel)
         INTEGER                                  :: msglen, my_tag
         COMPLEX(kind=real_8)                                :: foo(1)
#endif

         ierr = 0
         CALL timeset(routineN, handle)

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

         msglen = SIZE(msgout)
         IF (msglen > 0) THEN
            CALL mpi_irecv(msgout, msglen, MPI_DOUBLE_COMPLEX, source, my_tag, &
                           comm%handle, request%handle, ierr)
         ELSE
            CALL mpi_irecv(foo, msglen, MPI_DOUBLE_COMPLEX, source, my_tag, &
                           comm%handle, request%handle, ierr)
         END IF
         IF (ierr /= 0) CALL mp_stop(ierr, "mpi_irecv @ "//routineN)

         CALL add_perf(perf_id=12, msg_size=msglen*(2*real_8_size))
#else
         DBCSR_ABORT("mp_irecv called in non parallel case")
         MARK_USED(msgout)
         MARK_USED(source)
         MARK_USED(comm)
         MARK_USED(request)
         MARK_USED(tag)
         request = mp_request_null
#endif
         CALL timestop(handle)
      END SUBROUTINE mp_irecv_zv