### Tags: advantage, core, cores, cpu, cputo, duo, installed, matlab, multi-core, programming, r2006a, windows

# Can MATLAB make use of multi-core CPU

On Programmer » Matlab

6,189 words with 7 Comments; publish: Tue, 29 Apr 2008 13:46:00 GMT; (20094.73, « »)

I've got a core 2 duo PC with Windows XP and MATLAB R2006a installed.

I want to know if MATLAB will take advantage of the two cores of CPU

to double the computational speed (in the ideal situation) if I do

not use any parallel programming technique in my function.

In detail, most of the computing time of my script is spent on the

2-D convolution which is iterated 5000 times. The date in each

iteration is independent so that parallel computing technqiue can

help.

Well, I don't expect MATLAB to be smart enough to optimize my script.

So my second question is how to do parallel programming in MATLAB.

Thanks.

Andy.

*http://matlab.todaysummary.com/q_matlab_6732.html*

All Comments

Leave a comment...

- 7 Comments
- Andy wrote:
>

> I've got a core 2 duo PC with Windows XP and MATLAB R2006a

> installed.

> I want to know if MATLAB will take advantage of the two cores of

> CPU

> to double the computational speed (in the ideal situation) if I do

> not use any parallel programming technique in my function.

> In detail, most of the computing time of my script is spent on the

> 2-D convolution which is iterated 5000 times. The date in each

> iteration is independent so that parallel computing technqiue can

> help.

> Well, I don't expect MATLAB to be smart enough to optimize my

> script.

> So my second question is how to do parallel programming in MATLAB.

> Thanks.

> Andy.

Hi Andy,

MATLAB is not a multithreaded application so it can not make use of

dual core. But there is a toolbox, distibuted computing toolbox that

makes use of multi-processor systems though. But Mathwork is in the

process of supporting multicore systems as well. I hope this info may

help you a bit.

Cheers !!

V

#1; Tue, 29 Apr 2008 13:47:00 GMT

- Andy wrote:
- I am using the processing power of multiple cores, or even of
multiple computers, without using the distributed computing toolbox.

What my master process does is to save the data needed for the

computation task into simple data files. One or several slave

processes load these files, do the computation and save the results

into files. Then the master process can load the results.

Saving and loading is very quick, so the organizational overhead

should be neglectable, if your processing task needs several seconds

or more.

If you like more advice on how I realized this, let me know.

Markus

#2; Tue, 29 Apr 2008 13:48:00 GMT

- I am using the processing power of multiple cores, or even of
- I'd like to know your solution.
Markus wrote:

>

> I am using the processing power of multiple cores, or even of

> multiple computers, without using the distributed computing

> toolbox.

> What my master process does is to save the data needed for the

> computation task into simple data files. One or several slave

> processes load these files, do the computation and save the results

> into files. Then the master process can load the results.

> Saving and loading is very quick, so the organizational overhead

> should be neglectable, if your processing task needs several

> seconds

> or more.

> If you like more advice on how I realized this, let me know.

> Markus

#3; Tue, 29 Apr 2008 13:49:00 GMT

- I'd like to know your solution.
- Andy wrote:
>

> I've got a core 2 duo PC with Windows XP and MATLAB R2006a

> installed.

[snip wants matlab to utilize core 2 duo]

While not in the way you describe, the pre-release R2007a has some

multi-thread, multi-processor support. On the computations I test,

where multi-thread/proc is enabled, I did see a 3x-4x improvement in

speed. I have a 4 processor (8 core) computer to work with.

A Friend.

#4; Tue, 29 Apr 2008 13:50:00 GMT

- Andy wrote:
- Well, after a brief look at the distributed computing toolbox at
mathworks website, it gives me the impression that this toolbox is

designed for computing cluster, not for multi-core CPU on a single

machine. So it may not help me.

Vijay Singh wrote:

>

> Andy wrote:

of

> do

> the

can

> MATLAB.

> Hi Andy,

> MATLAB is not a multithreaded application so it can not make use of

> dual core. But there is a toolbox, distibuted computing toolbox

> that

> makes use of multi-processor systems though. But Mathwork is in the

> process of supporting multicore systems as well. I hope this info

> may

> help you a bit.

> Cheers !!

> V

#5; Tue, 29 Apr 2008 13:51:00 GMT

- Well, after a brief look at the distributed computing toolbox at
- On Wed, 24 Jan 2007 22:21:47 -0500, Andy wrote:
> I've got a core 2 duo PC with Windows XP and MATLAB R2006a installed.

> I want to know if MATLAB will take advantage of the two cores of CPU

> to double the computational speed (in the ideal situation) if I do

> not use any parallel programming technique in my function.

> In detail, most of the computing time of my script is spent on the

> 2-D convolution which is iterated 5000 times. The date in each

> iteration is independent so that parallel computing technqiue can

> help.

> Well, I don't expect MATLAB to be smart enough to optimize my script.

> So my second question is how to do parallel programming in MATLAB.

> Thanks.

> Andy.

In addition to what others have said, there is more information available

if you search this newsgroup. This question is quite frequently asked, so

there are numerous previous posts to look up.

Dan

#6; Tue, 29 Apr 2008 13:52:00 GMT

- On Wed, 24 Jan 2007 22:21:47 -0500, Andy wrote:
- I have put my parallelization code into a small toolbox that you can
download here:

<[url]http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=13775[/u

rl]>

This is only one of similiar solutions, but maybe someone can use it

for his work. It does not use any C-programmed stuff that has to be

compiled before one can start to work.

Markus

#7; Tue, 29 Apr 2008 13:53:00 GMT

- I have put my parallelization code into a small toolbox that you can