Matlab use cases

From UABgrid Documentation
(Difference between revisions)
Jump to: navigation, search
(Use MATLAB on a compute node via VNC)
(Use MATLAB on a compute node via VNC: Updated text for easier navigation.)
Line 1: Line 1:
 
Some use cases describing how to offload MATLAB computation to the cluster.
 
Some use cases describing how to offload MATLAB computation to the cluster.
  
== Use MATLAB on a compute node via VNC ==
+
== Use Matlab on a compute node via VNC ==
  
This entails running a MATLAB client (GUI) via VNC on a compute node on [[Cheaha]].
+
This use case creates an ordinary Matlab session, just like you would on your desktop, however, instead of running MATLAB you your desktop, you run MATLAB on a compute node of the [[Cheaha|cluster]] and access it's GUI via your cluster desktop.  
  
This is a typical use case in the following scenarios
+
This is useful in situations where your personal desktop or laptop is not powerful enough to run your Matlab code or you simply want to offload a long-running computation so you can free your desktop or laptop for other activities.
# Computation needs to be offloaded to a compute node on the cluster to free the user's desktop for development
+
# Computation is too large to be performed on the user's desktop and needs more resources
+
  
The vnc session needs to be setup in two stages as described in [[Setting_Up_VNC_Session]].
+
=== Connect to Your Cluster Desktop ===
 +
The first step is to connect to an existing cluster desktop session via VNC.  Please follow the steps for [[Setting_Up_VNC_ Session|setting up a VNC session]] to create your cluster desktop and connect to it.
  
It will open a vnc window with a terminal on the cheaha.
+
=== Open a Terminal ===
 +
The second step is to open a terminal window on your cluster desktop.  Once you are connected to your cluster desktop, start the Terminal application from the cluster desktop menu Applications->Accessories->Terminal.
  
To portforward and login to a compute node use the following command from the terminal in the vnc session
+
=== Reserve your Computer ===
 +
The third step is to request a computer on which you can run Matlab.  In your cluster desktop terminal window, submit a resource request to reserve a compute node for running Matlab
 
<pre>
 
<pre>
$ qlogin -l vf=memory,h_rt=hr:min:sec
+
qlogin -l vf=1G,h_rt=4:00:00
 
</pre>
 
</pre>
 +
The above resource request asks for a computer with 1 gigabyte of RAM for 4 hours.  You can adjust these values to suit your needs but you should try to make reasonable estimates to ensure that resources are shared fairly.  WARNING: the specified time limit is a hard boundary and can't be changed after you start Matlab.  When this time limit is reached, your Matlab session will be automatically stopped, without warning, by the cluster resource manager.
  
Load the mathworks module and start matlab  
+
=== Start Matlab ===
<pre>$ module load mathworks/R2012a  
+
The fourth and final step is to start Matlab on the compute resource you have reserved.  In the same terminal window from which you made the resource request (ie. ran "qlogin"), run the following commands to start matlab.
$ matlab
+
<pre>
 +
module load mathworks/R2012a  
 +
matlab
 
</pre>
 
</pre>
MATLAB will now start interactively in the VNC session and is running on the compute node on Cheaha.
 
 
  
 +
Matlab will be running your reserved compute resource and can be controlled interactively via the VNC session.  This Matlab session works just like the Matlab sessions on your personal desktop or laptop. When you are finished using Matlab, simply exit the application as you normally would.  Your compute resource will automatically return to the resource pool at the end of the your requested reservation time or you can type "exit" to return it immediately.
  
 
{{MATLAB Support}}
 
{{MATLAB Support}}
  
 
[[Category:MATLAB]]
 
[[Category:MATLAB]]

Revision as of 11:53, 6 February 2013

Some use cases describing how to offload MATLAB computation to the cluster.

Contents

Use Matlab on a compute node via VNC

This use case creates an ordinary Matlab session, just like you would on your desktop, however, instead of running MATLAB you your desktop, you run MATLAB on a compute node of the cluster and access it's GUI via your cluster desktop.

This is useful in situations where your personal desktop or laptop is not powerful enough to run your Matlab code or you simply want to offload a long-running computation so you can free your desktop or laptop for other activities.

Connect to Your Cluster Desktop

The first step is to connect to an existing cluster desktop session via VNC. Please follow the steps for setting up a VNC session to create your cluster desktop and connect to it.

Open a Terminal

The second step is to open a terminal window on your cluster desktop. Once you are connected to your cluster desktop, start the Terminal application from the cluster desktop menu Applications->Accessories->Terminal.

Reserve your Computer

The third step is to request a computer on which you can run Matlab. In your cluster desktop terminal window, submit a resource request to reserve a compute node for running Matlab

qlogin -l vf=1G,h_rt=4:00:00

The above resource request asks for a computer with 1 gigabyte of RAM for 4 hours. You can adjust these values to suit your needs but you should try to make reasonable estimates to ensure that resources are shared fairly. WARNING: the specified time limit is a hard boundary and can't be changed after you start Matlab. When this time limit is reached, your Matlab session will be automatically stopped, without warning, by the cluster resource manager.

Start Matlab

The fourth and final step is to start Matlab on the compute resource you have reserved. In the same terminal window from which you made the resource request (ie. ran "qlogin"), run the following commands to start matlab.

module load mathworks/R2012a 
matlab

Matlab will be running your reserved compute resource and can be controlled interactively via the VNC session. This Matlab session works just like the Matlab sessions on your personal desktop or laptop. When you are finished using Matlab, simply exit the application as you normally would. Your compute resource will automatically return to the resource pool at the end of the your requested reservation time or you can type "exit" to return it immediately.

MATLAB Support / Mailing List

As with any application or computer language, learning to use MATLAB to analyze data or to develop or modify MATLAB applications is an individual responsibility. There is ample application documentation available from the Mathworks website, potential outreach to colleagues who also use MATLAB, and options for consultation with Mathworks. Mathworks also host on-campus training seminars several times a year and provides many on-line learning tutorials.

Installation support for MATLAB at UAB is provided by your local IT support organization and the Docs wiki.

Mathworks Website

Your first and best option for application-specific questions on MATLAB is to refer to the on-line MATLAB documentation. The Mathworks site also provides a a support matrix and an on-line knowledge base.

UAB MATLAB Wiki

The MATLAB page on the Docs wiki is the starting point for installing MATLAB at UAB and, optionally, configuring it to use cluster computing. All users are encouraged to contribute to the MATLAB knowledge in this wiki, especially if you see areas where improvements are needed. Remember, this knowledge base is only as good as the people who contribute to it.

Contributing to the wiki is as easy as clicking the login link on the top-right of the page and signing in with your UAB BlazerID. If you are unsure about making an edit, you can make suggestions for improvement on the page's Discussion tab or discuss the proposed improvement in the MATLAB user group.

UAB MATLAB User Group

At UAB, MATLAB installation support is provided by your local IT support group. Support for application specific questions is available from peers in your research group. We realize that some people are not as familiar with MATLAB as others. For this reason, we have established a MATLAB user forum (mailing list) where users of MATLAB at UAB can help answer each others questions.

This is a network of volunteers sharing their knowledge with peers. You are encouraged to reach out to this community for questions on using MATLAB by

Archives of MATLAB user group discussions are available on-line at https://vo.uabgrid.uab.edu/sympa/arc/matlab-user. You may find your question is already answered in these archives.


UAB MATLAB announce mailing list

To receive information about UAB's MATLAB license and announcements please subscribe to the matlab-annc mailing list by

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox