Thread Subject: functions to solve in parallel

Subject: functions to solve in parallel

From: Fabio

Date: 19 Nov, 2009 14:23:03

Message: 1 of 2

Hi
I would like to solve two function in parallel mode:

result = CNSopt (x)
where x can be 2 or 3

and more ore less on a Intel T9300 each case runs for 2000s

can I run the 2 functions on lab1 the x=2 and on lab2 the x=3, using PMODE?

please help me :)

Subject: functions to solve in parallel

From: Edric M Ellis

Date: 23 Nov, 2009 09:24:22

Message: 2 of 2

"Fabio " <technofabio@gmail.com> writes:

> Hi
> I would like to solve two function in parallel mode:
>
> result = CNSopt (x)
> where x can be 2 or 3
>
> and more ore less on a Intel T9300 each case runs for 2000s
>
> can I run the 2 functions on lab1 the x=2 and on lab2 the x=3, using PMODE?
>
> please help me :)

Yes, at the P>> prompt, you'd need to type

if labindex == 1, x = 2, else, x = 3, end
result = CNSopt( x );

In R2008b and later, instead of using PMODE, I'd recommend using MATLABPOOL and
SPMD, where you'd do something more like this:

matlabpool open local 2
spmd
  if labindex == 1
    x = 2;
  else
    x = 3;
  end
  result = CNSopt( x );
end

result{1} % the result from labindex==1
result{2} % the result from labindex==2

Cheers,

Edric.

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
pmode Fabio 19 Nov, 2009 09:24:31
parallel Fabio 19 Nov, 2009 09:24:31
multi Fabio 19 Nov, 2009 09:24:31
rssFeed for this Thread

Contact us at files@mathworks.com