Thread Subject: Questions about multithreading

Subject: Questions about multithreading

From: Merciadri Luca

Date: 21 Nov, 2009 20:20:12

Message: 1 of 5

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi folks,

I think that I have understood the basics of multithreading in
MATLAB. I am still asking myself some questions which I cannot find
any answer for:

1. Does `pmode start' actually asks MATLAB to
$ matlabpool
and to use `parfor' for each `for' loop which is typed in the
resulting GUI?

2. MATLAB takes ~3 sec to achieve
$ matlabpool local 4
here.
Is it normal? If so, why? (It seems to allocate a _lot_ of memory.)

3. Are there any special implementations of Runge-Kutta methods (and
  more generally for other methods for ODEs) for multithreading? I
  assume that a ``traditional'' Runge-Kutta function has its
  computations divided between all the cores if you use a version > R2007a. Am I right?

Thanks for any help.
- --
Merciadri Luca
See http://www.student.montefiore.ulg.ac.be/~merciadri/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iEYEARECAAYFAksIS3sACgkQM0LLzLt8Mhz9rwCghRT0MDxlhDhLk1gqAR6mGW2n
2CMAn0FCK3orsZT3MGO8EQPilTu5kUTP
=6bPW
-----END PGP SIGNATURE-----

Subject: Questions about multithreading

From: Edric M Ellis

Date: 23 Nov, 2009 09:29:31

Message: 2 of 5

Merciadri Luca <Luca.Merciadri@student.ulg.ac.be> writes:

> I think that I have understood the basics of multithreading in
> MATLAB. I am still asking myself some questions which I cannot find
> any answer for:
>
> 1. Does `pmode start' actually asks MATLAB to
> $ matlabpool
> and to use `parfor' for each `for' loop which is typed in the
> resulting GUI?

"pmode start" launches as many MATLAB workers as you request. However, those
workers are only available for use via the PMODE interface. For PARFOR, you need
to use "matlabpool open".

> 2. MATLAB takes ~3 sec to achieve
> $ matlabpool local 4
> here.
> Is it normal? If so, why? (It seems to allocate a _lot_ of memory.)

Yes, I reckon that's actually quite fast as there you're launching 4 full MATLAB
workers.

(Sorry, don't know anything about your third question).

Cheers,

Edric.

Subject: Questions about multithreading

From: Merciadri Luca

Date: 23 Nov, 2009 17:35:20

Message: 3 of 5

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Thanks Edric.

Edric M Ellis <eellis@mathworks.com> writes:

>> 1. Does `pmode start' actually asks MATLAB to
>> $ matlabpool
>> and to use `parfor' for each `for' loop which is typed in the
>> resulting GUI?
>
> "pmode start" launches as many MATLAB workers as you request. However, those
> workers are only available for use via the PMODE interface. For PARFOR, you need
> to use "matlabpool open".
Is it okay with
$ matlabpool local 4
?

Thanks.

- --
Merciadri Luca
See http://www.student.montefiore.ulg.ac.be/~merciadri/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iEYEARECAAYFAksKx9cACgkQM0LLzLt8MhzowACfVvo8imbfyO2f8vQPwoe9v3RK
1SoAnAhZFc/VbthVQnPA2uI2kzMbATTX
=4utd
-----END PGP SIGNATURE-----

Subject: Questions about multithreading

From: Edric M Ellis

Date: 24 Nov, 2009 09:22:33

Message: 4 of 5

Merciadri Luca <Luca.Merciadri@student.ulg.ac.be> writes:

> Edric M Ellis <eellis@mathworks.com> writes:
>
>>> 1. Does `pmode start' actually asks MATLAB to
>>> $ matlabpool
>>> and to use `parfor' for each `for' loop which is typed in the
>>> resulting GUI?
>>
>> "pmode start" launches as many MATLAB workers as you request. However, those
>> workers are only available for use via the PMODE interface. For PARFOR, you need
>> to use "matlabpool open".
> Is it okay with
> $ matlabpool local 4

Yes, because that's really just shorthand for "matlabpool open local 4".

Cheers,

Edric.

Subject: Questions about multithreading

From: Merciadri Luca

Date: 24 Nov, 2009 13:23:22

Message: 5 of 5

On Nov 24, 10:22 am, Edric M Ellis <eel...@mathworks.com> wrote:

> > Is it okay with
> > $ matlabpool local 4
>
> Yes, because that's really just shorthand for "matlabpool open local 4".

Thanks, Edric.

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