'parpool' fails in deployed application
조회 수: 14(최근 30일)
I am building a parallel for loop (parfor) based deployed application. I have a parpool command before the parfor loop:
parfor a = 1:N ....
The code works within MATLAB, but in the deployed application, it errors out at the parpool line:
Error using parpool (line 113)
The specified superclass 'parallel.internal.customattr.CustomPropTypes' contains a parse error,
cannot be found on MATLAB's search path, or is shadowed by another file with the same name.
Kevin Chng 2018년 11월 8일
To use parallel computing for standalone application (MATLAB Compiler SDK/MATLAB Compiler) , you may need to configure/change your code as below:
Kristoffer Walker 2019년 6월 26일
편집: Kristoffer Walker 2019년 6월 26일
It would be great if this answer could be improved. I am having this issue now I believe, but I do not understand what a "local profile" is, how to generate such a settings file, and why I should bundle it for deployment in a completely different remote machine that will have a different number of cores and may not share any similarities with the local profile that was deployed with it. I have read the website links above.
Kristoffer Walker 2019년 7월 1일
편집: Kristoffer Walker 2019년 7월 1일
So I've looked more carefully at this and created a simple example to demo the problem. Just create a script "testApp.m". Include in it a call to function testAppFunc(), which inside it only does a "parpool(2)". Put some fprintf statements in there for correlation purposes. Then compile it with Application Compiler and test the testApp.exe in for_redistribution_files_only directory by launching from a PowerShell. You will hear the beep. Why does this happen and how can I stop it? This only happens the first time parpool is executed from a deployed app. It does not happen during subsequent calls to parpool in the same instance of the deployed app. It also does not happen in the non-deployed app at any time.
BTW, saving the settings.local file did not help (but thanks for those links to the instructions).
Stefanie Schwarz 2022년 8월 9일
See the MATLAB Answers post below - it could also just be a problem of running the executable against an incorrect version of MATLAB Runtime: