Parfor loop worker utilization problems
이전 댓글 표시
I am running Matlab R2011a on OpenSUSE Linux. When I'm running parfor loops, I've been looking at "top" to monitor processor usage. I initialize the largest possible matlabpool (size 8), and one would expect to see 8 processors cranking away in top. However, some jobs are running on 8 for a little bit, then some processors drop off one by one, and then finally MATLAB will only be running on say, 1 processor! It's as though MATLAB isn't redistributing the workload between available workers if other workers finish their assignments earlier than expected. Or is this some bug with my machine or something else? What's going on here?
답변 (1개)
Edric Ellis
2011년 10월 12일
How many iterations are your PARFOR loops running over? If the number is small, then the work may end up not being distributed completely evenly. For example
matlabpool 8
parfor ii = 1:9
pause(2);
end
will run in around 4 seconds because of that last iteration. PARFOR attempts to distribute work by sending out a relatively large number of iterates to each work in the first instance, and then a decreasing number as the loop is nearly complete.
One other factor can be if your loop iterations take very different amounts of time to complete.
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!