Matlab Distributed Computing Engine (DCE) - Example Job Submissions
Article Index
Matlab Distributed Computing Engine (DCE)
Cluster Matlab Job Submission
Job Types Demystified (sort of)
Prototyping Your Parallel Functions
Example Job Submissions
Other Job Submission Options
Known Errors and Limitations
All Pages

Example Job Submission

The fsuClusterMatlab function can be called with any number of arguments, but if you want the default argument, you must leave an empty vector as a placeholder. It is beneficial to pass a separate directory for job output because the DCE creates multiple '.mat' files and a job subdirectory that holds task state, logs, and output. Please ensure that the function you are sending into fsuClusterMatlab is in your Matlab path. The simplest place to put your function is in '~/matlab' directory (automatically included in your Matlab path). If your submission fails or the results are unexpected, read the log file. Matlab creates a directory structure of input, output, and log files under a job number directory, e.g.:

cd ~/matlab/jobs/Job22/
cat Job22.Task1.log

License checkout failed.
License Manager Error -4
Maximum number of users for MATLAB_Distrib_Comp_Engine reached.
Try again later.

To pass arguments into your function, there are three choices:

  1. results = fsuClusterMatlab( ..., @jobfunction, 1, 2, 3 )
    • If this is a single simple job or a parallel job, the arguments will be passed in once
    • If this is multiple simple jobs (numworkers > 1), the same arguments will be passed to each task. E.g., if I request 5 workers, '1,2,3' will be passed five times to five separate jobfunctions.
  2. results = fsuClusterMatlab( ..., @jobfunction, {1,2,3} )
    • Passes a Matlab cell to your job function, same conditions as the previous example.
  3. results = fsuClusterMatlab( ..., @jobfunction, {{1,2,3} {4,5,6} {7,8,9}} )
    • Three separate inputs will be passed to three simple tasks
    • Fails with a parallel job (only one task is created with a parallel job)

Examples of function use: fsuClusterMatlab(outputdir, walltime, jobtype, waitforresults, numworkers, jobfunc, jobfuncargs)

results = fsuClusterMatlab()
  • A simple job with one worker (cpu) and you will be prompted for a job function to pass in
  • Writes job files to current directory
  • Walltime of one hour
  • Waits in the Matlab client for results to be returned
results = fsuClusterMatlab('~/matlab/clustertest',[],'p','n',10,@colsum)
  • A Matlabpool Parallel job with ten workers
  • Writes job files in the user's home ~/matlab/clustertest
  • Walltime of one hour ( Note the blank placeholder [] )
  • Does not wait for results
  • The job function '@colsum' with no arguments is passed in
results = fsuClusterMatlab([],'-l walltime=4:00:00','s',[],3,@parMagic,{{100,5} {200,10} {300,15}})
  • A simple job with three workers
  • Writes job files to current directory
  • Walltime of four hours
  • Waits for results
  • The job function '@parMagic' with three separate arguments passed in (one set for each task)
results = fsuClusterMatlab('~/matlab/jobs',[],'m','n',16,@bigarrays,rand(1))
  • An mpi parallel job with 16 workers (max seats if available)
  • Writes job files to home ~/matlab/jobs directory
  • Default Walltime of one hour
  • Does not wait for results
  • The job function '@bigarrays' with one random number argument passed in

**NOTE** If you choose not to wait for your results (waiting locks up your current matlab client session), you have to manually retrieve them by going to the directory you submitted as your output directory, changing into the "JobNumber" directory, then load the TaskNumber.out.mat file. For Example (from the matlab prompt):

cd ~/matlab/jobs/Job141
load Task1.out.mat
whos
Name         Size            Bytes  Class    Attributes

results      1x1               912  cell

celldisp(results)

results{1} =

  18    25     2     9    16
  24     6     8    15    17
   5     7    14    21    23