Matlab parallel processing using a network computer

…衆ロ難τιáo~ 提交于 2019-12-07 00:04:07

问题


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

回答1:


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.



来源:https://stackoverflow.com/questions/11726156/matlab-parallel-processing-using-a-network-computer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!