Using Matlab on the cluster
A site-wide license for Matlab is administered by the University at Albany. Matlab can be run on the cluster "interactively", with the GUI via X11 forwarding, or Matlab scripts can be submitted to the cluster as jobs using SBATCH. For more information on connecting to the cluster via SSH, please see How-to: Connect via SSH (PuTTY, macOS terminal, X2Go)
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 desktop.
Connect to head-01.arcc.albany.edu with X-forwarding. To do this from X2Go with MATE desktop, open a terminal and run
Next, request an interactive allocation on the cluster using "srun". For more information, please see: How do I schedule an interactive job? Here, we are requesting one node on batch, with 12 cpus, 2GB of memory, a time limit of 8 hours, and --pty --x11.
Note: You can request access to the GPUs on --partition=batch or --partition=ceashpc by adding the following flag:
--gres=gpu:1 # For one GPU
--gres=gpu:2 # For two GPUs, given the NVIDIA K80's are 2 K40's with 24GB of shared memory
Now, we'll use the matlab module file to load matlab 2019a, via "module load matlab/2019a"
To see what modules are available, type "module avail"
- Finally, type "matlab" and the GUI will spawn