Peer-to-peer distributed Matlab computing – update

After discussing in detail with colleagues at the Donders and at the FIL, I have implemented the peer-to-peer distributed computing toolbox for MATLAB. Most of the desired functionality is now in place, and it seems to work robustly and efficiently.

The peer toolbox allows you to do something like this in MATLAB

a = randn(400,400);
tic; cellfun('pinv', {a, a, a, a, a}, 'UniformOutput', false); toc
tic; peercellfun('pinv', {a, a, a, a, a}, 'UniformOutput', false); toc

where the first cellfun is the standard MATLAB function which evaluates the jobs serially, whereas the second peercellfun evaluates the jobs in parallel. This assumes that the user has started a number of peerslaves on his computer, or on computers that can be reached through the network.

The peer-to-peer design ensures that peer masters and slaves discover each other automatically. Furthermore, it allows dynamic changes to the peer network, i.e. nodes being added or removed will not negatively affect the distributed computations.

Besides having a peerslave function implemented in a MATLAB *.m file, there is now also a peerslave command-line executable which starts the MATLAB engine whenever a job (or series of jobs) needs to be executed. The command-line peerslave allows one to start many slaves on distributed network of computers (e.g. a linux cluster), without the peerslaves actually using a MATLAB license unless needed. Of course for each engine that is engine is started, a license is required.

The full description of the development is here on the FieldTrip wiki. Please note that the end-user documentation still has to be improved, but probably it can already be used as it is.

What remains to be done is to improve the compilation procedure on Windows 32-bit and Windows 64-bit versions of MATLAB. The peer toolbox has successfully been tested on the 5 node 8-core linux cluster at the ESI, using 40 command-line peerslaves (one per core), simultaneously executing the ft_preprocessing function from the FieldTrip toolbox.

2 thoughts on “Peer-to-peer distributed Matlab computing – update

Leave a Reply

Your email address will not be published. Required fields are marked *