Hprc banner tamu.png

SW:Matlab app

From TAMU HPRC
Jump to: navigation, search




HPRC developed a toolbox to run your Matlab script directly on HPRC (ada and terra) compute nodes from your own laptop and/or desktop. The toolbox contains the infrastructure to submit jobs from the Matlab command window as well as an App that can be used to submit jobs


Installing the toolbox

You can download the app here. After downloading install it from within the Matlab GUI by double-clicking on the file (or right-click and select install). After installing, the toolbox will show up as HPRC toolbox and the App will show up under the APPS tab under the name TAMU HPRC.

Using the App

You can start the HPRC app from the APPS tab. Alternatively, you can start the App by typing HPRC on the Matlab command line. The App window will popup and will look like:


Hprcapp.png


  • Click on the Browse button to select the MATLAB script you want to run. It will open a file selection dialog. You can also type the name of the script directly. NOTE: the file does not have to be in the current directory.
  • Select the cluster where you want to run (terra or ada) and provide your username (should be your TAMU netid).
  • In case your MATLAB script uses GPU commands/functions, check the Code Uses GPU box
  • Click on the Attach Input Files button to include any input files your script needs. It will open a file selection window where you can (multi) select files to include.


In addition to selecting the script name and the cluster/user there are many other options you can specify in the app (e.g. #workers in case you are running a parallel script, expected walltime needed, amount of memory needed, etc). For a detailed description of all the options, click here


To submit the script click on the SUBMIT button. A new window will popup that will show information about the job submission process.

NOTE: The first time you submit a script You will be asked to select a local directory where MATLAB will store Job information (a directory selection dialog will popup)

Retrieving results

Once the script has been successfully submitted a variable named myjob of MATLAB type Job will be copied to the workspace. You can use this variable to retrieve information about the job and retrieve varialbes. For example:

  • myjob.State will show the current status of the job. This can be queued , running, or finished
  • myjob.diary will display all the redirected screen output from your Matlab run.
  • myjob.load will load all the variables from your Matlab run into the current workspace

In addition, you can also get the Job information through the Parallel Job monitor (click Parallel --> Monitor Jobs). Use TAMUREMOTE cluster profile to see the corresponding jobs.

If you have any save commands in your script, the files will be saved in remote directory /scratch/user/${USER}/MatlabJobs/WORKDIR/. These files will not be copied back to your desktop/laptop.

Considerations for Using the App

The app can be used to run any general serial and/or parallel script. It's especially recommended for serial/multithreaded runs, MATLAB scripts that use GPU code, need a long time to run and/or need a large amount of memory. For license considerations, the app is most suitable when either a limited number of workers are requested or more than 20 workers (on ada, 28 on terra). The reason for this is that every additional worker requires an additional MDCS license token. If you run your code directly on the cluster and all workers can be started on a single node only a single license token is required)

In addition, consider the following:

  • input data (and script) needs to be transferred from the local host to the cluster. If data is large, it might take some time to transfer.
  • scripts and input data will be stored in the local temp dir, which has limited capacity. If input data is too large it might not fit in the temp dir
  • generated variables will be transferred back to the local host. If data is large it might take some to transfer