Main Content

Job Monitor

The Job Monitor displays the jobs in the queue for the scheduler determined by your selection of a cluster profile. Open the Job Monitor from the MATLAB® desktop on the Home tab in the Environment section, by selecting Parallel > Monitor Jobs.

The Job Monitor showing a single job containing one task, with state "Finished".

The job monitor lists all the jobs that exist for the cluster specified in the selected profile. You can choose any one of your profiles (those available in your current session Cluster Profile Manager), and whether to display jobs from all users or only your own jobs.

Typical Use Cases

The Job Monitor lets you accomplish many different goals pertaining to job tracking and queue management. Using the Job Monitor, you can:

  • Discover and monitor all jobs submitted by a particular user

  • Determine the status of a job

  • Determine the cause of errors in a job

  • Delete old jobs you no longer need

  • Create a job object in MATLAB for access to a particular job in the queue

Manage Jobs Using the Job Monitor

Using the Job Monitor you can manage the listed jobs for your cluster. Right-click on any job in the list, and select any of the following options from the context menu. The available options depend on the type of job.

  • Cancel — Stops a running job and changes its state to 'finished'. If the job is pending or queued, the state changes to 'finished' without its ever running. This is the same as the command-line cancel function for the job.

  • Delete — Deletes the job data and removes the job from the queue. This is the same as the command-line delete function for the job. Also closes and deletes an interactive pool job.

  • Show Details — This displays detailed information about the job in the Command Window.

  • Show Errors — This displays all the tasks that generated an error in that job, with their error properties.

  • Fetch Outputs — This collects all the task output arguments from the job into the client workspace.

Identify Task Errors Using the Job Monitor

Because the Job Monitor indicates if a job had a run-time error, you can use it to identify the tasks that generated the errors in that job. For example, the following script generates an error because it attempts to perform a matrix inverse on a vector:

A = [2 4 6 8];
B = inv(A);

If you save this script in a file named invert_me.m, you can try to run the script as a batch job on the default cluster:

batch('invert_me')

When updated after the job runs, the Job Monitor includes the job created by the batch command, with an error icon () for this job. Right-click the job in the list, and select Show Errors. For all the tasks with an error in that job, the task information, including properties related to the error, display in the MATLAB command window:

 Task with properties: 

                   ID: 1
                State: finished
             Function: @parallel.internal.cluster.executeScript
               Parent: Job 8
        StartDateTime: 12-Feb-2021 09:29:02
     RunningDuration: 0 days 0h 0m 2s

                Error: Matrix must be square.
          Error Stack: invert_me (line 2)
             Warnings: none