How to send files from worker to client in MDSC?

조회 수: 1 (최근 30일)
raym
raym 2018년 9월 9일
댓글: raym 2018년 9월 10일
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.

채택된 답변

Edric Ellis
Edric Ellis 2018년 9월 10일
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
raym
raym 2018년 9월 10일
I also come up with the same idea last night. Thanks.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by