We've described how point-to-point generally requires processes to know the source/destination and message identifying tag in order to successfully complete a message. However, MPI provides two wildcards that provide limited exceptions to this rule. A receive or probe call may use MPI_ANY_SOURCE in place of a process id to accept a message (with matching tag and data information) from any process. The reverse does not apply, and there is no MPI_ANY_DEST, so send calls must know where they are going. There is also a MPI_ANY_TAG wildcard, which allows a receiver to get any message from a particular sender instead of having to identify the particular message tag. Both wildcards can be used together if desired.

As with any feature, the programmer is advised to use wildcards carefully. It is tempting to simply use MPI_ANY_TAG everywhere in order to avoid keeping track of message ids, but this may introduce bugs and can certainly make debugging more complicated.

 
©   Cornell University  |  Center for Advanced Computing  |  Copyright Statement  |  Inclusivity Statement