Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Can MATLAB make use of multi-core CPU

Subject: Can MATLAB make use of multi-core CPU

From: Andy

Date: 24 Jan, 2007 22:21:47

Message: 1 of 8

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.

Subject: Can MATLAB make use of multi-core CPU

From: Vijay Singh

Date: 25 Jan, 2007 00:44:32

Message: 2 of 8

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

Subject: Can MATLAB make use of multi-core CPU

From: Markus

Date: 25 Jan, 2007 06:34:14

Message: 3 of 8

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

Subject: Can MATLAB make use of multi-core CPU

From: Andy

Date: 25 Jan, 2007 09:20:10

Message: 4 of 8

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

Subject: Can MATLAB make use of multi-core CPU

From: A Friend

Date: 25 Jan, 2007 09:28:34

Message: 5 of 8

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.

Subject: Can MATLAB make use of multi-core CPU

From: Andy

Date: 25 Jan, 2007 09:37:16

Message: 6 of 8

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:
>>
>>
>> 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

Subject: Can MATLAB make use of multi-core CPU

From: Dan Hensley

Date: 25 Jan, 2007 08:39:30

Message: 7 of 8

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

Subject: Can MATLAB make use of multi-core CPU

From: Markus

Date: 26 Jan, 2007 09:20:13

Message: 8 of 8

I have put my parallelization code into a small toolbox that you can
download here:

 <http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=13775>

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

Tags for this Thread

No tags are associated with this thread.

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.

Contact us