Matlab Distributed Computing Engine
From Yale HPC Wiki
The matlab distributed computing engine allows users to run matlab processes over cluster compute nodes in the same way standard applications use the cluster.
The matlab distributed computing engine is currently only installed on Bulldogh. If you want to use it on another cluster please Contact Us.
Contents |
Getting Started
Make a working directory in your home for matlab. Here we'll call it matlab_output
mkdir ~/matlab_output
Define a Configuration
The matlab parallel configuration GUI basically creates a matlab specific qsub shell script.
- Start Matlab 2008a with a GUI interface by running "/usr/local/cluster/software/matlab-2008a/bin/matlab" For help launching a GUI interface, see how-to Using_SSH_and_SFTP.
- Start the Configurations Manager from the MATLABĀ® desktop by clicking Parallel > Manage Configurations.
- Create a new configuration in the Configurations Manager dialog by clicking File > New > pbspro.
- In the Scheduler Configuration Properties dialog, provide text for the following fields:
- Set the Configuration name field to mytest.
- Set the Description field to "For testing installation".
- Set the Root directory of MATLAB to: /usr/local/cluster/software/matlab-dce
- Set the Directory where job data is stored to ~/matlab_output
- For resource list parameter set -l select=^N^
- For "Additional Command line arguments" set -q <queue name> where <queue name> is the queue you want to use.
The entire form should look like this:
Click OK to save your configuration.
Running a Job
OK, now that we have a way to submit a job, we just need something to submit. Here's a test script:
pmatlab_test.m
mpj = findResource('scheduler','configuration', 'mytest');
job = createJob(mpj)
createTask(job, @sum, 1, {[1 1]});
createTask(job, @sum, 1, {[2 2]});
createTask(job, @sum, 1, {[3 3]});
submit(job)
waitForState(job, 'finished', 60)
%% The 60 argument above says to wait up to 60 seconds for the job to start running.
%% If the cluster is busy this should be much higher.
results = getAllOutputArguments(job)
Save this file in your home directory and run it from the matlab desktop using "pmatlab_test". Matlab will submit a job to pbs, run the sum task on each of the given compute nodes and return a result.
Successful Output
A successful result should look like:
>> pmatlab_test
job =
Job ID 13 Information
=====================
UserName : jb723
State : pending
SubmitTime :
StartTime :
Running Duration :
- Data Dependencies
FileDependencies : {}
PathDependencies : {}
- Associated Task(s)
Number Pending : 0
Number Running : 0
Number Finished : 0
TaskID of errors :
results =
[2]
[4]
[6]

