Thread Subject: Cell Arrays with StarP?

Subject: Cell Arrays with StarP?

From: David Doria

Date: 29 May, 2008 00:42:02

Message: 1 of 2

I am looking to utilize the "parallel for" idea with starP.
An example I got from the website is as follows:

%serial version
a=rand(100,100,500);
tic; for i = 1:500
b(:,:,i) = inv(a(:,:,i));
end; toc

%parallel version:
a=rand(100,100,500*p);
tic; b=ppeval('inv',a); toc

However, I would like to put each element of a cell array
though a parallel for loop:

A{1} = some matrix
A{2} = another matrix
... etc
A{n} = last matrix

Parallel For i = 1:n
  do something to A{n}
end

Is this possible?

Thanks,

Dave

Subject: Cell Arrays with StarP?

From: Sarah

Date: 30 May, 2008 13:51:01

Message: 2 of 2

Hi David.

I know this is possible using the Parallel Computing
Toolbox product with MATLAB. The syntax would be

parfor i = 1:n
  do something to A{n}
end

I do not know about with star-P.

Cheers.
Sarah

"David Doria" <daviddoria@gmail.com> wrote in message
<g1ku4q$emf$1@fred.mathworks.com>...
> I am looking to utilize the "parallel for" idea with
starP.
> An example I got from the website is as follows:
>
> %serial version
> a=rand(100,100,500);
> tic; for i = 1:500
> b(:,:,i) = inv(a(:,:,i));
> end; toc
>
> %parallel version:
> a=rand(100,100,500*p);
> tic; b=ppeval('inv',a); toc
>
> However, I would like to put each element of a cell array
> though a parallel for loop:
>
> A{1} = some matrix
> A{2} = another matrix
> ... etc
> A{n} = last matrix
>
> Parallel For i = 1:n
> do something to A{n}
> end
>
> Is this possible?
>
> Thanks,
>
> Dave

Tags for this Thread

Everyone's Tags:

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.

Tag Activity for This Thread
Tag Applied By Date/Time
parfor parallel... Sarah Wait Zaranek 30 May, 2008 09:55:06
rssFeed for this Thread

Contact us at files@mathworks.com