MATLAB: Can compiled MATLAB standalone make use of MDCS

compiledMATLAB CompilerMATLAB Parallel ServermdcsParallel Computing Toolboxparforstandaloneworker

As above, can a compiled MATLAB standalone application (.exe) coded with parfor loop, make use of MATLAB Distributed Computing Server workers?
If yes, how do i configure the application to do so? Thanks!

Best Answer

Since R2008b applications deployed using the MATLAB compiler can access a cluster running MATLAB Distributed Computing Server.
The documentation has information and examples: http://www.mathworks.com/help/toolbox/compiler/f12-999353.html#br2jauc-47, but a quick example might look like this
function my_compiled_app
% Open a matlabpool on the cluster defined
% by the 'my_cluster' configuration
matlabpool('open', 4, 'my_cluster');
% Run a parfor loop on the cluster
parfor i = 1:10
disp(i)
end
% Close the pool
matlabpool('close');
end
Compile the application using mcc
>> mcc -m my_compiled_app
And the run it - this should open a matlabpool on the cluster, and show the parfor running
C:\Work> my_compiled_app.exe