User:Jgt/sandbox matlab

From HPC Wiki
Jump to:navigation Jump to:search


Preliminaries

user $module keyword matlab
matlab/r2018a        : plot math graphics matlab
octave/4.2.1         : plot matlab octave
user $module load matlab
user $module load matlab/r2018a
user $module list
Currently Loaded Modulefiles:
  1) matlab/r2018a

Interactive Session - No GUI

user $srun -p float -n 2 --pty -t 03:00:00 bash
user $module load matlab
user $matlab -nodesktop -nodisplay -nosplash

                                               < M A T L A B (R) >
                                     Copyright 1984-2018 The MathWorks, Inc.
                                     R2018a (9.4.0.813654) 64-bit (glnxa64)
                                                February 23, 2018


To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.

>> disp('Hello, World!')
Hello, World!
>> helloWorld
Hello, World!

Interactive Session - GUI

To use the MATLAB graphical user interface (GUI) remotely, you will need to enable X11 forwarding over SSH by adding -X (Note: X is capitalized) to the ssh command when logging into Magnolia.

user $ssh user@magnolia.usm.edu -X

Once on Magnolia, start an interactive bash session by running the srun command below. This will create an interactive session on the float partition that uses two processors with a time limit of three hours. The --x11 flag has been added to enable X11 forwarding.

user $srun -p float -n 2 --pty --x11 -t 03:00:00 bash

Then make sure that you are not on one of the head nodes (magnolia01/magnolia02) and load the matlab module into the environment. Once this is complete, simply type matlab into the prompt and the GUI should appear on your desktop.

user $module load matlab
user $matlab
MATLAB is selecting SOFTWARE OPENGL rendering.

Non-Interactive Batch Job