...
>> % Query job for state: queued | running | finished
>> j.State
>> % If state is finished, fetch results
>> j.fetchOutputs{:}
>> % Delete the job after results are no longer needed
>> j.delete
To retrieve a list of currently running or completed jobs, call parcluster to retrieve the cluster object. The cluster object stores an array of jobs that were run, are running, or are queued to run. This allows us to fetch the results of completed jobs. Retrieve and view the list of jobs as shown below.
>> c = parcluster;
>> jobs = c.Jobs
Once we’ve identified the job we want, we can retrieve the results as we’ve done previously.
fetchOutputs is used to retrieve function output arguments; if using batch with a script, use load instead. Data that has been written to files on the cluster needs be retrieved directly from the file system.
To view results of a previously completed job:
>> % Get a handle on job
...
with job array index 2 (2x1)j
>> j2 = c.Jobs(2);
NOTE: You can view a list of your jobs, as well as their IDs, using the above c.Jobs command.
>> % Fetch results for job with ID 2
>> j2.fetchOutputs{:}
>> % If the job produces an error view the error log file
>> c.getDebugLog(j.Tasks(1))
Parallel Jobs
Debugging
To learn More
...