parallel computing example with raspberry pi cluster

20
Parallel Computing Example with Raspberry Pi Cluster

Upload: herpiko-dwi-aguno

Post on 13-Apr-2017

108 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Parallel Computing Example with Raspberry Pi Cluster

Parallel Computing Examplewith

Raspberry Pi Cluster

Page 2: Parallel Computing Example with Raspberry Pi Cluster

IBM’s Blue Gene

Image source : https://en.wikipedia.org/wiki/Blue_Gene

Page 3: Parallel Computing Example with Raspberry Pi Cluster

Blue Gene’sScalingArchitecture

Image source : https://en.wikipedia.org/wiki/Blue_Gene

Page 4: Parallel Computing Example with Raspberry Pi Cluster

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

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

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

Our poor cluster architecture (but works like a charm)

pi00 pi01 pi02

Switch

Page 8: Parallel Computing Example with Raspberry Pi Cluster

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

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

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

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

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

Artifical Intelligence

Bread First Search Pathfinding

Page 14: Parallel Computing Example with Raspberry Pi Cluster
Page 15: Parallel Computing Example with Raspberry Pi Cluster

Bi-directional BFS Pathfinding

Page 16: Parallel Computing Example with Raspberry Pi Cluster
Page 17: Parallel Computing Example with Raspberry Pi Cluster

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

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

GatherMaster : Sudah? Sini kumpulin!

piSatu : ABCDEFGHIJKLMO

piDua : ZYXWVUTSRQPO

Master : ABCDEFGHIJKLMNOPQRSTUVWXYZ

Page 20: Parallel Computing Example with Raspberry Pi Cluster

Thank you