Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Matlab parallel processing using a network computer

I'm familiar with matlabpool, and parfor usage, but I still need to speedup the computation.

I have a more powerful computer in my 1GB network. Both computers have R2010b, and have the same code and paths.

What is the simplest way to use both computers for parallel computation?

Example of the code I use today:

--- main.m---

matlabpool('open', 3);
% ...
x = randn(1e5,1);
y = nan(size(x));
parfor k = 1 : length(x)
    y(k) = myfunc(x(k));
end

--- myfunc.m---

function y = myfunc(x)
    y = x; % some computation
return
like image 201
Serg Avatar asked Jul 30 '12 17:07

Serg


People also ask

How do I use parallel computing in MATLAB?

Depending on your preferences, MATLAB can start a parallel pool automatically. To enable this feature, select Parallel > Parallel Preferences in the Environment group on the Home tab, and then select Automatically create a parallel pool. Set your solver to use parallel processing.

Can computers do parallel processing?

Any system that has more than one CPU can perform parallel processing, as well as multi-core processors which are commonly found on computers today.

Does MATLAB use multiple CPU cores?

Only certain functions are optimized to take advantage of multiple core processor. More generally matlab remains a single threaded application and you have to use parallel computing toolbox to take full advantage of multi core processors.

Does parallel computing use networking?

Massively parallel computing A massively parallel processor (MPP) is a single computer with many networked processors. MPPs have many of the same characteristics as clusters, but MPPs have specialized interconnect networks (whereas clusters use commodity hardware for networking).


1 Answers

For real cluster computing, you'll need the distributed computing toolbox, as you can read on the parallel computing info page:

Without changing the code, you can run the same application on a computer cluster or a grid computing service (using MATLAB Distributed Computing Server™). You can run parallel applications interactively or in batch.

But installing (=buying) a toolbox just for adding one computer to the worker pool might be a bit too expensive. Luckily there are also alternatives: http://www.mathworks.com/matlabcentral/fileexchange/13775

I personally haven't used this, but think it's definitely worth a look.

like image 160
Gunther Struyf Avatar answered Sep 29 '22 10:09

Gunther Struyf