Page History

Turn Off History

This is a very early draft, basically a dump of an email exchange I'm currently (May 2011) having with a user (condor-admin 22124).


Matlab is an excellent match for Condor. Millions of Matlab jobs, possibly tens of millions, have been successfully run under Condor over the years. The specifics of working with Matlab will vary from site to site, but here are some general guidelines.

This assumes basic familiarity with Matlab and Condor. It assumes that you can set up and maintain at least a small Condor pool.

Licensing

Perhaps the biggest challenge to running Matlab under Condor is licensing. Matlab is proprietary software with strict licensing terms. You might have one or two licenses for your desktop computers, but to run hundreds of simultaneous Matlab jobs you would require hundreds of licenses.

Your institution may already have acquired suitable licensing for Matlab. If you have a fixed number of licenses available, Condor's Concurrency Limit support can help.

Another option is the Matlab Compiler. The Matlab Compiler is an optional package for Matlab. In general, executables created with the Matlab Compiler are not subject to Matlab's license; you are free to run as many in parallel in possible. (Check your Matlab licensing to confirm this.)

If you are using third party Matlab add-ons, you will need to check the licensing on them as well.

Executables

You will need to make the Matlab executable and supporting libraries available on any computers on which your jobs might run on. You might install Matlab on each computer, install it on a shared filesystem, or bring Matlab along with you.

For executables compiled with the Matlab Compiler, instead of the full Matlab install, you will need the MCR, the Matlab Compiler Runtime, but the general techniques are the same.

If you install Condor locally on each machine, it is recommended to place Matlab in the same location on each machine. That way individual jobs can easily find it. If Condor will be in different locations on each machine, you can set up STARTD_ATTRS to advertise the correct location, then the job can use a $$ expression to find it. For example, your configuration file might say:

MATLAB_PATH  = /opt/matlab/bin
STARTD_ATTRS = MATLAB_PATH

A user might specify in their submit file (simplified):

executable = my_task
arguments = $$(MATLAB_PATH)
transfer_input_files= my_task.m
queue

my_task would then be a script that did something like this:

#! /bin/sh
exec "$1"/matlab -nodisplay ./my_task.m

Similar scripts would work on Windows.

Installing on a shared filesystem is identical to installing it on each local computer, but may be less complicated for administration.

To bring Matlab along yourself, you would need to package it up, bring it along (transfer_input_files), then have a script unpack Matlab and start it. Matlab is a large piece of software, and this could be slow. It will also temporarily use a bunch of disk space with a copy of Matlab. If multiple Matlab jobs run on the same machine simultaneously, multiple copies of Matlab will be installed at once. Generally speaking this is not recommended, although it is more practical for the MCR.

Invoking

Additional Resources

Many other sites are using Matlab under Condor. Here are links to the documentation from just a few.