spmd-parfor

2 views (last 30 days)
oblivious
oblivious on 31 May 2012
Hello,
i am trying to use PCT for a large for loop which uses a large data set used in ultrasound medical imaging. the loop run faster when spmd is used but takes more time than the original one when parfor is used. Again for some of my codes parfor is fater
is there any rule of thumb regarding the use of spmd or parfor?
-OBLI

Answers (1)

Jill Reese
Jill Reese on 31 May 2012
Generally speaking, spmd is used when you need communication to occur between workers in the matlabpool. Another difference is that labindex provides the index of each worker in the pool when used within spmd. In parfor, labindex is always 1 because parfor is intended only for independent tasks.
It is hard to comment on why your specific large data loop was faster with spmd than parfor without seeing a snippet of code. If you could post details about the operations in question then maybe we can identify where the bottleneck is.

Categories

Find more on Parallel for-Loops (parfor) in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!