Blocking Calls
MPI provides both blocking and nonblocking point-to-point communication:
- Blocking communication means that the process waits to ensure the message data have achieved a particular state before processing can continue.
- Nonblocking communication means that the processor merely requests to start an operation and continues processing.
A blocking call is "safer" in that it ensures the message data are ready to be used — read by the receiver or modified by the sender — once the call returns.
Blocking send or receive calls suspend execution of the process until the message buffer being sent/received is OK to use. In the case of a blocking send, this means that the data to be sent have been copied out of the send buffer (but not necessarily that the data have been received in the receiving task). The contents of the send buffer can thus be modified without affecting the message that is sent. Similarly, completion of a blocking receive implies that the data in the receive buffer are valid and ready to use.