Saving data from SPMD loop to client
Afficher commentaires plus anciens
Hi All,
I'm running an smpd loop like
for c=1:NumLabs
all_data{c}.X = rand(100,100);
end
matlabpool NumLabs
smpd (NumLabs)
temp_X = all_data{labindex}.X
out = function(temp_X);
end
matlabpool close
How can I access the data stored in the composite object 'out' after closing the matlab pool? Is it possible to attach 'out' to "all_data{labindex}.out" in a way that its usable after closing the pool?
Thanks, Manuel.
Réponses (2)
Edric Ellis
le 9 Juil 2012
After the SPMD block, 'out' is a 'Composite'. By indexing into the Composite, you ring the values back to the client. To bring a single value back, you can do this:
one_value = out{1};
If you want to bring all the values back, you could do something like this:
out_client = out(:);
Manuel
le 9 Juil 2012
0 votes
2 commentaires
Edric Ellis
le 10 Juil 2012
Hi Manuel, You need to do "out_client = out(:);" before closing matlabpool, and then "out_client" will be stored on the client.
Edric Ellis
le 10 Juil 2012
For example:
matlabpool local 2
spmd
x = rand();
end
x_client = x(:);
matlabpool close
celldisp(x_client)
Catégories
En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!