comm_send_real_sp_array_2d Subroutine

private subroutine comm_send_real_sp_array_2d(comm, data, dest, tag)

Blocking send of a 2D single-precision real array to specified destination

Arguments

Type IntentOptional Attributes Name
type(comm_t), intent(in) :: comm
real(kind=sp), intent(in) :: data(:,:)
integer(kind=int32), intent(in) :: dest
integer(kind=int32), intent(in) :: tag

Calls

proc~~comm_send_real_sp_array_2d~~CallsGraph proc~comm_send_real_sp_array_2d comm_send_real_sp_array_2d mpi_send mpi_send proc~comm_send_real_sp_array_2d->mpi_send

Called by

proc~~comm_send_real_sp_array_2d~~CalledByGraph proc~comm_send_real_sp_array_2d comm_send_real_sp_array_2d interface~send send interface~send->proc~comm_send_real_sp_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_send_real_sp_array_2d(comm, data, dest, tag)
   !! Blocking send of a 2D single-precision real array to specified destination
      type(comm_t), intent(in) :: comm
      real(sp), intent(in) :: data(:, :)
      integer(int32), intent(in) :: dest
      integer(int32), intent(in) :: tag
      integer(int32) :: ierr, dim1, dim2

      ! Send dimensions first
      dim1 = size(data, 1)
      dim2 = size(data, 2)
      call MPI_Send(dim1, 1, MPI_INTEGER, dest, tag, comm%m_comm, ierr)
      call MPI_Send(dim2, 1, MPI_INTEGER, dest, tag, comm%m_comm, ierr)

      ! Send data
      call MPI_Send(data, size(data), MPI_REAL, dest, tag, comm%m_comm, ierr)
   end subroutine comm_send_real_sp_array_2d