MPI_PROBE, MPI_Probe Purpose Waits until a message matching source, tag, and comm arrives. C synopsis #include int MPI_Probe(int source,int tag,MPI_Comm comm,MPI_Status *status); C++ synopsis #include mpi.h void MPI::Comm::Probe(int source, int tag) const; #include mpi.h void MPI::Comm::Probe(int source, int tag, MPI::Status& status) const; FORTRAN synopsis include 'mpif.h' or use mpi MPI_PROBE(INTEGER SOURCE,INTEGER TAG,INTEGER COMM, INTEGER STATUS(MPI_STATUS_SIZE),INTEGER IERROR) Description MPI_PROBE behaves like MPI_IPROBE. It lets you check for an incoming message without actually receiving it. MPI_PROBE is different in that it is a blocking call that returns only after a matching message has been found. Passing MPI_STATUS_IGNORE for the status argument causes PE MPI to skip filling in the status fields. By passing this value for status, you can avoid having to allocate a status object in programs that do not need to examine the status fields. Parameters source is a source rank or MPI_ANY_SOURCE (integer) (IN) tag is a source tag or MPI_ANY_TAG (positive integer) (IN) comm is a communicator (handle) (IN) status is a status object (Status) (INOUT). Note that in FORTRAN a single status object is an array of integers. IERROR is the FORTRAN return code. It is always the last argument. Notes In a threads environment, MPI_PROBE or MPI_IPROBE followed by MPI_RECV, based on the information from the probe, may not be a thread-safe operation. You must make sure that no other thread received the detected message. An MPI_IPROBE cannot prevent a message from being cancelled successfully by the sender, making it unavailable for the MPI_RECV. Structure your program so this will not occur. Errors Invalid source source < 0 or source > = groupsize Invalid status ignore value Invalid tag tag < 0 Invalid communicator MPI not initialized MPI already finalized Related information MPI_IPROBE MPI_RECV