Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Action

A site-wide license for Matlab is administered by the University at Albany. Matlab can be run on the

...

cluster with the GUI via X11 forwarding.


Be sure to use Matlab on a full stomach. Neither Matlab nor SUNY at Albany are responsible for any side effects of prolonged usage.

Instructions

Interactive Matlab

Running Matlab interactively requires a connection via SSH with X-forwarding. In the below examples, an Interactive Matlab session running on the cluster is demonstrated using X2Go with MATE desktophere with a macOS.

For more information on connecting to the cluster via SSH, please see How-to: Connect via SSH (PuTTY, macOS terminal, X2Go)


Connect to headto head-01.arcc.albany.edu with X-forwarding. Instruction on doing so, depending on your operating system can be found here.

Image Added


Next, launch an interactive job using a command similar to the one below:

...

--gres=gpu:1 # For one GPU

Image Added


Now, we'll use the matlab module file to load matlab 2023a, via "module load matlab/2023a"

...

Finally, type "matlab" and the GUI will spawn:

Image Added


Once your job is complete and you exit the MATLAB GUI, be sure to cancel your job:

squeue -u your_netid

             JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)

           5385415     batch mrun your_netid  R 6-06:44:30      1 uagc20-11


scancel 5385415

...

Example SLURM Script for a non-interactive job:

#!/bin/bash

#SBATCH -p batch #batch partition

#SBATCH --cpus-per-task=2 # 2 cores

#SBATCH --mem-per-cpu=2000 # 2GB memory

#SBATCH --mail-type=ALL

#SBATCH --mail-user=%u@albany.edu #email address

#SBATCH -o /network/rit/home/%u/example-slurm-%j.out #log file

#SBATCH --time=1-0:1 # Estimating the job will take 1 day, 0 hours, 1 minute

  

# source matlab module

module load matlab/2023a

  

#Run the script

matlab -nodesktop -nosplash -batch [your_script].m

...