pload - Load file into parallel session

Syntax

pload(fileroot)

Arguments

fileroot

Part of filename common to all saved files being loaded.

Description

pload(fileroot) loads the data from the files named [fileroot num2str(labindex)] into the labs running a parallel job. The files should have been created by the psave command. The number of labs should be the same as the number of files. The files should be accessible to all the labs. Any codistributed arrays are reconstructed by this function. If fileroot contains an extension, the character representation of the labindex will be inserted before the extension. Thus, pload('abc') attempts to load the file abc1.mat on lab 1, abc2.mat on lab 2, and so on.

Examples

Create three variables — one replicated, one variant, and one codistributed. Then save the data.

clear all;
rep = speye(numlabs);
var = magic(labindex);
D = eye(numlabs,codistributor());
psave('threeThings');

This creates three files (threeThings1.mat, threeThings2.mat, threeThings3.mat) in the current working directory.

Clear the workspace on all the labs and confirm there are no variables.

clear all
whos

Load the previously saved data into the labs. Confirm its presence.

pload('threeThings');
whos
isreplicated(rep)
isa(D, 'codistributed')

See Also

load, save MATLAB function reference pages

labindex, numlabs, pmode, psave

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS