MATLAB: Configuring Remote Submission

This page contains instructions for submitting jobs from MATLAB to ARC clusters. There are two options:

  1. Submit from a remote machine (e.g. your laptop). This option allows you to avoid direct interaction with the cluster, but is a little bit more difficult to set up. This option requires that you have Matlab R2015a or later on your machine.
  2. Submit from a cluster login node. This option is less troublesome to set up and manage, but requires learning how to access and transfer files to and from the cluster from outside MATLAB. This option does not require that you have the same version of Matlab on your machine as on the cluster.

Note: You will need an ARC account before you are able to submit jobs to the cluster.

Submit From Your Computer

Configure Matlab support files for remote submission

  1. Download the appropriate files for your release of Matlab:
    Version Support Files
    R2016b, R2016a, R2015b, R2015a Zip File
  2. Close Matlab if it is open.
  3. Unzip the zip archive and copy the contents to the local toolbox directory. Note: Make sure the contents (*.m files, etc) are directly in the toolbox/local directory and not in a subdirectory therein.
    • Windows: The default local toolbox location is C:\Program Files\MATLAB\(Version Number)\toolbox\local
    • Mac OS X: The default local toolbox location is /Applications/MATLAB_(Version Number).app/toolbox/local. In order to view or edit the contents of the application package, open /Applications in a Finder window. Then right-click the application and select “View Package Contents.” Then navigate to the appropriate directory.
  4. Open Matlab.
  5. Run the setup script by typing
    parallelProfile

    at the MATLAB command line and follow the instructions. (Note: The path to your jobs folder on the ARC cluster should not include spaces.)

  6. If the script completes successfully, your profile should be complete.

Validate the profile

The best way to validate your profile is to simply walk through the step-by-step example for remote MATLAB submission provided here.

Submit From A Cluster Login Node

Create the MATLAB parallel profile

  1. Log into the cluster that you want to use (e.g., NewRiver or BlueRidge).
  2. Open MATLAB. This can be done through browser-based access on NewRiver or via the command line by entering:
  3. module load matlab
    matlab
    
  4. Run the profile setup script by typing
    parallelProfile

    at the Matlab command line and follow the instructions. (Note: The path to your jobs folder should not include spaces.)

  5. If the script completes successfully, your profile should be complete.

Validate the profile

The best way to validate your profile is to simply walk through the step-by-step example for remote MATLAB submission provided here.

Example

Here is a start-to-finish example of setting up intracluster submission on NewRiver and then submitting a job (using the prime number example):

[johndoe@nrlogin2 ~]$ module purge; module load matlab/R2015a
[johndoe@nrlogin2 ~]$ matlab -nodisplay

                                                                       < M A T L A B (R) >
                                                             Copyright 1984-2015 The MathWorks, Inc.
                                                              R2015a (8.5.0.197613) 64-bit (glnxa64)
                                                                        February 12, 2015

 
To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.
 

	Academic License

>> parallelProfile
Initiating MATLAB version R2015a setup for submission to an ARC cluster...
Detected that you are on login node (nrlogin2). Configuring for intracluster submission...

Enter the folder in your cluster home directory where you would like MATLAB 
to track your jobs. Make sure that this location exists, but is not a 
folder that you use regularly.
/home/johndoe/matlab/R2015a/internal
Profile newriver_R2015a already exists. Would you like to overwrite it, rename it, or cancel setup? Type 'Overwrite', 'Rename', or 'Cancel': Overwrite

Created cluster profile newriver_R2015a.

ans =

newriver_R2015a

>> cd '~/matlab/prime'
>> PBSClusterInfo.setExtraParameter('-l walltime=0:10:00 -q open_q');
>> my_job = batch ( 'prime_script', 'Profile', 'newriver_R2015a', 'Pool', 23 );
-l nodes=1:ppn=24 -W group_list=newriver -q normal_q -l walltime=0:10:00 -l software=MATLAB_Distrib_Comp_Engine+24
>> my_job.State

ans =

queued

>> my_job.State

ans =

running