Inter-Communication

Inter-Communication


Up: Groups, Contexts, and Communicators Next: Inter-communicator Accessors Previous: Library Example #2

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:

  • The syntax of point-to-point communication is the same for both inter- and intra-communication. The same communicator can be used both for send and for receive operations.

  • A target process is addressed by its rank in the remote group, both for sends and for receives.

  • Communications using an inter-communicator are guaranteed not to conflict with any communications that use a different communicator.

  • An inter-communicator cannot be used for collective communication.

  • A communicator will provide either intra- or inter-communication, never both.

The routine MPI_COMM_TEST_INTER may be used to determine if a communicator is an inter- or intra-communicator. Inter-communicators can be used as arguments to some of the other communicator access routines. Inter-communicators cannot be used as input to some of the constructor routines for intra-communicators (for instance, MPI_COMM_CREATE).


[] Advice to implementors.

For the purpose of point-to-point communication, communicators can be represented in each process by a tuple consisting of:

group
send_context
receive_context
source

For inter-communicators, group describes the remote group, and source is the rank of the process in the local group. For intra-communicators, group is the communicator group (remote=local), source is the rank of the process in this group, and send context and receive context are identical. A group is represented by a rank-to-absolute-address translation table.

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

  • .group describes the group and .group describes the group .
  • .send_context = .receive_context and the context is unique in ;
    .receive_context = .send_context and this context is unique in .
  • .source is rank of P in and .source is rank of Q in .

Assume that P sends a message to Q using the inter-communicator. Then P uses the group table to find the absolute address of Q; source and send_context are appended to the message.

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.)



Up: Groups, Contexts, and Communicators Next: Inter-communicator Accessors Previous: Library Example #2


Return to MPI Standard Index
Return to MPI home page