The most commonly used means for message
passing in MPI is via intra-communicators. Intra-communicators contain an
instance of a group, contexts of communication for both point-to-point and
collective communication, and the ability to include virtual topology and
other attributes.
These features work as follows:
- Contexts provide the ability to have separate safe ``universes''
of message passing in MPI . A context is akin to an additional
tag that differentiates messages.
The system manages this differentiation process.
The use of separate communication
contexts by distinct libraries (or distinct library invocations)
insulates communication internal to the library execution from
external communication. This allows the invocation of the library even if
there are pending communications
on ``other'' communicators, and avoids the need to
synchronize entry or exit into library code. Pending point-to-point
communications are also guaranteed not to interfere with collective
communications within a single communicator.
- Groups define the participants in the communication (see above)
of a communicator.
- A virtual topology defines a special mapping of the ranks in a
group to and from a topology. Special constructors for
communicators are defined in chapter 6 to provide
this feature. Intra-communicators as described in this chapter do
not have topologies.
- Attributes define the local information that the user or
library has added to a communicator for later reference.
-
- Advice to users.
The current practice in many communication libraries is that there is
a unique, predefined communication universe that includes all
processes available when the parallel program is initiated; the processes are
assigned consecutive ranks. Participants in a point-to-point
communication are identified by their rank; a collective communication
(such as broadcast) always involves all processes. This practice can be
followed in MPI by using the predefined communicator
MPI_COMM_WORLD. Users who are satisfied with this practice
can plug in MPI_COMM_WORLD wherever a communicator argument
is required, and can consequently disregard the rest of this chapter.(End of advice to users.)
MPI-Standard for MARMOT