User`s guide
2 Parallel for-Loops (parfor)
2-46
To open a parallel pool based on your preference settings:
parpool
To open a pool of a specific size:
parpool(4)
To use a cluster other than your default, to specify where the pool runs:
parpool('MyCluster',4)
Shut Down a Parallel Pool
You can get the current parallel pool, and use that object when you want to shut down
the pool:
p = gcp;
delete(p)
Pool Size and Cluster Selection
There are several places to specify your pool size. Several factors might limit the size of
your pool. The actual size of your parallel pool is determined by the combination of the
following:
1
Licensing or cluster size
The ultimate limit on the number of workers in a pool is restricted to the number
of workers in your cluster. This might be determined by the number of MATLAB
Distributed Computing Server licenses available, or in the case of MJS by the
number of workers running in the cluster. A local cluster running on the client
machine requires no licensing beyond the one for Parallel Computing Toolbox, and
the limit on the number or workers is high enough to support the range of known
desktop hardware.
2
Cluster profile number of workers (NumWorkers)
A cluster object can set a hard limit on the number of workers, which you can set in
the cluster profile. Even if you request more workers at the command line or in your
preferences, you cannot exceed the limit set in the applicable profile. Attempting to
exceed this number generates an error.
3
Command-line argument