Got Questions? Get Answers.
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:
SPMD, data stuck in lab?

Subject: SPMD, data stuck in lab?

From: Chuck37

Date: 2 Jan, 2013 18:31:08

Message: 1 of 2

I have a big hunk of data that I generated in an SPMD loop. I kept it in lab (worker) number one. When I try to get it like:

Mlocal = M{1}

it complains that the data is too big. It says something about transparency if I try to save it to disk inside SPMD. Am I hosed, or is there a way to retrieve the data? I did it this way so I wouldn't have to eat the delay from gathering data along the way.

Subject: SPMD, data stuck in lab?

From: Edric M Ellis

Date: 3 Jan, 2013 07:56:13

Message: 2 of 2

"Chuck37 " <chuck3737@yahooremovethis.com> writes:

> I have a big hunk of data that I generated in an SPMD loop. I kept it
> in lab (worker) number one. When I try to get it like:
>
> Mlocal = M{1}
>
> it complains that the data is too big. It says something about
> transparency if I try to save it to disk inside SPMD.

You cannot write a SAVE statement directly in the body of an SPMD block
because of transparency, but you can pass the data to a function which
calls save. I.e. something like this:

spmd
  M = <...>;
  saveData('myFileName', M);
end

%%
function saveData(var, fname)
  save(fname, 'var');
end

Cheers,

Edric.

Tags for this Thread

No tags are associated with 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