'parpool' fails in deployed application

I am building a parallel for loop (parfor) based deployed application. I have a parpool command before the parfor loop:
parpool('local', 4);
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.

댓글 수: 5

Nikilesh Chilkuru
Nikilesh Chilkuru 2018년 11월 1일
Can you tell me: 1) Which version of Matlab are you using? 2) Are you trying to run the deployed application on the same system?
Vinayak Phalke
Vinayak Phalke 2018년 11월 1일
MATLAB version is 2018a. The build computer and deployed computer (where the app is run) are two differing ones.
Kevin Chng
Kevin Chng 2018년 11월 1일
What is your deployed application?MATLAB executable file?
I think you might need to set your parpool profile
However, in documentation, it is for MATLAB Compiler SDK.
Hi Nikilesh Chilkuru,
I would like to know that does MATLAB compiler need to do the same way?
Vinayak Phalke
Vinayak Phalke 2018년 11월 2일
Based on your suggestion, I saved my local profile (local.settings) and bundled that file in the deployed app. That seems to have fixed this issue. Thanks
Kevin Chng
Kevin Chng 2018년 11월 8일
Great. That's mean for MATLAB compiler, it need to do the same way as MATLAB Compiler SDK.

댓글을 달려면 로그인하십시오.

답변 (4개)

Kevin Chng
Kevin Chng 2018년 11월 8일

1 개 추천

To use parallel computing for standalone application (MATLAB Compiler SDK/MATLAB Compiler) , you may need to configure/change your code as below:
Kristoffer Walker
Kristoffer Walker 2019년 6월 26일
편집: Kristoffer Walker 2019년 6월 26일

0 개 추천

Folks,
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.
Kris

댓글 수: 3

Kevin Chng
Kevin Chng 2019년 6월 26일
Hi Kris,
No worries, I think it is working with different PC up to 512 cores, provided it is utilizing the local computing resources. Not cloud/server resources (MATLAB Parallel Server).
How to get the setting files from local profile?
On top of your tab (Home>Parallel>Export)
reply.png
Then you will get the setting file.
Kristoffer Walker
Kristoffer Walker 2019년 6월 27일
편집: Kristoffer Walker 2019년 6월 27일
Hi Kevin,
By the way, is there a way to have Matlab email me when someone has commented on a post I create? I don't seem to have that option turned on and I'd like to.
I am not using the Matlab Parallel Server. I just have a GUI that has a number of threads parameter. The callback on the nThreads parameter executes a parpool. The problem is that for some choices of nThreads (still below the max number of threads available to Matlab), the deployed version of the GUI will "beep" during the callback. The non-deployed version will not beep. No console errors are observed however. I interpret the beep to be due to parpool encoutering an issue. However, it still registers as reserving the correct number of threads. The callback is extremely simple:
function nThreads_Callback(hObject, eventdata, handles)
% hObject handle to nThreads (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
set(handles.Wavefield,'enable','off');
numCores = str2double(get(hObject, 'string'));
delete(gcp('nocreate'));
if (numCores > 1)
f = waitbar(0,'Creating parallel processing thread pool...');
parpool('local', numCores);
waitbar(0.5, f, 'Creating parallel processing thread pool...');
waitbar(1, f, 'Creating parallel processing thread pool...');
close(f);
end
set(handles.Wavefield,'enable','on');
Kevin Chng
Kevin Chng 2019년 6월 28일
Hi Kris,
Let me provide some documentation here for your reading:
Similar question has been asked in the past:
I tried it before personally, it is working for deployed application. For your question about :
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.
Frankly speaking, i'm not sure about it, but i think the local setting file should working for different machine.
Untitled.png
follow the documentation to get your local pc work with your deployed standalone application with parallel computing first.
later, we can try to execute the standalone application in different pc. I think it should be working. Let me know, i'm interested to know it as well.
If you still encouter any issue, let me know, then i try spend some time to try it out.

댓글을 달려면 로그인하십시오.

Kristoffer Walker
Kristoffer Walker 2019년 7월 1일
편집: Kristoffer Walker 2019년 7월 1일

0 개 추천

Hi Kevin,
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).
Kris
Stefanie Schwarz
Stefanie Schwarz 2022년 8월 9일

0 개 추천

See the MATLAB Answers post below - it could also just be a problem of running the executable against an incorrect version of MATLAB Runtime:

카테고리

도움말 센터File Exchange에서 Parallel Computing Fundamentals에 대해 자세히 알아보기

태그

질문:

2018년 10월 29일

답변:

2022년 8월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by