필터 지우기
필터 지우기

Using parfor

조회 수: 4 (최근 30일)
Peter
Peter 2012년 4월 27일
Hi I successfully implemented a parfor loop in Matlab. However on my computer which has 4 cores I am not getting the improvement in computation time I expected to get. When I go to the task manager and check the CPU usage it rarely goes over 25% which is the same as before the parfor loop What could be the problem?

채택된 답변

Thomas
Thomas 2012년 4월 27일
What kind of problem have you set up using parfor.. a general fact about the Parallel Computing Toolbox is that the parallel tasks have to be pretty intensive/expensive in order for parallelization be effective..
If your computation is trivial then you might not get the speedup you expect.. Not a lot more can be said without looking at what code you have parallelized.
Also, is your machine quad core or a two core hyperthreaded which would show up as 4 virtual cores?
  댓글 수: 1
Peter
Peter 2012년 4월 27일
Hi thanks for your reply,
My processor is an Intel(R) Core(TM)2 Quad CPU Q8200 @2.33GHz.
Yes the tasks are pretty heavy.I use bintprog with a hundreds or thousands of variables that take a while to compute and other computationally expensive stuff.
I define the parfor this way on MATLAB 7.5.0(R2007b):
parfor (r=1:m_dash,4)
... end
Is that the correct way?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Edric Ellis
Edric Ellis 2012년 5월 2일
One thing to check - have you opened MATLABPOOL before issuing PARFOR? You need to do this in each MATLAB session to make the extra workers available. I.e.
matlabpool open local 4

카테고리

Help CenterFile Exchange에서 Parallel for-Loops (parfor)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by