Q. How Can I Run Matlab jobs under Condor?
A. The general procedure is to create an M-file for the job, create a submit file and then submit the job for execution.
This must be done from a
CAE linux or Unix workstation. Condor on CAE Windows machines cannot run Matlab.
Steps
- Create an M-file for the Matlab script that you want to run.
Your M-file should operate entirely in text mode, outputting either directly to a file
or just printing to the screen. Let's say your file is called mat.m
- Create a condor submit file.
This file tells Condor information such as what program to run,
where to get the input, and where to store the output. A basic example is:
#
# Submit a matlab job
#
Executable = /afs/engr.wisc.edu/apps/bin/matlab
Arguments = -nodisplay
Universe = vanilla
Getenv = True
Log = mat.log
Output = mat.out
Error = mat.err
Input = mat.m
Queue 1
Save this to a file named mat.condor
Explaination of this file:
The Executable line specifies the full path of the
Matlab program at CAE (you can get this path directly by entering "which matlab"
at a command prompt.) The second line gives the command line arguments to Matlab, which in
this case simply mean run text-only. The Universe and
Getenv lines indicate that we are running a vanilla (non Condor-compiled) program
that should have the standard environment variables set.
The Log through Input lines specify I/O files relative to the current
working directory. Finally the Queue line means submit 1 job. You could include multiple Queue lines in the file, telling Condor to submit the job multiple times with
different input files.
For large numbers of jobs, you might also add the line:
Requirements = OpSys == "LINUX" || OpSys == "SOLARIS29"
This will allow your job to run on both Linux and Unix computers (by default Condor only executes jobs on the same architecture from which you originally submitted the job.)
- Submit the job.
On any CAE Unix or linux computer enter:
condor_submit mat.condor
This will submit your job for processing. You can check the status of the job by running
"condor_q" or by checking the mat.out, mat.log and mat.err files.
You should receive an email when the job is finished.
For more information, check the CAE
Condor documentation or the
Condor Project website.