mpi affecting matlab execution speed

조회 수: 9 (최근 30일)
Jed
Jed 2015년 6월 10일
댓글: Jed 2015년 6월 11일
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