How to compile a deployable program with the Parallel Computing Toolbox included?

11 ビュー (過去 30 日間)
Chris Endemann
Chris Endemann 2016 年 6 月 10 日
回答済み: Harsheel 2016 年 6 月 14 日
Greetings,
I have found various links regarding this topic, but none seem to include the exact info that I am looking for, and are too outdated to post a follow-up. What I am trying to do is utilize a parfor loop within my compiled deployable code that gets sent to a cluster of linux servers for high throughput computing. My first question is how to go about compiling/installing the toolbox with my deployable code. I tried adding -a distcomp to the end of my mcc command (following this example: http://www.mathworks.com/matlabcentral/newsreader/view_thread/285133) but encountered compilation errors. Is this the right way to do it? I am thinking that I can just use parpool(feature('numcores')) once I get the toolbox included properly so that I can run a parfor loop based on whatever number of cores each comp has. Would that work? I've stumbled into articles talking about having to change the config file, but I honestly have no idea what that is talking about. Could someone point me in the right direction?

採用された回答

Harsheel
Harsheel 2016 年 6 月 14 日
For your use-case, you don't need to use the -a flag. MATLAB Compiler command mcc or the deploytool GUI will automatically figure out what dependencies from the Parallel Computing toolbox and/or other toolboxes need to be put in the executable. So if your file name is foo.m (that uses parfor) I'd simply execute:
>> mcc -mv foo.m

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by