Parallel Evaluation CONntroller:
Run Matlab in Parallel on your Linux/Unix Cluster
PECON (Parallel Evaluation CONtroller) is a very small, easy-to-use
Matlab class library that simplifies the task of parallelizing
existing Matlab programs. PECON exploits Matlab's Java Virtual
Machine to pass XML-encoded data structures between a central client
and several "compute servers", thereby avoiding reliance on
lower-level message-passing software. This arrangement is ideal for
"embarrassingly parallel" applications in which time is mainly spent
on computing results from small amounts of data.
PECON works on a multiprocessor machine or network running Unix, such as a
Beowulf cluster, standard Linux cluster, or multiprocessor Macintosh. All
processors must have access to the same file system. You must have version 6
or later of Matlab installed on this file system, and socket calls must be
enabled. You must be able to ssh to all the hosts that you wish to use,
without having to enter a password. In order to do this, run the following
commands from your home directory:
% ssh-keygen -trsa
(hit return to use defaults; including no passphrase)
% cd .ssh
% cp id_rsa.pub authorized_keys
To try out PECON, download and unzip the file
pecon.zip. Then download and unzip the
XML Toolbox. Change
startup.m to reflect where you put the resulting files, and make sure
to copy startup.m to any directory from which you want to run PECON.
To run PECON, you'll need to know the names of some nodes to which you
can ssh from the node on which you're running (because PECON
automatically calls ssh to run Matlab remotely on the nodes). Let's
say you have five such nodes, named alpha, bravo, charlie, delta, and
echo, and that your sysadmin prefers you to use port 15000 for
personal projects. You can then issue the following instructions in
Matlab.
>> p = pecon({'alpha', 'bravo', 'charlie', 'delta', 'echo'}, 'port', 15000)
After a brief startup period, Matlab should respond with
Server alpha: ready
Server bravo: ready
Server charlie: ready
Server delta: ready
Server echo: ready
You can then try (trivial) parallel evaluation of a function by doing
>> feval(p, @sqrt, {0, 1, 4, 9, 16, 25, 36, 49, 64, 81})
Matlab should respond with
ans =
[0]
[1]
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
You can shut down the servers by
>> halt(p)
Now you are ready to use PECON to parallelize existing Matlab functions
on your Linux/Unix system.
The utils directory contains a few utility functions for killing
errant servers, and partitioning and re-assembling matrices.
The technical paper describing PECON is available
here.
Please e-mail levys@wlu.edu with any question or complaints. Enjoy!