Parallel Computing Example
with
Raspberry Pi Cluster
IBM’s
Blue Gene
Image source : https://en.wikipedia.org/wiki/Blue_Gene
Blue Gene’s
Scaling
Architecture
Image source : https://en.wikipedia.org/wiki/Blue_Gene
Image source : https://www.element14.com/community/docs/DOC-80899/l/raspberry-pi-3-model-b-technical-specifications
A computer cluster consists of a set of loosely or tightly
connected computers that work together so that, in many
respects, they can be viewed as a single system.
Image source :
http://www.zdnet.com/article/build-your-own-supercomputer-out-of-raspberry-pi-boards/
Our poor cluster architecture
(but works like a charm)
pi00 pi01 pi02
Switch
A Raspberry Pi 3 B as Master
+
2x Raspberry Pi 1 B as Nodes
Each :
- 700 (up to 1000) Mhz ARMv6
processor
- 256 MB RAM
- 16 GB flash storage
- Ethernet
- Other standart ports
Build steps
- Minimal foot print operating system (minibian)
- Connect them all in one subnet
- Seamless SSH access across nodes
- Install MPI library and its dependencies
- Distribute the program to each node
mpi4py
MPI (Message Passing Interface) binding for Python,
one program to rule them all (distributed system).
Some of the features :
- Send
- Receive
- Broadcast
- Scatter
- Gather
Basic MPI code structure
from mpi4py import MPI
comm = MPI.COMM_WORLD # Initiate communitacor
rank = comm.Get_rank() # Get the identity / label
if rank == 0 :
# I am master
# Communicate to other nodes
else :
# Do something as worker
# Communicate to other nodes
MPI execution across network
root@pi00:~$ mpiexec -n 3 --host pi00,pi01,pi02 ./program.py
Total node The node
hostname,
defined in
/etc/hosts
Parallel
computing
program
Artifical Intelligence
Bread First Search Pathfinding
Bi-directional BFS Pathfinding
Scatter
Master : Hei piSatu, kerjakan tugas, mulai dari titik A.
Eh piDua, sini, kerjakan mulai dari titik Z.
Tolong kerja sama yang baik!
Inter-node communication via master
piSatu : Sudah sampai O belom?
piDua : Beloman. Baru sampai R.
piSatu : Aku sudah dekat O nih.
piDua : Eh aku sudah sampai ke O.
piSatu : Sip! Aku sudah di O juga. Stop!
Gather
Master : Sudah? Sini kumpulin!
piSatu : ABCDEFGHIJKLMO
piDua : ZYXWVUTSRQPO
Master : ABCDEFGHIJKLMNOPQRSTUVWXYZ
Thank you

Parallel Computing Example with Raspberry Pi Cluster