When two unrelated programs both use TCP on the same machine, their traffic doesn't collide: each connection is scoped by port numbers that distinguish one stream from another. MPI uses a communicator for the same purpose. A communicator is a group of processes combined with a context that scopes all message traffic: a message sent on one communicator cannot be received on a different communicator, even between the same pair of ranks with the same tag. MPI_COMM_WORLD is the default communicator that includes every process launched by mpirun. Within a communicator, each process has a rank (0 to N-1) and the total count is the size.
MPI_Comm_split partitions an existing communicator into sub-communicators. Each process passes a color to determine which group it joins and a key to control rank ordering within the new group. Processes with the same color end up in the same new communicator. This is useful for creating communicators that span a single node, a single row of a process grid, or any other subset.
int color = rank % 2; // even and odd ranks form separate communicators MPI_Comm half; MPI_Comm_split(MPI_COMM_WORLD, color, rank, &half); // use half... MPI_Comm_free(&half);