Distributed Arrays - MATLAB & Simulink (original) (raw)
Main Content
Analyze big data sets in parallel using distributed arrays and simultaneous execution
Parallel Computing Toolbox™ supports distributed arrays to partition large arrays across multiple MATLAB® workers. You operate on the entire array as a single entity, however, workers operate only on their part of the array, and automatically transfer data between themselves when necessary. Simultaneous execution is supported by the single program multiple data (spmd
) language construct to facilitate communication between workers. Use distributed-enabled matrix operations and functions to work directly with these arrays without further modification. You can use distributed arrays in Parallel Computing Toolbox to run big data applications using the combined memory of your cluster.
Functions
distributed | Create and access elements of distributed arrays from client |
---|---|
gather | Transfer distributed array, Composite object, orgpuArray object to local workspace |
spmd | Execute code in parallel on workers of parallel pool |
Composite | Create and access nondistributed variables on multiple workers from client |
parallel.pool.Constant | Build and use constant from data or function handle |
redistribute | Redistribute codistributed array with another distribution scheme |
codistributed | Access elements of arrays distributed among workers in parallel pool |
codistributor1d | 1-D distribution scheme for codistributed array |
codistributor2dbc | 2-D block-cyclic distribution scheme for codistributed array |
codistributed.build | Create codistributed array from distributed data |
for | for-loop over distributed range |
getLocalPart | Local portion of codistributed array |
globalIndices | Global indices for local part of codistributed array |
spmdReduce | Reduce arrays on spmd workers (Since R2022b) |
write | Write distributed data to an output location |
pagefun | Apply function to each page of distributed or GPU array |
Classes
Examples and How To
- Create and Use Distributed Arrays
When your data array is too big to fit into the memory of a single machine, you can create adistributed
array. - Run MATLAB Functions with Distributed Arrays
MATLAB functions that operate on distributed arrays. - Distributing Arrays to Parallel Workers
Usedatastore
ordistributed
to create distributed arrays and partition the data among your workers. - Run Single Programs on Multiple Data Sets
Usespmd
statements to run the same code on multiple datasets and control codistributed arrays. - Access Worker Variables with Composites
Composite objects in the MATLAB client session let you directly access data values on the workers. - Train Network in Parallel with Custom Training Loop (Deep Learning Toolbox)
This example shows how to set up a custom training loop to train a network in parallel. - Use spmdReduce to Achieve MPI_Allreduce Functionality
In this example, we look at thespmdReduce
function and the functions that build on it:spmdPlus
andspmdCat
. - Numerical Estimation of Pi Using Message Passing
This example shows the basics of working with spmd statements, and how they provide an interactive means of performing parallel computations. - Choose Between spmd, parfor, and parfeval
Compare and contrastspmd
against other parallel computing functionality such asparfor
andparfeval
.
Concepts
- Nondistributed Versus Distributed Arrays
Describes the various types of arrays used in communicating jobs. - Working with Codistributed Arrays
Describes how to use codistributed arrays for calculation. - Looping over a Distributed Range (for-drange)
Describes how to program afor
-loop with codistributed arrays. - Work with Remote Data
Work with remote data in Amazon S3™, Azure® Blob Storage, or HDFS™.