comm_irecv_real_dp_array_2d Subroutine

private subroutine comm_irecv_real_dp_array_2d(comm, data, source, tag, request)

Non-blocking receive of a 2D allocatable double precision real array

Arguments

Type IntentOptional Attributes Name
type(comm_t), intent(in) :: comm
real(kind=dp), intent(inout), allocatable :: data(:,:)
integer(kind=int32), intent(in) :: source
integer(kind=int32), intent(in) :: tag
type(request_t), intent(out) :: request

Calls

proc~~comm_irecv_real_dp_array_2d~~CallsGraph proc~comm_irecv_real_dp_array_2d comm_irecv_real_dp_array_2d mpi_irecv mpi_irecv proc~comm_irecv_real_dp_array_2d->mpi_irecv mpi_recv mpi_recv proc~comm_irecv_real_dp_array_2d->mpi_recv

Called by

proc~~comm_irecv_real_dp_array_2d~~CalledByGraph proc~comm_irecv_real_dp_array_2d comm_irecv_real_dp_array_2d interface~irecv irecv interface~irecv->proc~comm_irecv_real_dp_array_2d

Variables

Type Visibility Attributes Name Initial
integer(kind=int32), private :: dim1
integer(kind=int32), private :: dim2
integer(kind=int32), private :: ierr

Source Code

   subroutine comm_irecv_real_dp_array_2d(comm, data, source, tag, request)
   !! Non-blocking receive of a 2D allocatable double precision real array
      type(comm_t), intent(in) :: comm
      real(dp), intent(inout), allocatable :: data(:, :)
      integer(int32), intent(in) :: source
      integer(int32), intent(in) :: tag
      type(request_t), intent(out) :: request
      integer(int32) :: ierr, dim1, dim2

      ! Receive dimensions first (blocking - needed to allocate)
      call MPI_Recv(dim1, 1, MPI_INTEGER, source, tag, comm%m_comm, MPI_STATUS_IGNORE, ierr)
      call MPI_Recv(dim2, 1, MPI_INTEGER, source, tag, comm%m_comm, MPI_STATUS_IGNORE, ierr)

      ! Allocate array with received dimensions
      if (.not. allocated(data)) then
         allocate (data(dim1, dim2))
      end if

      ! Receive data (non-blocking)
      call MPI_Irecv(data, dim1*dim2, MPI_DOUBLE_PRECISION, source, tag, comm%m_comm, request%m_request, ierr)
      request%is_valid = .true.
   end subroutine comm_irecv_real_dp_array_2d