User`s guide

R2013b
4-2
parpool: New command-line interface (replaces matlabpool),
desktop indicator, and preferences for easier interaction with a parallel
pool of MATLAB workers
“Parallel Pool” on page 4-2
“New Desktop Pool Indicator” on page 4-3
“New Parallel Preferences” on page 4-4
Parallel Pool
Replaces MATLAB Pool
Parallel pool syntax replaces MATLAB pool syntax for executing parallel language
constructs such as parfor, spmd, Composite, and distributed. The pool is
represented in MATLAB by a parallel.Pool object.
The general workflow for these parallel constructs remains the same: When the pool is
available, parfor, spmd, etc., run the same as before. For example:
MATLAB Pool Parallel Pool
matlabpool open 4
parfor ii=1:n
X(n) = myFun(n);
end
matlabpool close
p = parpool(4)
parfor ii=1:n
X(n) = myFun(n);
end
delete(p)
Functions for Pool Control
The following functions provide command-line interface for controlling a parallel pool.
See the reference pages for more information about each.
Function Description
parpool Start a parallel pool
gcp Get current parallel pool or start pool
delete Shut down and delete the parallel pool
addAttachedFiles Attach files to the parallel pool
listAutoAttachedFiles List files automatically attached to the parallel pool
updateAttachedFiles Send updates to files already attached to the parallel pool