How to send files from worker to client in MDSC?

2 vues (au cours des 30 derniers jours)
raym
raym le 9 Sep 2018
Commenté : raym le 10 Sep 2018
In the client I opened several workers by MDSC with MJS cluster "MyMJScluster" using multiple computers as node PC.
parpool('MyMJScluster')
Then I run a function which has a spmd block.
spmd
...
end
During the running of job, several files are generated on the local hard drive of each node PC. These files are under the same path of each node, such as "D:\data1\output\*.*", but filenames are different and unpredicatble, but could be dir from worker PC.
I want these files to transfered to the client under the same path to pool them together and do further combined small-scale analysis of these files at client.
Is there a way to do such a transfer? The addAttachedFiles only transfer the specified files from client to workers, but not the reverse.
Thanks.

Réponse acceptée

Edric Ellis
Edric Ellis le 10 Sep 2018
There's no facility to transfer files from the workers back to the client. If you can, I would suggest reading the files into memory on the workers, and then transferring the variables back from your spmd block as Composite objects. Something like
spmd
... do stuff ...
myData = loadAllOutputs('D:\data1\output\*.*');
end
% Pull all the data back from the workers
localData = myData(:);
% localData is now a cell array of length 'numlabs'
% containing all the data loaded on each worker
  1 commentaire
raym
raym le 10 Sep 2018
I also come up with the same idea last night. Thanks.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by