MATLAB Training at TAMUQ 2016

From TAMUQ Research Computing User Documentation Wiki
Jump to navigation Jump to search


Training modules

  1. Parallel computing with MATLAB (Day 01-02)
  2. Optimization techniques in MATLAB (Day 03)
  3. Machine learning with MATLAB (Day 04)
  4. Interfacing MATLAB with C Code (Day 05)

Training Dates, timings and Venue

  1. Day 01 - 30th May Lab # 228F (08am to 12pm) and Lab # 245 (12pm to 4pm)
  2. Day 02 - 31st May Lab # 213F (08am to 12pm) and Lab # 245 (12pm to 4pm)
  3. Day 03 - 1st June Lab # 228F (08am to 12pm) and Lab # 245 (12pm to 4pm)
  4. Day 04 - 2nd June Lab # 228F (08am to 12pm) and Lab # 245 (12pm to 4pm)
  5. Day 05 - 3rd June Lab # 228F (08am to 04pm)

Requirements

  1. We expect attendees to bring their own laptops and we will help you setting up software stack before training. If you don’t have a laptop or you feel the performance of your laptop is not satisfactory, please let us know at mustafa.arif@qatar.tamu.edu
  2. Users who don’t have RAAD account, should apply for at http://technology.qatar.tamu.edu/rc/suqooraccrequest.aspx
  3. The required MATLAB version is MATLAB R2016a, users should install this on their laptops from P:\Office of Research\Research Computing\RC\Matlab\R2016a_Windows
  4. You also need to Install Microsoft Visual Studio 2010 SP1. Setup files are located here "P:\Office of Research\Research Computing\RC\VisualStudio\2010ProSP1". Installation is simple and straight forward.
  5. It is highly recommended to go through a refresher session of MATLAB with some practice before you appear for this training. This will help us to focus more on advance topics rather than fundamentals. Let us know if you need help in this.

Software requirements

  1. MATLAB R2016a "P:\Office of Research\Research Computing\RC\Matlab\R2016a_Windows" Or MATLAB R2015a "P:\Office of Research\Research Computing\RC\Matlab\R2015a_windows"
  2. Microsoft Visual Studio 2010 Service Pack 01 "P:\Office of Research\Research Computing\RC\VisualStudio\2010ProSP1"

Training Material

  1. From TAMUQ Domain laptop "P:\Office of Research\Research Computing\RC\Matlab Training"
  2. From other computer: "\\tamuqfiles\project\Office of Research\Research Computing\RC\Matlab Training"
  3. On HPC Cluster issue below command. Data will be copied in your home directory under training_material directory.
cp -R /panfs/vol/opt/matlab/training_material ~/

Note: Do not copy paste any command listed below, manually type each command.

Using Trial license on Desktop or Laptop

Open Command Prompt and type below and hit enter;

matlab -c "P:\Office of Research\Research Computing\RC\Matlab Training\network.lic"

Using MATLAB on RAAD

You can use RAAD to port your MATLAB compute intensive applications. You can use MATLAB either in batch or Interactive mode(With Graphical interface). In training, we will be using Interactive session of MATLAB. You must have installed MobaXterm on your laptops.

  1. Open MobaXterm and select "Start Local Terminal"
  2. Type below;
ssh -X user_name@raad.qatar.tamu.edu
  1. Once you have logged in to RAAD, you can follow below guidelines for GPU and MDCS with MATLAB.

MATLAB with GPU

We have 6 Graphics nodes in GPU Cluster with 12 Nvidia TESLA K20 (Kepler) GPUs in total. Each node gfx1 - gfx6 have 02 GPUs. To use Matlab with GPU, you need to have access to HPC Cluster. Once you login to RAAD, you need to submit an interactive job requesting access to GPU nodes.

qsub -IV -l select=1:ncpus=8:mem=16gb -l walltime=08:00:00 -q queue_name

queue_name will be provided during the training.

Copy training material to your home directory, Issue below commands

cp -R /panfs/vol/opt/matlab/training_material ~/

You will be assigned one of those 6 nodes. Now you need to load MATLAB module to setup environment.

module load matlab/r2015a

Now load CUDA Libraries

module load cuda/7.0

Now launch MATLAB interactively;

alias matlab="matlab -c /panfs/vol/opt/matlab/R2015a/licenses/matlab-demo.lic”
matlab &

Before running any program on GPU, you need to select GPU Index to make sure you are using a dedicated GPU. Issue below command on MATLAB Command Line

tq_gpuindex

MATLAB Distributed Computing Server

You can run MATLAB code over multiple nodes using Matlab Distributed Computing server.

Submit an interactive Job on RAAD to launch MATLAB Graphical session

qsub -IV -l select=1:ncpus=2:mem=4gb -l walltime=02:00:00 -q queue_name

You will be assigned one of the computing nodes. Now you need to load MATLAB module to setup environment.

module load matlab/r2015a

Now launch MATLAB interactively;

alias matlab="matlab -c /panfs/vol/opt/matlab/R2015a/licenses/matlab-demo.lic”
matlab &

Now you can setup MDCS Profile. This will allow you to setup more workers over multiple nodes from MATLAB.

Setting up MATLAB Distributed Computing Server

  1. From the assigned compute node, launch the matlab GUI (we are using R2015a)
  2. On the Home Tab, under the Environment section, click Parallel dropdown menu --> Manage Cluster Profiles --> click the Add button --> Custom --> PBS Pro
  3. Use something like /panfs/vol/f/muarif092/mdcs-test as the JobStorageLocation value. This is specific to user muarif092, and accessible on all cluster nodes. Use a location appropriate for your RAAD account.
  4. Set NumWorkers to as per your computational needs. For training purpose, do not set more than 4
  5. Set ClusterMatlabRoot to /panfs/vol/opt/matlab/R2015a
  6. Set SubmitArguments to -q queue_name –V
  7. Set HasSharedFilesystem to true
  8. Set value of Resource template to: -l select=^N^:mem=2gb -l walltime=24:00:00
  9. Finally, in the section entitled “Additional PBSPro Properties”, use the value ssh for the parameter RshCommand.
  10. Save the profile and switch to the "Validation Results" tab. Click Validate button. All tests should pass.
  11. Make this profile default for Distributed Jobs submission.

Using this cluster profile (and modifying it according to job needs) you should be able to launch distributed MATLAB jobs on RAAD.