User`s guide

7 Program Independent Jobs
7-28
'parallel.cluster.generic.independentDecodeFcn'. The remainder of this
section is useful only if you use names and settings other than the standards used in the
provided decode functions.
Identify File Name and Location
The client’s submit function and the worker’s decode function work together as a pair.
For more information on the submit function, see “MATLAB Client Submit Function”
on page 7-22. The decode function on the worker is identified by the submit function
as the value of the environment variable MDCE_DECODE_FUNCTION. The environment
variable must be copied from the client node to the worker node. Your scheduler might
perform this task for you automatically; if it does not, you must arrange for this copying.
The value of the environment variable MDCE_DECODE_FUNCTION defines the filename
of the decode function, but not its location. The file cannot be passed as part of the job
AdditionalPaths or AttachedFiles property, because the function runs in the
MATLAB worker before that session has access to the job. Therefore, the file location
must be available to the MATLAB worker as that worker starts.
Note The decode function must be available on the MATLAB worker’s path.
You can get the decode function on the worker’s path by either moving the file into
a folder on the path (for example, matlabroot/toolbox/local), or by having the
scheduler use cd in its command so that it starts the MATLAB worker from within the
folder that contains the decode function.
In practice, the decode function might be identical for all workers on the cluster. In this
case, all workers can use the same decode function file if it is accessible on a shared
drive.
When a MATLAB worker starts, it automatically runs the file identified by the
MDCE_DECODE_FUNCTION environment variable. This decode function runs before the
worker does any processing of its task.
Read the Job and Task Information
When the environment variables have been transferred from the client to the worker
nodes (either by the scheduler or some other means), the decode function of the MATLAB
worker can read them with the getenv function.