HowTo:matlab

From CAC Wiki
Revision as of 18:06, 30 May 2016 by Hasch (Talk | contribs) (Location of the program and setup)

Jump to: navigation, search

MATLAB

This is a short help file on using the high-level language code "Matlab" on our machines.

Important: The Centre for Advanced Computing does currently not have a stand-alone Matlab license. This means that users who wish to use MATLAB on our systems have to provide a valid license. This may require a connection to an external license server, or the purchase of a local license file.

The software is only made available to persons who belong to a specific Unix group. See details below.

Features

From the Matlab web page: "MATLAB® is a high-level technical computing language and interactive environment for algorithm development, data visualization, data analysis, and numeric computation. [...] You can use MATLAB in a wide range of applications, including signal and image processing, communications, control design, test and measurement, financial modeling and analysis, and computational biology. Add-on toolboxes (collections of special-purpose MATLAB functions, available separately) extend the MATLAB environment to solve particular classes of problems in these application areas."

Here is a list of features, also from the webpage:

  • High-level language for technical computing
  • Development environment for managing code, files, and data
  • Interactive tools for iterative exploration, design, and problem solving
  • Mathematical functions for linear algebra, statistics, Fourier analysis, filtering, optimization, and numerical integration
  • 2-D and 3-D graphics functions for visualizing data
  • Tools for building custom graphical user interfaces
  • Functions for integrating MATLAB based algorithms with external applications and languages, such as C, C++, Fortran, Java, COM, and Microsoft Excel
  • The full Matlab program and most Toolboxes are installed on our systems, but the license for their usage is supplied by the user.

Location and Setup

The present version of Matlab is R2014a for Linux. The programs in the Matlab package are located in the directory /opt/matlab. Matlab processes should only be run in batch mode through our Gridengine scheduler.

Note that many of the Matlab Toolboxes are installed on our clusters. Users who have a pre-existing Matlab license can submit and run serial Matlab jobs on our cluster nodes. We do not hold a so-called DCS (Distributed-Compute Server) license and can therefore not run parallel MATLAB jobs.

It is required that you sign a statement if you want to use MATLAB. We will confirm this statement, and you will then be made a member of a Unix group "matlab", which enables you to access the software. Contact us if you are in doubt of whether you will be able to run Matlab on our system.

To set the proper environment variables and include the directories with the binaries in your PATH, you should type:

use matlab

To avoid having to do this before every Matlab session, you may also include this command in your setup file, e.g. .bash_profile. Finally you may have to point an environment variable LM_LICENSE_FILE to the proper license file:

export LM_LICENSE_FILE=lic_file

Here lic_file stands for the full path and file name of your license file. You need to make sure that the latter cannot be accessed by anyone but you. This command may of course also be placed into a setup file to avoid retyping.

Since the Matlab licenses are specific to the user (as the user is who supplies them), it is possible that specific set-ups are required, and the simple "use" command won't work. In this case, please get in touch and we modify the set-up to work with your specific case.

Running from a command line

The core of Matlab is a high-level programming language and an interactive programming/computing environment. Since you have to be a licensed user of Matlab to run Matlab programs on our machines, it is possible for you to either allow us access to an external license server, or to move your license file to our systems. In either case, you are responsible for maintaining the license.

Here, we discuss how to run an interactive Matlab session on one of our servers such as the workup/login node swlogin1. We assume that you are included in the "matlab" Unix group, and therefore have proper access to /opt/matlab where the software resides.

Once Matlab usage is set up properly, you only need to type

matlab

to start the GUI of the Matlab programming environment. Issuing the command with the -nodisplay will give you a command-line version that does not use the GUI.

Batch jobs

In many cases, you will run Matlab in batch mode. Interactive work should be done elsewhere, whereas the computationally more intensive runs could be executed on our clusters.

Production jobs on HPCVL clusters are submitted via the GridEngine, which is a load-balancing software. To obtain details, read our Gridengine Help File. For a Matlab batch job, this means that you have to prepare a job script and you have to call Matlab without the Graphical User Interface. If you encounter issues with preparing such a script, please contact us for assistance.

Where can I get more detailed information ?

Matlab is a complex software package, and requires some practice to be used efficiently. In this FAQ we can not explain its use in any detail.