User`s guide
5 Math with Codistributed Arrays
5-2
Nondistributed Versus Distributed Arrays
In this section...
“Introduction” on page 5-2
“Nondistributed Arrays” on page 5-2
“Codistributed Arrays” on page 5-4
Introduction
All built-in data types and data structures supported by MATLAB software are also
supported in the MATLAB parallel computing environment. This includes arrays of any
number of dimensions containing numeric, character, logical values, cells, or structures;
but not function handles or user-defined objects. In addition to these basic building
blocks, the MATLAB parallel computing environment also offers different types of arrays.
Nondistributed Arrays
When you create a nondistributed array, MATLAB constructs a separate array in the
workspace of each worker, using the same variable name on all workers. Any operation
performed on that variable affects all individual arrays assigned to it. If you display from
worker 1 the value assigned to this variable, all workers respond by showing the array of
that name that resides in their workspace.
The state of a nondistributed array depends on the value of that array in the workspace
of each worker:
• “Replicated Arrays” on page 5-2
• “Variant Arrays” on page 5-3
• “Private Arrays” on page 5-3
Replicated Arrays
A replicated array resides in the workspaces of all workers, and its size and content are
identical on all workers. When you create the array, MATLAB assigns it to the same
variable on all workers. If you display in spmd the value assigned to this variable, all
workers respond by showing the same array.
spmd, A = magic(3), end