Parallel Raspberry Pi Programming

A nascent blog on building a RPi cluster.

We shall enable a small number of Raspberry Pis to undertake distributed parallel computing by employing an MPI implementation for Python (mpi4py) and setting up a local network between the Raspberry Pi units.This work was on behalf of our client Dave Topping.

Having played about, with much thanks to other posts out there about setting up a "bramble", we were looking to obtain a tight process for setting up our cluster, and to help others set up one similarly. After a bit of experimentation we have we have come up with a process that only requries

  • an image to burn to each (micro) SD cards -- contains Raspbian base image plus a couple of packages
  • a single tarball of "variable" networking files
  • a single bash script to run on each Raspberry Pi

The image actually includes the scripts and tarballs we have written. It also contains pre-defined SSH keys. By burning the image to a set of micro SD cards, putting one in each Raspberry Pi and following a simple procedure we end up with a working cluster. The procedure is as simple as

  1. burn image to each Raspberry Pi
  2. unpack the "variable" networking files on each
  3. run the provided "setupNetworking.sh" script on each Raspberry Pi, passing a unique integer ID (0,1,2,3 for example) to the script on each Raspberry Pi
  4. reboot

and that is all there is to it! (We also provide a script to reset the networking back to the original settings.)

We shall shortly provide the source for the script and an image you can burn to the (mico) SD card for your Raspberry Pi, along with full instructions for wiring up the Raspberry Pi units for both power and interconnectivity.

(If you cannot wait then email us at pi@highendcompute.co.uk)