comm_probe Subroutine

private subroutine comm_probe(comm, source, tag, status)

Blocking probe for incoming messages. Returns once a message matching (source, tag) is queued at the receiver — caller reads status%MPI_SOURCE and status%MPI_TAG to decide who’s talking and what kind of message it is, then issues the matching recv. Use MPI_ANY_SOURCE / MPI_ANY_TAG to dispatch on whichever rank speaks first.

Arguments

Type IntentOptional Attributes Name
type(comm_t), intent(in) :: comm
integer(kind=int32), intent(in) :: source
integer(kind=int32), intent(in) :: tag
type(MPI_Status), intent(out) :: status

Calls

proc~~comm_probe~~CallsGraph proc~comm_probe comm_probe mpi_probe mpi_probe proc~comm_probe->mpi_probe

Called by

proc~~comm_probe~~CalledByGraph proc~comm_probe comm_probe interface~probe probe interface~probe->proc~comm_probe

Variables

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

Source Code

   subroutine comm_probe(comm, source, tag, status)
      !! Blocking probe for incoming messages.  Returns once a message
      !! matching `(source, tag)` is queued at the receiver — caller
      !! reads `status%MPI_SOURCE` and `status%MPI_TAG` to decide who's
      !! talking and what kind of message it is, then issues the
      !! matching `recv`.  Use `MPI_ANY_SOURCE` / `MPI_ANY_TAG` to
      !! dispatch on whichever rank speaks first.
      type(comm_t), intent(in) :: comm
      integer(int32), intent(in) :: source
      integer(int32), intent(in) :: tag
      type(MPI_Status), intent(out) :: status
      integer(int32) :: ierr

      call MPI_Probe(source, tag, comm%m_comm, status, ierr)
   end subroutine comm_probe