## Message-Passing Functions

Parallel Computing Toolbox functions provide access to message-passing routines available in Message Passing Interface (MPI-2) implementations.

We recommend using the higher-level constructs, distributed arrays and parallel loops, for easy-to–understand, maintainable code. You should use the message functions when you want to have very fine control over your parallelization scheme. While using these functions, you bear the responsibility of managing the synchronization between sections of your algorithm.

Functions for send, receive, broadcast, barrier, and probe operations are available in the toolbox. Message-passing functions in the toolbox provide an abstract of several complex details, which makes them easy to use. The same set of functions applies to all MATLAB data types, including structures and cell arrays, without any special setup. Deadlock detection capability helps timely identification of mismatched send-receive calls, potentially saving time that would be spent on these hard-to-debug problems. As with distributed arrays and related parallel functions, message passing functions can also be used with spmd statements

Parallel Computing Toolbox simplifies parallel programming that uses message passing. Without any additional setup, you can use the same set of functions for exchanging any MATLAB data type. Click on image to see enlarged view.