Load file into parallel session
Part of filename common to all saved files being loaded.
pload(fileroot) loads the data from the
[fileroot num2str(labindex)] into the
workers running a communicating job. The files should have been created
psave command. The
number of workers should be the same as the number of files. The
files should be accessible to all the workers. Any codistributed
arrays are reconstructed by this function. If
an extension, the character representation of the
be inserted before the extension. Thus,
attempts to load the file
abc1.mat on worker 1,
worker 2, and so on.
Create three variables — one replicated, one variant,
and one codistributed. Then save the data. (This example works in
a communicating job or in pmode, but not in a
clear all; rep = speye(numlabs); var = magic(labindex); D = eye(numlabs,codistributor()); psave('threeThings');
This creates three files (
in the current working directory.
Clear the workspace on all the workers and confirm there are no variables.
clear all whos
Load the previously saved data into the workers. Confirm its presence.
pload('threeThings'); whos isreplicated(rep) iscodistributed(D)