Summary

Now that we've covered all four of the available communication modes, it's useful to summarize the differences. The table below summarizes the key advantages and disadvantages of the four methods.

Comparison of the four communication modes.
ModeAdvantagesDisadvantages
Synchronous - Safest, therefore most portable
- No need for extra buffer space
- SEND/RECV order not critical
- Can incur substantial synchronization overhead
Ready - Lowest total overhead
- No need for extra buffer space
- SEND/RECV handshake not required
- RECV must precede SEND
Buffered - Decouples SEND from RECV
- no sync overhead on SEND
- Programmer can control size of buffer space
- SEND/RECV order irrelevant
- Copying to buffer incurs additional system overhead
Standard - Good for many cases
- Compromise position
- Protocol is determined by MPI implementation
Discussion

Synchronous mode is "safe" because it does not depend upon the order in which the send and receive are executed (like ready mode) or the amount of buffer space (like buffered mode). This safety makes it portable, meaning that if a code runs under one set of conditions — e.g., message size or architecture — it will run under all conditions. Synchronous mode can incur substantial synchronization overhead.

Ready mode has the lowest total overhead. It does not require a handshake between sender and receiver (like synchronous mode) or an extra copy to a buffer (like buffered or standard mode). However, the receive must precede the send. This mode will not be appropriate for all messages.

Buffered mode decouples the sender from the receiver by buffering the message on the sending side. This eliminates synchronization overhead on the sending task and ensures that the order of execution of the send and receive does not matter (unlike ready mode). An additional advantage is that the programmer can control the size of messages to be buffered and the total amount of buffer space. However, there is additional system overhead incurred by the copy to the buffer.

Standard mode behavior is implementation-specific. The library developer chooses a system behavior that provides good performance and reasonable safety. Most implementations take a compromise position between the above modes by using a two-tier strategy: a ready send to a system buffer on the receiving side for messages smaller than the cutoff limit and a synchronous send for larger messages. These behaviors are known as the eager and rendezvous protocols, respectively.

Finally, note that the function signatures do not require that the sender and receiver use the same communication and blocking types. Communication and blocking types can be strategically combined, as will be shown in the Avoiding Deadlocks page in Point-to-Point Usage and Strategies.

 
©  |   Cornell University    |   Center for Advanced Computing    |   Copyright Statement    |   Inclusivity Statement