Parallel and distributed computing with Raspberry Pi clusters

This academic experiment using Raspberry Pi clusters introduces parallel and distributed computing (PDC) concepts to distance learning students.
1 reader likes this.
Raspberries with pi symbol overlay

Dwight Sipler on Flickr

Since the Raspberry Pi's launch, creators have based countless computer science education projects on the humble pocket-sized system on a chip. These have included many projects exploring low-cost Raspberry Pi clusters to introduce parallel and distributed computing (PDC) concepts.

The UK Open University (OU) provides distance education to students of diverse ages, experiences, and backgrounds, which raises some issues not faced in more traditional universities. The OU experiment using Raspberry Pi clusters to introduce PDC concepts to distance learning students began in 2019 and has been featured in an academic paper but deserves to be known more widely.

The project uses Raspberry Pi clusters based on the OctaPi instructions, released under a Creative Commons Licence by GCHQ. Eight Raspberry Pis are connected in a private network using a router and a switch. One of the Raspberry Pis acts as the lead, while the others are servers providing results back to the lead device. Programs written in Python run on the lead Pi, and the dispy package distributes activities across cores in the cluster.

Three programs have been developed for the clusters, and you can download them from the Git repository.

Two of the programs are text-based and linked to search problems: The traveling salesperson and password hashing. As complete search problems, these are ideal for teaching PDC concepts. The third program is graphical. The image combiner takes three images as input, with non-overlapping obstructions. It constructs an image without any obstructions by comparing the RGBA values pixel-by-pixel across the three images and selecting the median.

Using the cluster

The Open University is a distance learning institution, so students access the clusters through a web interface. Remote access to the clusters uses the OpenSTEM Labs infrastructure at the university. Ten clusters (eight built with Pi 4, two built with Pi 3B+) are installed into racks, with webcams pointed at each cluster.

The students select which program to run, the number of cores to use, and the parameters for the selected program. As output, they see the time the program takes to run on an individual Raspberry Pi compared to the cluster using the number of cores selected. The student also sees the output from the program, either the password hashing result, the minimal and maximal traveling salesperson route, or the non-occluded image.

Generating a fourth image from information in three images

(Peter Cheer, CC BY-SA 4.0)

A webcam shows a live stream of the cluster. The lead Pi has an LED display to show the program's state as it runs. The webcam makes it clear to students that they are experimenting with real dedicated hardware rather than getting simulated or pre-recorded results.

Raspberry Pi cluster

(Peter Cheer, CC BY-SA 4.0)

Each program has two activities associated with it, illustrating different aspects of program design and PDC operations. One of the main learning points is that PDC computing can provide significant performance advantages but at a cost in the time and resources taken to divide and distribute a problem and, in reverse, to recombine the results. The second learning point is that efficiency is significantly affected by the program design.

Students like it

Currently, the use of the Raspberry Pi clusters is optional. Based on the findings so far, though, students enjoy it and are motivated by having remote access to physical hardware.

One student has said, "It was really interesting to be able to use real clusters instead of having it virtualized."

Another adds, "It was really exciting to be able to actually see a cluster working and see the real effects of working with multiple cores. It was great to be able to try this out for myself, not just to read the theory about it!"

Students are using the clusters to undertake learning activities designed to teach the principles of PDC rather than writing and running their own programs. The experience of developing a low-cost Raspberry Pi cluster for use with open-distance university students demonstrates the benefits remote practical activities can have for teaching PDC concepts and engaging students.

When I asked Daniel Gooch, one of the team members behind the project, about it, he said: "For me, where we differ is that we've taken an existing set of Raspberry Pi instructions and worked on integrating in additional wrap-around material to ensure it can cope with the distance and scale we operate on."

User profile image.
Peter Cheer | Visimpscot is my assistive technology software training business working with website developers and people who have cognitive, sensory or physical impairments.I started life as an archaeologist before retraining in IT and have wide experience of work in the voluntary / not for profit and continuing education sectors in Scotland where I am usually based.

Comments are closed.

Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.