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).
Job Submission Tabs
Section titled “Job Submission Tabs”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.
New Job Tab
Section titled “New Job Tab”
1. Job Scheduler Options
Section titled “1. Job Scheduler Options”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
1unless 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.
2. MATLAB Options
Section titled “2. MATLAB Options”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 (
.mfile) you want to execute in batch mode. Use the “Select” button to browse the filesystem.
3. Submission
Section titled “3. Submission”- 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.
Accessing MATLAB GUI via Browser
Section titled “Accessing MATLAB GUI via Browser”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:
- Go to the Job Details page for your MATLAB job
- Click the “Connect Matlab GUI” button that appears when the job is running
- MATLAB GUI will open in a new browser tab, giving you full access to the interactive MATLAB environment
Benefits of Browser-Based MATLAB Access
Section titled “Benefits of Browser-Based MATLAB Access”- 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