Running MATLAB on Condor

The RCC Condor Cluster can execute your MATLAB scripts. Unlike a workstation with MATLAB, the Condor cluster will execute Matlab scripts in batch mode. Condor will automatically copy your script onto a server, execute the program, and return the results to you.

How to run a MATLAB job on Condor

Your Matlab job will consist of three files:

None of the names matter, but it is good practice that the BASH script ends with .sh and the submit file ends with .submit to keep consistent with general convention.

Create your matRun.sh BASH script:

#!/bin/bash
/opt/matlab/current/bin/matlab -nosplash -nodesktop -nojvm -r "run('./YOUR_SCRIPT.m'); quit"

Create your YOUR_SCRIPT.submit file:

universe = Vanilla
Executable = matRun.sh
Arguments = 
input = 
requirements = (OpSys =="LINUX" && Arch =="X86_64" && Matlab == "true")
Rank = memory
should_transfer_files = YES 
transfer_input_files = YOUR_SCRIPT.m
when_to_transfer_output = ON_EXIT 
notification = Complete
notify_user = YOUR_EMAIL@fsu.edu
Output = $(Process).out 
Log = $(Process).log
Queue 1

See our documentation for submit files for details about what these directives mean. The salient pieces for Matlab are:

  • Executable = matRun.sh - This runs the BASH file you created in Step 1.
  • Matlab == "true" - This instructs Condor to execute your job only on servers that have MATLAB installed.
  • transfer_input_files = YOUR_SCRIPT.m - Required; copy your Matlab script when the Condor job runs.

Ensure all of your files are in your Lustre home directory, and then run condor_submit YOUR_SCRIPT.submit.

The output from successful execution of your script will appear when the Condor job completes. See Condor Job Management to keep tabs on your script while it is queued and executing.