Why is a multithreaded mex function slower when I used a parallel pool?
显示 更早的评论
When I run a multithreaded mex function after having used a parallel pool, my function runs a lot slower (10-20x slowdown). Also, the more threads, the slower the function becomes.
Shutting down the pool does not help.
Rebooting Matlab restores the original speed (and scalability) of the mex Function.
4 个评论
Walter Roberson
2015-11-27
Have you closed the parallel pool by the time you are running the mex, or is it still open?
Walter Roberson
2015-11-27
Potentially related question: http://uk.mathworks.com/matlabcentral/answers/257315-can-i-speed-up-big-matrix-operation-with-parallel-computing-toolbox
Bart Vermeulen
2016-1-15
Walter Roberson
2016-1-15
I have a vague memory that someone else might have reported something like this a few years ago, but I am not sure I could find the posting. This is something I would recommend creating a support case for.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Write C Functions Callable from MATLAB (MEX Files) 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!