Error in Parallel Computing Toolbox on Matlab Runtime

9 vues (au cours des 30 derniers jours)
Jasper Lammering
Jasper Lammering le 19 Mai 2021
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

Réponse acceptée

Jasper Lammering
Jasper Lammering le 1 Juin 2021
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.

Plus de réponses (0)

Catégories

En savoir plus sur Deploy to C++ Applications Using mwArray API (C++03) dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by