**MATLAB **is a technical computing environment for high-performance numeric computation and visualization. MATLAB integrates numerical analysis, matrix computation, signal processing, and graphics in an easy-to-use environment where problems and solutions are expressed just as they are written mathematically--without traditional programming.

MATLAB is available on Pitzer and Owens Clusters. The versions currently available at OSC are:

Version | Owens | Pitzer | Notes |
---|---|---|---|

2015b | X | ||

2016b | X | ||

2017a | X | ||

2018a | X | X | |

2018b | X | X | |

2019a | X | ||

2019b | X | X | |

2020a | X* | X* |

* Current default version

You can use `module spider matlab`

to view available modules for a given machine. Feel free to contact OSC Help if you need other versions for your work.

Any academic users at OSC can use Matlab. All users must be added to the license server before using MATLAB. Please contact OSC Help to be granted access.

MathWorks, Commercial (University site license)

To load the default version of MATLAB module, use

`module load matlab `

. For a list of all available MATLAB versions and the format expected, type: `module spider matlab `

. To select a particular software version, use `module load matlab/version `

. For example, use `module load matlab/r2015b `

to load MATLAB version r2015b. The following command will start an interactive, command line version of MATLAB:

matlab -nodisplayIf you are able to use X-11 forwarding and have enabled it in your SSH client software preferences, you can run MATLAB using the GUI by typing the command

`matlab `

. For more information about the matlab command usage, type `matlab –h `

for a complete list of command line options.
The commands listed above will run MATLAB on the login node you are connected to. As the login node is a shared resource, running scripts that require significant computational resources will impact the usability of the cluster for others. As such, you should not use interactive MATLAB sessions on the login node for any significant computation. If your MATLAB script requires significant time, CPU power, or memory, you should run your code via the batch system.

When you log into owens.osc.edu you are actually logged into a Linux box referred to as the login node. To gain access to the multiple processors in the computing environment, you must submit your job to the batch system for execution. Batch jobs can request multiple nodes/cores and compute time up to the limits of the OSC systems. Refer to Queues and Reservations and Batch Limit Rules for more info.

sinteractive -A <project-account> -N 1 -n 28 -t 00:20:00

which requests one whole node with 28 cores ( `-N 1 -n 28 `

), for a walltime of 20 minutes ( `-t 00:20:00 `

). Here you can run MATLAB interactively by loading the MATLAB module and running MATLAB with the options of your choice as described above. You may adjust the numbers per your need.

MATLAB supports implicit multithreading on a single node.

Multithreading allows some functions in MATLAB to distribute the work load between cores of the node that your job is running on. By default, all of the current versions of MATLAB available on the OSC clusters have multithreading enabled.

The system will run as many threads as there are cores on the nodes requested.

Multithreading increases the speed of some linear algebra routines, but if you would like to disable multithreading you may include the option " `-singleCompThread `

" when running MATLAB. An example is given below:

#!/bin/bash #SBATCH --job-name disable_multithreading #SBATCH --time=00:10:00 #SBATCH --nodes=1 --ntasks-per-node=28 #SBATCH --account=<project-account> module load matlab matlab -singleCompThread -nodisplay -nodesktop < hello.m # end of example file

To load the default version of MATLAB module, use

`module load matlab`

.The following command will start an interactive, command line version of MATLAB:

matlab -nodisplayIf you are able to use X-11 forwarding and have enabled it in your SSH client software preferences, you can run MATLAB using the GUI by typing the command

`matlab`

. For more information about the matlab command usage, type `matlab –h`

for a complete list of command line options.
The commands listed above will run MATLAB on the login node you are connected to. As the login node is a shared resource, running scripts that require significant computational resources will impact the usability of the cluster for others. As such, you should not use interactive MATLAB sessions on the login node for any significant computation. If your MATLAB script requires significant time, CPU power, or memory, you should run your code via the batch system.

When you log into pitzer.osc.edu you are actually logged into a Linux box referred to as the login node. To gain access to the multiple processors in the computing environment, you must submit your job to the batch system for execution. Batch jobs can request multiple nodes/cores and compute time up to the limits of the OSC systems. Refer to Queues and Reservations and Batch Limit Rules for more info.

sinteractive -A <project-account> -N 1 -n 40 -t 00:20:00

which requests one whole node with 40 cores ( `-N 1 -n 40`

), for a walltime of 20 minutes ( `-t 00:20:00 `

). Here you can run MATLAB interactively by loading the MATLAB module and running MATLAB with the options of your choice as described above. You may adjust the numbers per your need.

MATLAB supports implicit multithreading on a single node.

Multithreading allows some functions in MATLAB to distribute the work load between cores of the node that your job is running on. By default, all of the current versions of MATLAB available on the OSC clusters have multithreading enabled.

The system will run as many threads as there are cores on the nodes requested.

Multithreading increases the speed of some linear algebra routines, but if you would like to disable multithreading you may include the option " `-singleCompThread`

" when running MATLAB. An example is given below:

#!/bin/bash #SBATCH --job-name disable_multithreading #SBATCH --time=00:10:00 #SBATCH --nodes=1 --ntasks-per-node=40 #SBATCH --account=<project-account> module load matlab matlab -singleCompThread -nodisplay -nodesktop < hello.m # end of example file

When you run multiple jobs concurrently, each job will try to access your preference files at the same time. It may create a race condition issue and may cause a negative impact on the system and the failure of your jobs. In order to avoid this issue, please add the following in your job script:

export MATLAB_PREFDIR=$TMPDIR

It will reset the preference directory to the local temporary directory, `$TMPDIR`

