In parallel processing, are multiple workers used for anything else than parfor loops?

When using the parallel computing toolbox, are parfor loops required for parallel processing? I plan to use parfor loops, but the most expensive part of my program is SVD, which is performed during each iteration of a loop. Will MATLAB break up the SVD into multiple workers?

 채택된 답변

Shashank Prasanna
Shashank Prasanna 2013년 8월 2일
편집: Shashank Prasanna 2013년 8월 2일
Using SVD under a parfor will likely slow the performance of SVD. SVD is inherently multithreaded and make use of multiply cores calling it as it is. Here are a list of function that are inherently multithreaded:
To comment further on how we could speed up your code, we may need to see more of what you have within the parfor loop.

댓글 수: 5

Interesting... but you need the parallel processing toolbox to make SVD multithreaded? So if I call the toolbox (e.g. "matlabpool open 12"), then SVD will be multithreaded?
SVD is always multithreaded. This is a base MATLAB feature, you don't need parallel computing toolbox (PCT) at all. Using PCT however will make SVD on each worker single threaded and therefore not recommended.
Ok, so it is not at all possible to distribute SVD among several cores? Only to multithread it on one core? This is a bummer, because I have 16 cores to work with.
SVD is already multithreaded. It does make use of multiple cores.
Here is the difference between multicore (like svd) and multiprocessor (using PCT):
Clare
Clare 2013년 8월 4일
편집: Clare 2013년 8월 6일
EDIT: Never mind, I figured it out!
Ok, thanks for the response and link. I asked because I have experimented on my laptop, which has 4 cores and 8 threads. Yet a labor-intensive SVD computation hovers around 200% of CPU usage, suggesting it is using 2 threads in one core only. Any idea why this may be happening, and how to change it? Thanks again for your help.
p.s. On my laptop I have version r2011a. I tried changing the maximum # of threads to 8 using the "LASTN = maxNumCompThreads(8)" command. No luck.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Linear Algebra에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by