MATLAB compiler/runtime & multiple processes (Windows x64)

조회 수: 11 (최근 30일)
Gabriel
Gabriel 2011년 1월 20일
I'm using the Optimization Toolbox (fmincon) to prototype a non-linear model fitting algorithm. I need to integrate the solution into a compiled Windows x64 application (image processing & measurement software), and one option is to use the MATLAB compiler to generate a library that can be linked into the application (other option is to port the algorithm to some other optimization library).
The software will perform MANY of these model fits in a batch, and currently uses a multi-threaded design to process measurement tasks in parallel (one processing thread for each CPU core).
I've been told (by tech support) that the MATLAB runtime will serialize calls to fmincon, so running the algorithm on multiple threads will not run in parallel.
My question is: Will the MATLAB runtime run in parallel if it's loaded on separate processes? If so I'm thinking of changing the application to create multiple processes, each of which could load the MATLAB runtime and process model fits in parallel.
NOTE: I've already considered using the Parallel Toolbox. It doesn't really help for this problem.

답변 (2개)

Shaf
Shaf 2011년 1월 20일
The MATLAB runtime will run in parallel if loaded in separate processes. There is a single MATLAB interpreter thread per process. So for separate processes the interpreter threads will work in parallel.

Todd Flanagan
Todd Flanagan 2011년 1월 20일
Calls into a shared library are serialized from the host application. This doesn't always mean there is no parallelism.
The MATLAB Compiler will perform the same as it would in MATLAB. Some functions use multiple cores when used in MATLAB. Those function will still use multiple cores when compiled.
It sounds like you require additional parallelism in your compiled application. If this is true, you may want to consider separate processes. Compiled applications will run in parallel if loaded into different processes.

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by