. If you wish to start your Matlab job with the preference files you already have, add the following before you change `MATLAB_PREFDIR`

.

cp -a ~/.matlab/{matlab version}/* $TMPDIR/

If you use `matlab/r2020a`

, your matlab version is "R2020a".

A GPU can be utilized for MATLAB. You can acquire a GPU by

#SBATCH --gpus-per-node=1

for Owens, or Pitzer. For more detail, please read here.

You can check the GPU assigned to you using:

gpuDeviceCount # show how many GPUs you have gpuDevice # show the details of the GPU

You can replace an array to gpuArray, for example:

A = gpuArray(A)

where A is a regular MATLAB array. This transfers the array data to the GPU memory. Then, you can use the gpuArray variable in GPU supported built-in functions. You can find the full list of GPU supported built-in functions from here. For more information about GPU programming for MATLAB, please read "GPU Computing" from Mathworks.

OSC's current licenses support the following MATLAB toolboxes and features (please contact OSC Help for license-specific questions):

MATLAB Simulink 5G Toolbox AUTOSAR Blockset Aerospace Blockset Aerospace Toolbox Antenna Toolbox Audio Toolbox Automated Driving Toolbox Bioinformatics Toolbox Communications Toolbox Computer Vision Toolbox Control System Toolbox Curve Fitting Toolbox DDS Blockset DSP System Toolbox Data Acquisition Toolbox Database Toolbox Datafeed Toolbox Deep Learning HDL Toolbox Deep Learning Toolbox Econometrics Toolbox Embedded Coder Filter Design HDL Coder Financial Instruments Toolbox Financial Toolbox Fixed-Point Designer Fuzzy Logic Toolbox GPU Coder Global Optimization Toolbox HDL Coder HDL Verifier Image Acquisition Toolbox Image Processing Toolbox Instrument Control Toolbox LTE Toolbox Lidar Toolbox MATLAB Coder MATLAB Compiler SDK MATLAB Compiler MATLAB Report Generator Mapping Toolbox Mixed-Signal Blockset Model Predictive Control Toolbox Model-Based Calibration Toolbox Motor Control Blockset Navigation Toolbox OPC Toolbox Optimization Toolbox Parallel Computing Toolbox Partial Differential Equation Toolbox Phased Array System Toolbox Powertrain Blockset Predictive Maintenance Toolbox RF Blockset RF PCB Toolbox RF Toolbox ROS Toolbox Radar Toolbox Reinforcement Learning Toolbox Risk Management Toolbox Robotics System Toolbox Robust Control Toolbox Satellite Communications Toolbox Sensor Fusion and Tracking Toolbox SerDes Toolbox Signal Integrity Toolbox Signal Processing Toolbox SimBiology SimEvents Simscape Driveline Simscape Electrical Simscape Fluids Simscape Multibody Simscape Simulink 3D Animation Simulink Check Simulink Code Inspector Simulink Coder Simulink Compiler Simulink Control Design Simulink Coverage Simulink Design Optimization Simulink Design Verifier Simulink Desktop Real-Time Simulink PLC Coder Simulink Real-Time Simulink Report Generator Simulink Requirements Simulink Test SoC Blockset Spreadsheet Link Stateflow Statistics and Machine Learning Toolbox Symbolic Math Toolbox System Composer System Identification Toolbox Text Analytics Toolbox UAV Toolbox Vehicle Dynamics Blockset Vehicle Network Toolbox Vision HDL Toolbox WLAN Toolbox Wavelet Toolbox Wireless HDL Toolbox

See this page if you need to install additional toolbox by yourself.

Official PDF documentation can be obtained from the MathWorks Website.

Service:

Fields of Science:

**SPM** is made freely available to the [neuro]imaging community, to promote collaboration and a common analysis scheme across laboratories. The software represents the implementation of the theoretical concepts of Statistical Parametric Mapping in a complete analysis package.

The **SPM** software is a suite of MATLAB (MathWorks) functions and subroutines with some externally compiled C routines. SPM was written to organise and interpret our functional neuroimaging data. The distributed version is the same as that we use ourselves.

The following versions are available on OSC clusters:

VERSION |
Pitzer |
---|---|

8 |
X |

12.7771 | X* |

* Current default version

`spm/12.7771`

comes with `CONN 0.19`

and `xjview 9.7`

`spm/8`

comes with `CONN 0.19`

, `xjview 9.7`

, and `Marsbar 0.44`

You can use `module spider spm`

to view available modules for a given machine. Feel free to contact OSC Help if you need other versions for your work.

SPM is available to all OSC users. If you have any questions, please contact OSC Help.

*SPM* is free but copyright software, distributed under the terms of the **GNU General Public Licence** as published by the Free Software Foundation (either version 2, as given in file `LICENCE.txt`

, or at your option, any later version). Further details on "**copyleft**" can be found at https://www.gnu.org/copyleft/. In particular, SPM is supplied as is. No formal support or maintenance is provided or implied.

To configure your environment for use of SPM, run the following command: `module load spm`

. The default version will be loaded. To select a particular AFNI version, use `module load spm/version`

. For example, use `module load spm/12.7771`

to load SPM/12.7771.

SPM is a MATLAB suite, so you need to load MATLAB before you can use SPM:

module load matlab/r2020a module load spm/12.7771 or module load matlab/r2020a module load spm/8

Note that `spm/12.7771`

comes with `CONN 0.19`

and `xjview 9.7`

, and `spm/8`

comes with `CONN 0.19`

, `xjview 9.7`

, and `Marsbar 0.44`

. `Marsbar 0.44`

doesn't support `spm/12.7771`

.

Supercomputer:

Service:

Fields of Science: