pload
(Removed) Load file into parallel session
pload
has been removed. Use dload
instead. For more
information, see Version
History.
Syntax
pload(fileroot)
Arguments
| Part of filename common to all saved files being loaded. |
Description
pload(fileroot)
loads the data from the files named
[fileroot num2str(spmdIndex)]
into the workers running a
communicating job. The files should have been created by the 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
fileroot
contains an extension, the character representation
of the spmdIndex
will be inserted before the extension. Thus,
pload('abc')
attempts to load the file
abc1.mat
on worker 1, abc2.mat
on worker
2, and so on.
Examples
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 parfor
or spmd
block.)
clear all; rep = speye(spmdSize); var = magic(spmdIndex); D = eye(spmdSize,codistributor()); psave('threeThings');
This creates three files (threeThings1.mat
,
threeThings2.mat
, threeThings3.mat
) 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)