Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Since communication is expensive, the fewer messages sent, the better your program performance will be. With this in mind, MPI provides several ways of packaging data. This allows you to maximize the amount of information exchanged in each message. There are three basic strategies.
Although we glossed over it, you've already seen one technique. You'll recall that the messaged package in MPI_Send consists of a buffer address, a count, and a data type. Clearly, this mechanism can be used to send multiple pieces of information as a single message, provided they are of the same type. For example, in our first interactive version of the numerical integration program, three calls to MPI_Send were used to distribute the values of numberRects, lowerLimit, upperLimit to all the processes.