Versions Compared

Key

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

...

It is now possible to run MATLAB in O2 with its Desktop GUI interface using PORT forwarding and a standard web browser. To start your MATLAB web-GUI instance you first need connect to O2 forwarding a PORT:

Code Block
languagenone
~ % ssh -L PORT:127.0.0.1:PORT hms_id@o2.hms.harvard.edu	 

where PORT is a number you choose randomly between 50000 and 60000 and hms_id is your username (formerly known as Ecommons).

Once you logged in the next step is to load the MATLAB module (2021b or later) and submit the MATLAB GUI job with the Slurm --tunnel option and executing the script MATLAB_launcher.sh PORT,

for example:

Code Block
languagenone
@login05:~ module load matlab/2021b
@login05:~ srun -t 6:00:00 --pty -p interactive -c 1 --mem=4G --tunnel PORT:PORT MATLAB_launcher.sh PORT

where PORT is the same number you used above.

Once the job is dispatched you should see a printout similar to:

Code Block
languagenone
INFO:MATLABProxyApp:MLM_LICENSE_FILE with value: /n/app/matlab/2021b/licenses/network.lic is a path to a file. MATLAB will attempt to use it.
INFO:MATLABProxyApp:Deleting any cached licensing files!
INFO:MATLABProxyApp:
==============================================================================================================================================================================================================================================
                                                                                                          MATLAB can be accessed at:
                                                                                      http://localhost:54122/matlab/JFSBwbThf4Y0wwZgBtdYRQ==/index.html
==============================================================================================================================================================================================================================================
MATLAB is selecting SOFTWARE OPENGL rendering.

and you will also see a standard MATLAB command line shell.

At this point you can copy the web address displayed under MATLAB can be accessed at: in your local web browser and you should see a screen like:

...

which can last up to several minutes, followed by the informative message:

...

which you can close and eventually arrive to the familiar MATLAB GUI interface

...

In the rare case you selected a PORT number that is already been used you might see an error message like “port PORT is in use or unavailable”, if this happen start this process over selecting a different PORT number.

...

our O2 Portal MATLAB applications. For more information please check our O2Portal wiki