Advanced AOS Project Report

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 9

Beowulf Cluster of Raspberry Pi

Submitted To:

Submitted By:

Introduction
Beowulf Clusters provide ability to build immersive simulations and compute
complex problems. These clusters provide a powerful computing ability, but are
usually out of reach for most people, due to complexity and little knowledge available
on internet. Various similar tasks can be performed on smaller, cheaper computers
which allow users to learn about Beowulf clusters without the need for expensive
equipments.
The Raspberry Pi provides an excellent alternative for the nodes used in Beowulf
clusters, the small form factor and economical price (around $45) allow us to purchase
some of these and place them on a network to simulate Beowulf clustering. A cluster
of Raspberry Pis is generally referred to as bramble. However, connecting multiple
Raspberry Pis together via Ethernet does not make them functional; operating system
is required to coordinate between other nodes.

Raspberry Pi
(RPi) Raspberry Pi is a small, economical single board computer that is capable of
running Linux and other operating systems which run on ARM processors. The
Raspberry Pi has a single-core ARM1176 processor, running at 700MHz though
overclocking is supported and include a Videocore-4 GPU. Figure shows a few details
on the Raspberry Pi capabilities.

Building the System


In order for our devices to communicate with one another, we need to set up the
networking hardware and cable connections. We will also need to connect the
necessary peripherals in order to interact with the Raspberry Pi's boot loading
software. There are only five major components needed for a working cluster:

Two Ethernet/RJ45 network cables


A network switch
Internet connection
Two SD cards that is compatible with the (RPi)
Computer Hardware (RPi)
Linux OS
MPI library

HDMI-capable monitor or VGA/DVI monitor and adapter


The Raspberry Pi provides two easy options for connecting visual display units. This
is via the RCA jack, that allows you to attach the Raspberry Pi to a TV and an HDMI
port for connecting HD TV's and HD monitors to the Raspberry Pi.

Micro-USB power units


When it comes to powering the Raspberry Pis, we need two 1-Amperes at 5-Volts
power units with USB hub or micro USB connectors and two micro USB cables.

Ethernet/RJ45 network cables


In order to set up your parallel system, we need network cables. If we want to add
more Raspberry Pi units in the future, we will need one additional cable per Pi.
One network cable will connect your switch to your modem and the other two cables
will connect your Raspberry Pis to the switch.

Two SD cards that are compatible with the Raspberry Pi


The Raspberry Pi device uses a Secure Digital card (SD card) in order to boot.
Therefore, we will need two Raspberry Pi-compatible SD cards in order to install and
run operating system for Raspberry Pi.

Configuring the Cluster


The following are needed to configure and powering up Raspberry Pi safely:
1. Download the Raspbian Image and burn the Raspbian Image to your SD card.

2. Eject your SD card from your computer and place it into the SD card port of the
Raspberry Pi.
3. Plug in the mouse and keyboard to the USB ports. We will need these in order to
complete the operating installation process.
4. Hook up the monitor to the HDMI port.
5. Connect the Raspberry Pi to the switch and set the hostname to Pi01.
6. Now power up your Raspberry Pi by connecting the micro-USB power unit to it.
7. Overlock the Pi to 800 MHz, enable SSH and split memory to 16mb for graphics.

Platform

Cost

OS

CPU

Cores

MHz

Raspberry Pi

$45

Linux ARM

ARM 1176JZF

700

Building MPI
MPI (Message Passing Interface) is a software that is used for multi-processing
communication among computers. Message Passing Interface utilizes TCP/IP along
with some libraries to let programmers to build parallel programs that can split a task
into parts suitable to execute on several machines concurrently. MPI provides an API
that enables both asynchronous and synchronous process interaction.

To install MPI on your Raspberry Pi, first make sure you have a proper Internet
connection going to the Pi. Then follow these Terminal Commands.

To Refresh the list of packages in your cache use this command


sudo apt-get update

Make a directory using below commands to put the sources in


mkdir mpich2
cd ~/mpich2
Unpacking Files

wget http://www.mpich.org/static/downloads/3.1/mpich-3.1.tar.gz
tar xfz mpich-3.1.tar.gz
sudo mkdir /home/rpimpi/
sudo mkdir /home/rpimpi/mpi-install

Build Directory using following commands to keep the source directory clean.
mkdir /home/pi/mpi-build
Changing Build Directory
cd /home/pi/mpi-build
Configuring the Build.
sudo apt-get install gfortran
sudo /home/pi/mpich2/mpich-3.1/configure -prefix=/home/rpimpi/mpi-install
Make and Install the Files.
sudo make
sudo make install
nano .bashrc
Select the path for Installation
PATH=$PATH:/home/rpimpi/mpi-install/bin
Use following commands to check it installed it or not
which mpicc
which mpiexec

Get your IP Address using $ipconfig and save your IP address in a file.
Now reboot your system
sudo reboot
mpiexec -n 1 hostname
These commands will download and install MPI library and add it as a path to your
boot file. The final command runs a test to see if it works. If the final command
returns Pi01, then we did everything successfully. Now you should have MPICH
installed on every RPis.

Use SSH instead of Password


By using SSH (Secure Shell) all nodes can find each other and have password less
SSH access to communicate one another.
$ cd ~
$ ssh-keygen -t rsa
$ ssh-keygen -t dsa
$ ssh-keygen -t edsa

Conclusion
Although the Raspberry Pi may be lacking in processing power, but this processing
power can be increased by adding more Raspberry Pis they serve as an excellent
replacement for nodes in a high performance computing cluster. Overall, the RPis do
serve their function; a cheap, functional computing platform that can run as a fully
fledged computer. At the end we have a cluster with two cables going into it, one for
network and the other for power. You can plug into any network and the top node will
describe its external Internet Protocol address, which allows us to SSH into it, all the
nodes also share a disk. We can use it as a desktop Hadoop cluster. From here we can
do some other things, the most obvious next step is to add some SNMP monitoring,
and an external facing status dashboard on the top node to examine the cluster
health. However in the long term, the remaining Ethernet port on the switch means
that we can expand the cluster by adding Raspberry Pis and Cards.

You might also like