This section introduces the concept of inter-communication and describes the portions of MPI that support it. It describes support for writing programs that contain user-level servers.
All point-to-point communication described thus far has involved communication between processes that are members of the same group. This type of communication is called ``intra-communication'' and the communicator used is called an ``intra-communicator,'' as we have noted earlier in the chapter.
In modular and multi-disciplinary applications, different process groups execute distinct modules and processes within different modules communicate with one another in a pipeline or a more general module graph. In these applications, the most natural way for a process to specify a target process is by the rank of the target process within the target group. In applications that contain internal user-level servers, each server may be a process group that provides services to one or more clients, and each client may be a process group that uses the services of one or more servers. It is again most natural to specify the target process by rank within the target group in these applications. This type of communication is called ``inter-communication'' and the communicator used is called an ``inter-communicator,'' as introduced earlier.
An inter-communication is a point-to-point communication between processes in different groups. The group containing a process that initiates an inter-communication operation is called the ``local group,'' that is, the sender in a send and the receiver in a receive. The group containing the target process is called the ``remote group,'' that is, the receiver in a send and the sender in a receive. As in intra-communication, the target process is specified using a (communicator, rank) pair. Unlike intra-communication, the rank is relative to a second, remote group.
All inter-communicator constructors are blocking and require that the local and remote groups be disjoint in order to avoid deadlock.
Here is a summary of the properties of inter-communication and inter-communicators:
[] Advice
to implementors.
For the purpose of point-to-point communication, communicators can be represented in each process by a tuple consisting of:
The inter-communicator cannot be discussed sensibly without considering processes in both the local and remote groups. Imagine a process P in group , which has an inter-communicator , and a process Q in group , which has an inter-communicator . Then
Assume that Q posts a receive with an explicit source argument using the inter-communicator. Then Q matches receive_context to the message context and source argument to the message source.
The same algorithm is appropriate for intra-communicators as well.
In order to support inter-communicator accessors and constructors, it
is necessary to supplement this model with additional structures, that
store information about the local communication group, and additional
safe contexts.
( End of advice to implementors.)