mpi affecting matlab execution speed

9 次查看(过去 30 天)
I am running matlab on a nice cluster that has 16 nodes, each with dual octocore Xeon E5-2670s.
I have noticed that some of my code runs a lot faster when the node is being used by a colleague who is running OpenMP processes. Does this make any sense?
The code in question spends most of its time in a mex function, which launches 2 or 3 threads each time it is called. When I run a piece of test code, the mex function is called 500 times.
This test code completes in about 0.3 seconds when OpenMP is being used, but if I run on another node that does not have any openMP processes, the same code takes 0.8 seconds.
Normally, code runs slower when the machine is running other stuff at the same time, but here it seems to run faster!
My conclusion is that the overhead of launching a pthread is somehow reduced, but I have no idea why this would be.
Anyone have some insight?
  1 个评论
Jed
Jed 2015-6-11
I found that this is not really a matlab issue at all... the code linked here that creates 50000 threads that do nothing also runs much slower on the unloaded nodes.
(I used the code on the bottom half of linked page)

请先登录,再进行评论。

采纳的回答

Philip Borghesani
Philip Borghesani 2015-6-11
Could the problem be a power savings setting? Many machines are now configured to run at a lower clock rate when not heavily loaded.
  2 个评论
Jed
Jed 2015-6-11
Good question... I was also wondering about that... perhaps I will google around and see if I can find out anything like that... but I still suspect it has something to do with openmp. perhaps I can verify this by running a different computationally intensive program that doesn't use openmp on one of the free nodes.
Jed
Jed 2015-6-11
OK... it seems you are correct. I created a process that spawns 12 threads and just adds numbers like crazy. When I run this program, the performance of my thread launcher improves by a factor of >3x. Thanks.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile 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!

Translated by