Skip to content

MATLAB Jobs

This page describes how to submit MATLAB jobs to the Slurm scheduler, either running a script in batch mode or launching the interactive MATLAB graphical user interface (GUI).

Similar to other job types, the form includes tabs like “New Job”, “Batch Script”, and “Setting”. This guide focuses on the “New Job” tab for submitting MATLAB jobs.

MATLAB Job Submission

Configure the resources required for your MATLAB job:

  • Partition: Select the partition (e.g., hpc).
  • Job Name: Assign a name (e.g., My_Test_Job).
  • Number of Nodes: Usually 1 unless using parallel features requiring multiple nodes.
  • CPUs per Task: Specify the number of CPU cores (e.g., 2).
  • Memory: Define the amount of memory required (e.g., 4G).
  • GPU Model: Select a GPU if needed by your MATLAB code.
  • GPUs per Node: Specify the number of GPUs required (e.g., 0).
  • Working Directory: The directory where MATLAB will start and where relative script paths will be resolved.

Configure MATLAB-specific settings:

  • Version: Select the desired MATLAB version (e.g., R2024a) from the available installations.
  • Launch MATLAB GUI: Check this box to start the interactive MATLAB graphical interface instead of running a script. Requires appropriate X11 forwarding setup.
  • MATLAB Script: If not launching the GUI, provide the absolute path to the MATLAB script (.m file) you want to execute in batch mode. Use the “Select” button to browse the filesystem.
  • Redirect to Job Monitor after submission: Check this to automatically go to the Job Monitoring page after submission.
  • Submit Button: Submits the MATLAB job (either script execution or GUI launch) to Slurm.

For GUI sessions, connection details might appear in the job logs. For batch scripts, output will typically be in the Slurm log file accessible via the Job Logs page.

When you submit a MATLAB job with the GUI option enabled, you can access the MATLAB interface directly through your web browser. After job submission, follow these steps:

  1. Go to the Job Details page for your MATLAB job
  2. Click the “Connect Matlab GUI” button that appears when the job is running
MATLAB Connect Button in Job Details
  1. MATLAB GUI will open in a new browser tab, giving you full access to the interactive MATLAB environment
MATLAB GUI running in browser
  • No Local Installation Required: Access MATLAB without installing it on your computer
  • Resource Utilization: Leverage cluster resources for computationally intensive tasks
  • Accessibility: Work with MATLAB from any device with a web browser
  • Consistent Environment: Access the same MATLAB version and toolboxes consistently