Point to Point Communication II

3.2 Status

status returns source, tag, error (standard)

Status is the object at which to look to determine information on the message source and tag, and any error incurred on the communication call. In Fortran these are returned as status(MPI_SOURCE), status(MPI_TAG), and status(MPI_ERROR) respectively. In C they are returned as status.MPI_SOURCE, status.MPI_TAG, and status.MPI_ERROR. In the case of sends, the status information is probably not different from what had been in the request, so is of little use.

  • MPI_Get_count returns number of elements

    This can be useful if you've allocated a receive buffer that may be larger than the incoming message, or if you want to learn the length of a message identified with MPI_Probe (S).

  • Circumstances in which it makes sense to check the status

    The information made available by status comes in very handy when dealing with the following situations, offered without discussion as the various particulars have already been covered elsewhere (except for MPI_ANY_TAG and MPI_ANY_SOURCE, which will be covered shortly):

    • blocking receive or wait, when MPI_ANY_TAG or MPI_ANY_SOURCE has been used

      • MPI_ANY_TAG, accept a message with any tag value

      • MPI_ANY_SOURCE, accept a message from any source

    • MPI_Probe or MPI_Iprobe to obtain information on incoming messages

      • MPI_Probe - Blocking test for a message

      • MPI_Iprobe - Nonblocking test for a message

    • MPI_Test to learn if the communication has completed