mp_irecv_im2 Subroutine

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

Non-blocking receive of matrix data

Arguments

Type IntentOptional Attributes Name
integer(kind=int_4), DIMENSION(:, :), CONTIGUOUS :: msgout
integer, intent(in) :: source
integer, intent(in) :: comm
integer, intent(out) :: request
integer, intent(in), optional :: tag

Contents

Source Code


Source Code

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

         INTEGER(KIND=int_4), DIMENSION(:, :), CONTIGUOUS   :: msgout
         INTEGER, INTENT(IN)                      :: source, comm
         INTEGER, INTENT(out)                     :: request
         INTEGER, INTENT(in), OPTIONAL            :: tag

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

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

         ierr = 0
         CALL timeset(routineN, handle)

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

         msglen = SIZE(msgout, 1)*SIZE(msgout, 2)
         IF (msglen > 0) THEN
            CALL mpi_irecv(msgout(1, 1), msglen, MPI_INTEGER, source, my_tag, &
                           comm, request, ierr)
         ELSE
            CALL mpi_irecv(foo, msglen, MPI_INTEGER, source, my_tag, &
                           comm, request, ierr)
         END IF
         IF (ierr /= 0) CALL mp_stop(ierr, "mpi_irecv @ "//routineN)

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