MATLAB at WestGrid

Table of Contents

Introduction

About MATLAB

MATLAB is a general-purpose high-level programming package for numerical work such as linear algebra, signal processing and other calculations involving matrices or vectors of data. Visualization tools are also included for presentation of results. The basic MATLAB package is extended through add-on components including SIMULINK, and the Image Processing, Optimization, Neural Network, Signal Processing, Spline and Wavelet Toolboxes.

MATLAB Licensing on WestGrid

There are two methods of accessing MATLAB on WestGrid systems, as determined by the type of licensing.  On some WestGrid systems there is a "normal" MATLAB distribution, which is run using donated academic licenses from individual institutions, including the University of Calgary, University of British Columbia and Simon Fraser University. Under the terms of those licenses MATLAB jobs can be run by researchers from Calgary only on the Terminus cluster hosted at Calgary, UBC researchers only on the UBC machines and SFU researchers only on SFU machines.  However, in late 2009, WestGrid purchased a new 64-worker "consortium" license for the MATLAB Distributed Computing Server.  The consortium license allows researchers from Canadian academic institutions who have licensed the Parallel Computing Toolbox (or have access to it through a local server) to submit jobs to a WestGrid cluster, even if it is not located at their home institution.

The notes below relate to using the Distributed Computing Server license.  Instructions for using MATLAB under the donated academic licenses are given on a separate page.

Using MATLAB with the consortium license

introduction

If you own a Parallel Computing Toolbox license and would like to get started using the MATLAB Distributed Computing Server environment on Orcinus, please contact WestGrid technical support.  U of C and SFU users do not have to have their own Parallel Computing Toolbox licenses, as these are available on local servers (Terminus and Snowpatch, respectively).  Other institutions may also provide this support.

Basic instructions will be added to this web site as researchers begin to use the consortium license. In the meantime, to get a feeling for what is involved in setting up and using MATLAB through the Distributed Computing Server, you could refer to the MathWorks web site at http://www.mathworks.com/products/parallel-computing/ and to the links below to instructions at other Canadian consortia.  There are differences in the details due to different batch scheduling environments and other factors.  For example, WestGrid does not allow passwordless SSH keys that are mentioned or implied in these documents.  Job submission does require the use of SSH keys, but, these must have a password.

http://www.sharcnet.ca/Documents/tutorials/MATLAB/

http://wiki.ace-net.ca/index.php/Matlab_Instructions 

Using public key authentication to connect to Orcinus

The MATLAB Parallel Computing Toolbox uses the SSH (secure shell) network protocol to log in to Orcinus to execute commands (such as qsub for submitting batch jobs).   Similarly, the SCP (secure copy) protocol is used for transferring files back and forth between Orcinus and the system on which the Parallel Computing Toolbox is running. It would be very cumbersome to be prompted for a password every time MATLAB needed to execute a remote command or transfer a file.  This can be avoided by using public key authentication.  With this method, you have to enter your WestGrid password only once during a session in which you are submitting MATLAB jobs.

Before attempting to use the Parallel Computing Toolbox for remote MATLAB job submission on Orcinus, you should set up public key authentication and verify that you can use it connect to Orcinus with an SSH client and a (secure copy) file transfer client.  The details of how you do that depend on what type of system (Linux, Microsoft Windows, MacOS X, ...) you are using.

In brief, for Linux and Macintosh systems, you generate keys with ssh-keygen (making sure that you use a pass phrase) and transfer the public key to the .ssh/authorized_keys file on Orcinus.  Then, whenever you want to submit MATLAB jobs, you run commands like ssh-agent /bin/bash and ssh-add key_file (which should prompt you for the pass phrase associated with your ssh key) before starting MATLAB.  On Microsoft Windows systems the idea is similar, in that you need to generate ssh keys and install the public key in .ssh/authorized_keys on Orcinus and then request that ssh/scp connections use the installed keys. However, the key generation and management software does not come pre-installed.  Typically, PuTTY is used, as described here.

Distributed Computing Server - basic concepts

As mentioned above, the MATLAB Parallel Computing Toolbox is used to control job submission when using the Distributed Computing Server installation of MATLAB on Orcinus. Details of these MathWorks products are available on their web site, including a user's guide for the Parallel Computing Toolbox.  There is also an administrator's guide for the Distributed Computing Server, but, most end users will not need to look at that.


Updated 2010-09-02.