MATLAB compiler/runtime & multiple processes (Windows x64)
12 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(2 个)
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.
0 个评论
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!