Using Matlab
MATLAB® is a high-level language and interactive environment for numerical computation, visualization, and programming. Using MATLAB, you can analyze data, develop algorithms, and create models and applications. The language, tools, and built-in math functions enable you to explore multiple approaches and reach a solution faster than with spreadsheets or traditional programming languages, such as C/C++ or Java™
See Computational model for running Matlab on a shared Cluster
License information
MATLAB is product licensed by Mathworks. The MATLAB product and related toolboxes are usually installed requiring access to the UD license server and requires a persistent network connection as well as UD VPN when accessing off-campus. When MATLAB is started a license token is checked out from the license server. Each toolbox function also requires the availability of a license token to start during a MATLAB session. The UD license server currently has tokens (number of licenses) for core MATLAB and about 50 toolboxes.
The Mathworks R2013b and newer license server is being queried every 6 minutes on each cluster for available seats licensed for Matlab, Simulink and associated toolboxes.
Project directory
MATLAB is a language for scientific computing. A MATLAB project consists of a main program, called a MATLAB script, that when executed will read data, call MATLAB functions, and write data. This data may be in the form of text files, image files, MATLAB save files (MAT-file), or any of many standard file formats, e.g., HDF5. To keep your project portable you should put your scripts, functions and data in one directory. This directory is called the Current Folder on the MATLAB desktop.
MATLAB has tools to help you make your project portable, and you should use them. For example, you should specify all files using MATLAB file construction functions.
Your preferences at
MATLAB → General → MAT-files
may have a older MAT-file save format selected as the default. You should check to make sure you can save large files (greater than 2GB) for all versions of MATLAB where you may write .mat
files. There is another advantage to using the newest file format:
When you have a MATLAB job tested and debugged in a project directory, you are ready run on a cluster.
See cluster details for examples on running your Matlab job on a particular cluster.
Parallel job
You can use multicore or multiprocessor MATLAB for your project. There are three ways do this using the cluster scheduler and/or MATLAB toolboxes.
Array job
Multiple, independent, single-threaded MATLAB scripts can be run on the same node, or different nodes. The only communication between the jobs is through reading and writing files. Your script should be compiled using mcc
so it can be deployed on the cluster to run in a MATLAB Runtime environment.
Multiple computational threads
MATLAB will detect you are on a multicore host and use all the cores it can to speed up its internal calculations. Use MATLAB builtin functions to take advantage of these multiple computational threads. You should scedule a computing node with exclusive access, so your job does not interfere with other jobs on the node.
Parallel computing toolbox
Using the MATLAB Parallel Computing Toolbox you can create a pool of workers and take control of the parallelism in your algorithm using MATLAB functions such as parfor
. You can run this on one node using the default local scheduler, but the real benefit comes with a separate Mathworks product called the MATLAB Distributed Computing Server