parallel computing example with raspberry pi cluster
TRANSCRIPT
![Page 1: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/1.jpg)
Parallel Computing Examplewith
Raspberry Pi Cluster
![Page 2: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/2.jpg)
IBM’s Blue Gene
Image source : https://en.wikipedia.org/wiki/Blue_Gene
![Page 3: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/3.jpg)
Blue Gene’sScalingArchitecture
Image source : https://en.wikipedia.org/wiki/Blue_Gene
![Page 4: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/4.jpg)
Image source : https://www.element14.com/community/docs/DOC-80899/l/raspberry-pi-3-model-b-technical-specifications
![Page 5: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/5.jpg)
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.
![Page 6: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/6.jpg)
Image source : http://www.zdnet.com/article/build-your-own-supercomputer-out-of-raspberry-pi-boards/
![Page 7: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/7.jpg)
Our poor cluster architecture (but works like a charm)
pi00 pi01 pi02
Switch
![Page 8: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/8.jpg)
A Raspberry Pi 3 B as Master +2x Raspberry Pi 1 B as NodesEach :
- 700 (up to 1000) Mhz ARMv6 processor
- 256 MB RAM- 16 GB flash storage- Ethernet- Other standart ports
![Page 9: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/9.jpg)
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
![Page 10: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/10.jpg)
mpi4pyMPI (Message Passing Interface) binding for Python, one program to rule them all (distributed system).
Some of the features :
- Send- Receive- Broadcast- Scatter- Gather
![Page 11: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/11.jpg)
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
![Page 12: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/12.jpg)
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
![Page 13: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/13.jpg)
Artifical Intelligence
Bread First Search Pathfinding
![Page 14: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/14.jpg)
![Page 15: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/15.jpg)
Bi-directional BFS Pathfinding
![Page 16: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/16.jpg)
![Page 17: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/17.jpg)
ScatterMaster : Hei piSatu, kerjakan tugas, mulai dari titik A. Eh piDua, sini, kerjakan mulai dari titik Z. Tolong kerja sama yang baik!
![Page 18: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/18.jpg)
Inter-node communication via masterpiSatu : 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!
![Page 19: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/19.jpg)
GatherMaster : Sudah? Sini kumpulin!
piSatu : ABCDEFGHIJKLMO
piDua : ZYXWVUTSRQPO
Master : ABCDEFGHIJKLMNOPQRSTUVWXYZ
![Page 20: Parallel Computing Example with Raspberry Pi Cluster](https://reader034.vdocuments.mx/reader034/viewer/2022051503/589fb68a1a28abf9038b5d8f/html5/thumbnails/20.jpg)
Thank you