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

Called by

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

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

      ! A single rank has no peer. Reaching this means the caller
      ! did not take its `size() == 1` path -- which is a bug worth
      ! stopping for, not one to hide by returning quietly.
      error stop "pic_mpi_serial: comm_probe needs a peer rank"
   end subroutine comm_probe