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

Subject: codistributed arrays

From: Andrei

Date: 16 Nov, 2010 09:53:04

Message: 1 of 2

In A\b benchmark the array A and b is codistributed among the labs. My problem is that for an large matrix the distribution time is very large. The code is:
%matlabpool size = 4
n=10000;
A = rand(n,n);
b= rand(n,1);
tic;
x = A\b;
toc
spmd
          dist=codistributor('2d', [2 2], 5000);
          tic;
          A_dist = codistributed(A, dist, 'convert');
          b_dist = codistributed(b, dist, 'convert');
         toc %distribution time too large. It's normaly?

         tic;
         x_dist=A_dist\b_dist;
         toc
end

Thanks
Iulian

Subject: codistributed arrays

From: Aurelien Queffurust

Date: 16 Nov, 2010 10:02:04

Message: 2 of 2

"Andrei " <iulian@lmn.pub.ro> wrote in message <ibtk9v$dm1$1@fred.mathworks.com>...
> In A\b benchmark the array A and b is codistributed among the labs. My problem is that for an large matrix the distribution time is very large. The code is:
> %matlabpool size = 4
> n=10000;
> A = rand(n,n);
> b= rand(n,1);
> tic;
> x = A\b;
> toc
> spmd
> dist=codistributor('2d', [2 2], 5000);
> tic;
> A_dist = codistributed(A, dist, 'convert');
> b_dist = codistributed(b, dist, 'convert');
> toc %distribution time too large. It's normaly?
>
> tic;
> x_dist=A_dist\b_dist;
> toc
> end
>
> Thanks
> Iulian


There is an explanation in this tech note:

Why do parallel math functions sometimes take longer than the serial versions with Distributed Computing Toolbox 3.0 (R2006b)?
http://www.mathworks.com/support/solutions/en/data/1-3XRRMC/?solution=1-3XRRMC

[...In the case of using MLDIVIDE, the increased calculation time is a result of the time required to communicate intermediate results of the calculation between labs. ...]
Aurélien
http://blog.developpez.com/matlab4geek/

Tags for 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