Version 2 (modified by 12 years ago) ( diff ) | ,
---|
Blocking Functions
In interprocess communication terms, a process blocks when it does not finish executing until a particular condition is met. The process sits in a tight loop, periodically checking to see if its break condition has been met. The break condition is normally generated by some other process, usually in the form of a signal packet or a modification to some shared memory. A function that uses some kind of blocking code is often referred to as a blocking function or blocking call, because it does not return until its condition is met.
The MPI Library uses this principle to control the execution of a distributed program. Blocking function calls are used to prevent individual processors from resuming execution until the other processors are all caught up with them. For instance, a call to MPI_Recv()
blocks until the processor has received the requested data. Once the data is received, MPI_Recv()
returns and the calling process can resume executing. Some of the sending calls can block as well; MPI_Ssend()
, for instance, blocks until the buffer on the sender is cleared and the receiver has started to receive the message. The blocking MPI functions can be used to keep the processors used in mpibear
very tightly synchronized.