mp_isend_cm2 Subroutine

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

Non-blocking send of matrix data

Arguments

Type IntentOptional Attributes Name
complex(kind=real_4), DIMENSION(:, :), CONTIGUOUS :: msgin
integer, intent(in) :: dest
integer, intent(in) :: comm
integer, intent(out) :: request
integer, intent(in), optional :: tag

Contents

Source Code


Source Code

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

         COMPLEX(kind=real_4), DIMENSION(:, :), CONTIGUOUS   :: msgin
         INTEGER, INTENT(IN)                      :: dest, comm
         INTEGER, INTENT(out)                     :: request
         INTEGER, INTENT(in), OPTIONAL            :: tag

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

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

         ierr = 0
         CALL timeset(routineN, handle)

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

         msglen = SIZE(msgin, 1)*SIZE(msgin, 2)
         IF (msglen > 0) THEN
            CALL mpi_isend(msgin(1, 1), msglen, MPI_COMPLEX, dest, my_tag, &
                           comm, request, ierr)
         ELSE
            CALL mpi_isend(foo, msglen, MPI_COMPLEX, dest, my_tag, &
                           comm, request, ierr)
         END IF
         IF (ierr /= 0) CALL mp_stop(ierr, "mpi_isend @ "//routineN)

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