Distributed Computing with the Raspberry Pi

Distributed computing technology breaks a problem into parallel tasks running on two or more computers. With the convergence of low-cost processors and high speed networks, computer clusters have emerged as an affordable solution to do-it-yourself high-availability. In this experiment, multiple miniature computers are connected to perform distributed computing.

The Raspberry Pi Organization (raspberrypi.org) offers a pocket-sized single-board computer for approximately $35 USD. Several versions of the free Linux operating system are available for the Raspberry Pi.

The mini Linux (Raspbian/Debian) computer group is further compacted by latching the computers together.

Another Raspberry Pi is added to the computer group. Each computer has a colored cable (yellow, orange, red, purple).

For each computer, static IP addresses are assigned.

cat /etc/network/interfaces
iface eth0 inet dhcp
sudo ifconfig

Make note of the inet addr, bcast, and mask.
sudo route -nee

Make note of the gateway address.

Interfaces file can be updated to set static information with nano.

sudo nano /etc/network/interfaces

Delete ""iface eth0 inet dhcp" and add the following:

iface eth0 inet static
address 192.168.1.???

*??? placeholder for number you select

Ctrl+X, then Y to save.

Example of IP addresses for 4 computers:

With static IP addresses configured, the University of Cambridge hosts a tutorial on computation between 2 computers. Python source code included: Distributed Computing Demo (Cambridge)

Each computer requires MergeSort.py and Merge1.py. The host machine will have MergeServer.py and the client machine will have MergeClient.py. When tested on my distributed computers, the following results were returned (10 seconds vs. 7.87 seconds):