mp_isend_lv Subroutine

private subroutine mp_isend_lv(msgin, dest, comm, request, tag)

Non-blocking send of vector data

Note

see mp_isendrecv_lv

Note

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

Arguments

Type IntentOptional Attributes Name
integer(kind=int_8), CONTIGUOUS, DIMENSION(:) :: msgin
integer, intent(in) :: dest
type(mp_comm_type), intent(in) :: comm
type(mp_request_type), intent(out) :: request
integer, intent(in), optional :: tag

Source Code

      SUBROUTINE mp_isend_lv(msgin, dest, comm, request, tag)
      !! Non-blocking send of vector data
      !! @note see mp_isendrecv_lv
      !! @endnote
      !! @note
      !! arrays can be pointers or assumed shape, but they must be contiguous!

         INTEGER(KIND=int_8), CONTIGUOUS, DIMENSION(:)      :: msgin
         INTEGER, INTENT(IN)                      :: dest
         TYPE(mp_comm_type), INTENT(IN)           :: comm
         TYPE(mp_request_type), INTENT(out)       :: request
         INTEGER, INTENT(in), OPTIONAL            :: tag

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

         INTEGER                                  :: handle, ierr
#if defined(__parallel)
         INTEGER                                  :: msglen, my_tag
         INTEGER(KIND=int_8)                                :: foo(1)
#endif

         ierr = 0
         CALL timeset(routineN, handle)

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

         msglen = SIZE(msgin)
         IF (msglen > 0) THEN
            CALL mpi_isend(msgin, msglen, MPI_INTEGER8, dest, my_tag, &
                           comm%handle, request%handle, ierr)
         ELSE
            CALL mpi_isend(foo, msglen, MPI_INTEGER8, dest, my_tag, &
                           comm%handle, request%handle, ierr)
         END IF
         IF (ierr /= 0) CALL mp_stop(ierr, "mpi_isend @ "//routineN)

         CALL add_perf(perf_id=11, msg_size=msglen*int_8_size)
#else
         MARK_USED(msgin)
         MARK_USED(dest)
         MARK_USED(comm)
         MARK_USED(request)
         MARK_USED(tag)
         ierr = 1
         request = mp_request_null
         CALL mp_stop(ierr, "mp_isend called in non parallel case")
#endif
         CALL timestop(handle)
      END SUBROUTINE mp_isend_lv