What is the difference between a communicator and a group in MPI?

Rohit Banga picture Rohit Banga · Apr 15, 2010 · Viewed 8.5k times · Source

I have read the definitions of these terms and my interpretation is that there is a one to one relation between a group and a communicator. A group is a set of processes which wish to communicate with each other and a communicator is an implementation for a group.

Is this correct? Why have two different terms if this is so?

Answer

David Glaubman picture David Glaubman · May 4, 2010

A group is an ordered set of process identifiers (MPI 2.2 spec, sec 6.2.1). The ordering is given by associating with each process identifier a unique rank from 0 to group.size - 1.

A communicator encapsulates all communication among a set of processes. An intra-communicator is associated with a group as well as contexts of communication for both point-to-point and collective communication and possibly other context information such as virtual topologies (spec, 6.1.2). An inter-communicator is associated with two non-overlapping groups.

I (probably very loosely) think of a communicator's group as its symbol table.

A group may contain process identifiers from several communicators.

Finally, construction of and operations on groups are local to the process, and do not involve interprocess communication. This is not, in general, true for communicators (by their very nature).