MATLAB: How to increase the number of workers used for Parpool jobs in the MATLAB Parallel Server cluster

MATLAB Parallel Server

I am using MATLAB Parallel Server with a cluster that has more than 12 available workers. When I run my parpool (parallel pool) job, only 12 workers are initialized. How can I increase the number of workers that are used in the parpool job?

Best Answer

There are two ways to increase the amount of workers that are used in a parpool job beyond the default limit, which is 12.
You can change the default amount of parpool workers through the Parallel Pool Preferences menu in the MATLAB graphical interface. Look for the parallel pool icon at the very bottom left of the MATLAB window. The icon is small four vertical bars. Click this icon, then select 'Parallel preferences'.
In the preferences menu, change the value of 'Preferred number of workers in a parallel pool'. The default is 12.
Alternatively, you can override this preference by defining the number of workers you would like to use when you run the parpool function. The format for the command is:
parpool('profile',#workers)
For example:
parpool('cluster1',16)
This will initialize a parpool job using the cluster1 cluster profile, using 16 workers. This overrides the value in the Parallel Preferences menu.
NOTE: Starting in R2019a the following name changes occurred: * MATLAB Distributed Computing Server was renamed to MATLAB Parallel Server * mdce_def was renamed to mjs_def * mdce binary was renamed to mjs