User`s guide

Program Independent Jobs for a Generic Scheduler
7-29
With those values from the environment variables, the decode function must set the
appropriate property values of the object that is its argument. The property values that
must be set are the same as those in the corresponding submit function, except that
instead of the cell array TaskLocations, each worker has only the individual string
TaskLocation, which is one element of the TaskLocations cell array. Therefore, the
properties you must set within the decode function on its argument object are as follows:
StorageConstructor
StorageLocation
JobLocation
TaskLocation
Example — Write the Decode Function
The decode function must read four environment variables and use their values to set the
properties of the object that is the function’s output.
In this example, the decode function’s argument is the object props.
function props = workerDecodeFunc(props)
% Read the environment variables:
storageConstructor = getenv('MDCE_STORAGE_CONSTRUCTOR');
storageLocation = getenv('MDCE_STORAGE_LOCATION');
jobLocation = getenv('MDCE_JOB_LOCATION');
taskLocation = getenv('MDCE_TASK_LOCATION');
%
% Set props object properties from the local variables:
set(props, 'StorageConstructor', storageConstructor);
set(props, 'StorageLocation', storageLocation);
set(props, 'JobLocation', jobLocation);
set(props, 'TaskLocation', taskLocation);
When the object is returned from the decode function to the MATLAB worker session, its
values are used internally for managing job and task data.
Example — Program and Run a Job in the Client
1. Create a Scheduler Object
You use the parcluster function to create an object representing the cluster in your
local MATLAB client session. Use a profile based on the generic type of cluster