fetchOutputs
Retrieve output arguments from all tasks in job
Syntax
Description
retrieves the output arguments contained in the tasks of a finished job.data = fetchOutputs(j)
When you retrieve outputs from a job you create using createJob or
createCommunicatingJob, each row of the
m-by-n cell array data contains
the output arguments for each of the m tasks in the job. Each of the rows
in data has n elements, where n
is the greatest number of output arguments from any one task in the job. The
n elements of a row are arrays containing the output arguments from
that task. If a task has less than n output arguments, the excess
elements in the row for that task are empty.
When you retrieve outputs from a job you create using batch:
If you create the batch job using the
fcnsyntax and specifyNoutputs,datais a1-by-Ncell array.If you create the batch job using the
scriptorexpressionsyntaxes,datais a1-by-1cell array containing a structure scalar. If you specify thePoolargument when you create the batch job, the structure scalar contains the workspace of the worker that acts as the client. Otherwise, the structure scalar contains the workspace of the worker that runs the job.
The output data for a job is stored in the location given by the
JobStorageLocation property of the cluster that the job runs on. When
you run fetchOutputs, the output data is not removed from the
JobStorageLocation. To remove the output data, use the delete function to remove individual tasks or entire jobs.
The fetchOutputs function throws an error if:
The
Stateproperty of the jobjis not'finished'.The
Stateproperty of the jobjis'finished'and one of the tasks given by theTasksproperty of the jobjencountered an error.
Tip
To see if any of the tasks on the job j failed after
encountering an error, check if j.Tasks.Error is empty. If the
returned array is empty, none of the tasks on the job j encountered
any errors.
If some tasks completed successfully, you can use the
OutputArguments property of a task to access the output arguments
of that task directly.
Examples
Input Arguments
Version History
Introduced in R2012a
See Also
fetchOutputs
(Future) | batch | createJob | createCommunicatingJob