User`s guide
7 Program Independent Jobs
7-16
Share Code with the Workers
Because the tasks of a job are evaluated on different machines, each machine must have
access to all the files needed to evaluate its tasks. The basic mechanisms for sharing code
are explained in the following sections:
In this section...
“Workers Access Files Directly” on page 7-16
“Pass Data to and from Worker Sessions” on page 7-17
“Pass MATLAB Code for Startup and Finish” on page 7-19
Workers Access Files Directly
If the workers all have access to the same drives on the network, they can access the
necessary files that reside on these shared resources. This is the preferred method for
sharing data, as it minimizes network traffic.
You must define each worker session’s search path so that it looks for files in the right
places. You can define the path:
• By using the job’s AdditionalPaths property. This is the preferred method for
setting the path, because it is specific to the job.
AdditionalPaths identifies folders to be added to the top of the command search
path of worker sessions for this job. If you also specify AttachedFiles, the
AttachedFiles are above AdditionalPaths on the workers’ path.
When you specify AdditionalPaths at the time of creating a job, the settings
are combined with those specified in the applicable cluster profile. Setting
AdditionalPaths on a job object after it is created does not combine the new setting
with the profile settings, but overwrites existing settings for that job.
AdditionalPaths is empty by default. For a mixed-platform environment, the
strings can specify both UNIX and Microsoft Windows style paths; those setting that
are not appropriate or not found for a particular machine generate warnings and are
ignored.
This example sets the MATLAB worker path in a mixed-platform environment to
use functions in both the central repository /central/funcs and the department
archive /dept1/funcs, which each also have a Windows UNC path.