Thread Subject: Parallel computing

Subject: Parallel computing

From: terfil zhuang

Date: 10 Aug, 2009 16:54:01

Message: 1 of 4

Hi, there,

I am testing the performance of parfor and spmd on some simple codes using tic and toc. I found that the running time changed all the time. Could someone give me an idea on how to get a stable result and what is the difference between them. Thanks.

Subject: Parallel computing

From: Narfi

Date: 11 Aug, 2009 12:32:04

Message: 2 of 4

"terfil zhuang" <terfil@gmail.com> wrote in message <h5pjb9$cqj$1@fred.mathworks.com>...
> Hi, there,
>
> I am testing the performance of parfor and spmd on some simple codes using tic and toc. I found that the running time changed all the time. Could someone give me an idea on how to get a stable result and what is the difference between them. Thanks.

Terfil,

Have you looked at the product demos? They might be a good place to start, both for benchmarking in general and benchmarking parfor.

http://www.mathworks.com/products/parallel-computing/demos.html?file=/products/demos/shipping/distcomp/paralleldemo_parfor_bench.html
http://www.mathworks.com/products/parallel-computing/demos.html?file=/products/demos/shipping/distcomp/paralleldemo_distribjob_bench.html

Best,

Narfi

Subject: Parallel computing

From: Juliette Salexa

Date: 13 Aug, 2009 04:06:04

Message: 3 of 4

Also, the variability in your performance could have to do with you running other programs in the background. When I use the PCT, matlab will take up 100% of my CPU's resources unless other things are running in the backgorund, in which case it will take up whatever's left. Try running your code with nothing in the background.

Subject: Parallel computing

From: terfil zhuang

Date: 18 Aug, 2009 03:20:19

Message: 4 of 4

"Juliette Salexa" <juliette.physicist@gmail.com> wrote in message <h603fc$oq7$1@fred.mathworks.com>...
> Also, the variability in your performance could have to do with you running other programs in the background. When I use the PCT, matlab will take up 100% of my CPU's resources unless other things are running in the backgorund, in which case it will take up whatever's left. Try running your code with nothing in the background.

Thanks for replying. After running several times, the results get stable. Also, the spmd does not work well as parfor. The code is showed as below:

clear;
clc;
tic
matlabpool open 2
A=zeros(10000000,1);
B=A;
spmd
   for i=1:size(A,1) %or using parfor
        B(i)=A(i)+i;
    end
end
matlabpool close
toc

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com