Error in Parallel Computing Toolbox on Matlab Runtime

I am trying to use the features of the Parallel Computing Toolbox inside a ctf package compiled with Production Server Compiler. The package then is called by a C++ code on a linux server.
The minimal example which fails is:
function parallel()
pool = parpool(5);
delete(pool);
end
The matlab API is intialized with these lines in C++:
std::vector<std::u16string> opts = {u"-startmsg", u"-nodisplay", u"-completemsg"};
auto application = matlab::cpplib::initMATLABApplication(matlab::cpplib::MATLABApplicationMode::OUT_OF_PROCESS, opts);
The script runs without a problem on my local Matlab. But when I run it in on the Matlab Runtime the Error is:
Starting parallel pool (parpool) using the 'local' profile ...
Error using parpool (line 113)
Parallel pool failed to start with the following error.
Error in parallel (line 2)
Caused by:
Error using parallel.internal.pool.InteractiveClient>iThrowWithCause (line 678)
Failed to start pool.
Error using parallel.Job/submit (line 351)
AppComponentUUID should not be empty
Parallel pool failed to start with the following error.
Can somebody tell me what is going wrong?
Matlab version: R2019a
Matlab Runtime version: R2019a

 採用された回答

Jasper Lammering
Jasper Lammering 2021 年 6 月 1 日

0 投票

The support answered me and told me that the problem was the MATLABApplicationMode I started the runtime with.
The solution is to start the runtime IN_PROCESS like this:
auto application = matlab::cpplib::initMATLABApplication(matlab::cpplib::MATLABApplicationMode::IN_PROCESS, opts);
The Parallel Computing Toolbox is currently not supported in OUT_OF_PROCESS mode as the support said.

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by