The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: spmd and parfor with large broadcast variables
Replies: 2   Last Post: Dec 31, 2012 3:11 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 1
Registered: 6/14/12
spmd and parfor with large broadcast variables
Posted: Jun 14, 2012 8:25 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


I'm new to the idea of parallel computing with matlab on a cluster. I understand that using broadcast variables, like

matlabpool 10
bigd = loadBigData(); % loads a large matrix of class double
r = zeros(100,1);
parfor ii = 1:100,
r(ii) = doSomething(ii,bigd);

causes a lot of extra network traffic. My first question is whether the variable bigd is sent over the network 10 times (i.e. once per lab) or 100 times (once per loop iteration).

If the answer is that the variable is broadcast 100 times, would it be possible to alleviate this by using spmd to create a copy of the broadcast variable locally on each worker? If so, how would I do that?

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.