Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Matlab multiple cores

I'm running an algorithm that's taking a lot of resources, and maxes out the CPU.

The problem is that it's only using one CPU.

How can i make MATLAB multithread the computations and use more than 1 CPU ?

like image 633
Yochai Timmer Avatar asked Jul 24 '26 19:07

Yochai Timmer


2 Answers

Unless you specifically use parallel constructs -- that is, using explicit parallelism -- or use built-in functions that have already been parallelized for you -- Matlab will not run faster on a multicore machine. This post has a list of built-in functions that have been parallelized and so will take advantage of multiple cores:

http://www.walkingrandomly.com/?p=1894

Here's an example of using a parallel construct to roll your own parallelism:

http://www.mathworks.com/matlabcentral/fileexchange/13775

like image 188
EmeryBerger Avatar answered Jul 28 '26 05:07

EmeryBerger


The settings are at:

File>Preferences>General>Multithreading in R2007a or newer

Affected functions are described at:

Which MATLAB functions benefit from multithreading

like image 38
Yochai Timmer Avatar answered Jul 28 '26 05:07

Yochai Timmer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!