MATLAB: Is it possible to use PARFOR in a compiled application on the parallel configuration

MATLAB Compilermdcsparallelparfor

I would like to know if it is possible to compile an application that uses PARFOR and is to be run on parallel configurations other than local.

Best Answer

Applications using PARFOR can be compiled to run on parallel configurations other than local. Parallel configuration information can be stored in a MAT file. This MAT file can be included with the executable at compile time, or provided with the option -MCRUSERDATA at runtime (see detailed information further below).
You can find instructions on how to export a MAT file containing the parallel configuration information at the following link:
Compile and Deploy a Standalone Application with the Parallel Computing Toolbox
In order to be able to run the standalone on a target machine and have it use the cluster, the MATLAB Distributed Computing Server (MDCS) is required.
Once the executable and the MAT file have been given to the end user, the user can make use of the cluster by calling the executable with the -MCRUSERDATA flag as in the following code:
parallelapp.exe -mcruserdata ParallelConfigurationFile:config.mat
The documentation for what needs to occur on the user's end is discussed at the following link: