How to change NumWorkers property in compiled applications?

99 views (last 30 days)
Georg
Georg on 23 Sep 2016
Answered: Georg on 26 Sep 2016
Hi!
using the MATLAB compiler I created a standalone executable from a script that uses a parallel pool. It works fine with 6 workers before the compilation (2016a) but I experience problems on another computer where I installed the corresponding MCR (9.0.1 running on a Linux system). There the executable works only with a maximum of 3 workers. Is there a way to increase the number of workers for compiled executables? I get the following error message:
"Starting parallel pool (parpool) using the 'local' profile ... Error using parpool (line 103) You requested a minimum of 6 workers, but the cluster "local" has the NumWorkers property set to allow a maximum of 3 workers. To run a communicating job on more workers than this (up to a maximum of 512 for the Local cluster), increase the value of the NumWorkers property for the cluster. The default value of NumWorkers for a Local cluster is the number of cores on the local machine."
Regards, Georg

Accepted Answer

michio
michio on 24 Sep 2016
Increasing the number of workers above the available physical cores is not highly recommended. Having said that, this doc page could be of your help.
You need to create a new Parallel Computing Toolbox profile (by default MATLAB uses local profile) and exported it. I think you can pass the profile at run time, or embed the profile to the compiled application.
Hope it helps :)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!