SlideShare a Scribd company logo
CLUSTERING
MANUAL
Parallel Computing
ABSTRACT
Clustering is way to connect two or more
computers with each other in such a way they
behave like one single computer. It’s
necessary for parallel processing, load
balancing, and fault tolerance which is called
parallel computing. This manual shows the
steps to establish clustering in Linux OS.
Khandaker Mamun Ahmed
IIT, Dhaka University
Contents
1 Introduction........................................................................................................ 1
2 What is clustering?.............................................................................................. 1
3 Why do we cluster? ............................................................................................ 1
4 How do we cluster multiple pcs’? ....................................................................... 1
4.1 What is MPI and MPICH? ............................................................................. 2
5 How to set npich2 cluster in Ubuntu?................................................................. 2
5.1 Defining hostnames ..................................................................................... 2
5.2 Defining a user for running MPI programs ................................................... 2
5.3 Installing ssh server...................................................................................... 5
5.4 Generate Rsa key pair for communicating the computers ........................... 5
5.5 Installing GCC and mpich2............................................................................ 6
5.6 Setting up the machinefile ........................................................................... 6
5.7 Testing ......................................................................................................... 6
6 Problem I have faced .......................................................................................... 7
6.1 solution............................................................................................................ 7
1
1 INTRODUCTION
This report will discuss about the clustering and how to set MPICH in an individual’s
PC. This report is also going to answer the following questions:
 What is clustering?
 Why do we cluster multiple PCs’?
 How to cluster?
 What is MPI and MPICH?
 How to set MPICH?
 What problem I have faced during clustering?
 How did I solve that problem?
2 WHAT IS CLUSTERING?
Clustering is connecting two or more computers in such a way that they behave like
a single computer. In parallel processing, load balancing, fault tolerance clustering
is used.
3 WHY DO WE CLUSTER?
In clustering the work is divided among the computers who are interconnected
through a dedicated network to work as one centralized data processing resource.
Clusters are capable of performing multiple complex instructions by distribution
the workload. Clustering improves the systems availability to users, its aggregate
performance and overall tolerance fault and component failures. In clustering
server if a server fails it automatically shuts down and its users are switched
instantly to other servers.
4 HOW DO WE CLUSTER MULTIPLE PCS’?
This section will discuss about clustering multiple PCs’.
2
4.1 WHAT IS MPI AND MPICH?
MPI stands for message passing interface which allows processes to
intercommunicate themselves to send and receive data. MPICH is a portable
implementation of MPI which is commonly used in Linux and windows structure.
5 HOW TO SET NPICH2 CLUSTER IN UBUNTU?
This section will show how to set MPICH2 cluster in Ubuntu. (This manual is created
by clustering multiple PCs’ in Ubuntu 14.04 version).
5.1 DEFINING HOSTNAMES
You can type “sudo gedit /etc/hosts” in the command line to edit the hosts file.
Here you have to put the IP addresses of yours and other computers with whom
you want to cluster your computer. Like the following
127.0.0.1 localhost
10.255.5.65 ub0
10.255.6.188 ub1
10.255.6.62 ub2
10.255.5.192 ub3
5.2 DEFINING A USER FOR RUNNING MPI PROGRAMS
Here we have to create a user for running MPI programs. We can do this by the
following:
1. Click the top most right icon. Then go to the system setting.
3
Figure 1: System Settings
2. Click User Accounts. Then click unlock. Now we are able to create a new user.
Figure 2: User Accounts
4
Figure 3: Create user
3. Click the + sign. Then give the account type Administrator and give the user
name mpiu and fill the other field.
Figure 4: Creating new user (mpiuser)
4. Open Terminal (Ctrl+ Alt + T) and go to the root user using “Sudo su”
command. Now you have to give password. Then type “passwd mpiuser”
command, and now you have to give the new user’s password. After this the
newly created user is activated.
5. Now logout from the current user and login the mpiu user. (Click the top
most right icon → logout. Then login the mpiu user).
5
Figure 4: Login new user (mpiuser)
5.3 INSTALLING SSH SERVER
Type “sudo apt-get install openssh-server” in the terminal.
5.4 GENERATE RSA KEY PAIR FOR COMMUNICATING THE COMPUTERS
In the terminal type “ssh-keygen –t rsa”. Then type the following
cd .ssh
cat id_pub.rsa >> authorized_keys
cat authorized_keys
From the last command you can see the generated key. Do the same thing to all
the other computers you want to cluster with. Then copy all the authorized keys
to a text file. Finally paste again all the keys to the authorized_keys file. You can
6
do this by typing “cat > authorized_keys” then paste all the copied keys. Finally
press “Ctrl+c”.
5.5 INSTALLING GCC AND MPICH2
In the terminal type
sudo apt-get install build-essential
sudo apt-get install mpich2
5.6 SETTING UP THE MACHINEFILE
Create a machinefile in mpiu’s home directory. Write the following in the
machinefile. First one is node name and followed by a colon the number of
processes to spawn.
ub0:2
ub1:2
ub2:2
ub3:2
5.7 TESTING
Create an mpi_hello.c file in the mpiu’s home directory and write the following in
the file.
#include <stdio.h>
#include <mpi.h>
int main(int argc, char** argv) {
int myrank, nprocs;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
7
MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
printf("Hello from processor %d of %dn", myrank,
nprocs);
MPI_Finalize();
return 0;
}
Compile it:
mpicc mpi_hello.c -o mpi_hello
Run it:
mpiexec -n 8 -f machinefile ./mpi_hello
6 PROBLEM I HAVE FACED
port 22: No route to host
6.1 SOLUTION
 Checked the current ssh connections by the following command.
 Reinstalling the open-ssh server and client I have solved the problem. The
command is as follows:
Sudo apt-get –reinstall isntall openssh-client
openssh-server

More Related Content

Similar to Clustering Manual for Parallel Computing

Complete MPICH2 Clustering Manual in Ubuntu
Complete MPICH2 Clustering Manual in UbuntuComplete MPICH2 Clustering Manual in Ubuntu
Complete MPICH2 Clustering Manual in Ubuntu
Minhas Kamal
 
Clustering manual
Clustering manualClustering manual
Clustering manual
Md. Mahedi Mahfuj
 
Activity 5
Activity 5Activity 5
Activity 5
Heidi Owens
 
cpu-affinity
cpu-affinitycpu-affinity
cpu-affinity
Magnetic Poetry
 
maXbox Starter 42 Multiprocessing Programming
maXbox Starter 42 Multiprocessing Programming maXbox Starter 42 Multiprocessing Programming
maXbox Starter 42 Multiprocessing Programming
Max Kleiner
 
fall2013
fall2013fall2013
fall2013
Will Dixon
 
New204
New204New204
Os notes
Os notesOs notes
Os notes
LakshmiSarvani6
 
M11Cde Skills-Based Assessment
M11Cde Skills-Based AssessmentM11Cde Skills-Based Assessment
M11Cde Skills-Based Assessment
Megan Jones
 
MYSQL DATABASE Operating System Part2 (1).pptx
MYSQL DATABASE Operating System Part2 (1).pptxMYSQL DATABASE Operating System Part2 (1).pptx
MYSQL DATABASE Operating System Part2 (1).pptx
ArjayBalberan1
 
Building an HPC Cluster in 10 Minutes
Building an HPC Cluster in 10 MinutesBuilding an HPC Cluster in 10 Minutes
Building an HPC Cluster in 10 Minutes
Monica Rut Avellino
 
Rgk cluster computing project
Rgk cluster computing projectRgk cluster computing project
Rgk cluster computing project
OstopD
 
Install websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsInstall websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bits
Manuel Vega
 
HPC Examples
HPC ExamplesHPC Examples
HPC Examples
Wendi Sapp
 
Bài tập lớn hệ điều hành HCMUT_HK232.pdf
Bài tập lớn hệ điều hành HCMUT_HK232.pdfBài tập lớn hệ điều hành HCMUT_HK232.pdf
Bài tập lớn hệ điều hành HCMUT_HK232.pdf
danhnguyenthanh15
 
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
felicidaddinwoodie
 
Linux clustering solution
Linux clustering solutionLinux clustering solution
Linux clustering solution
Chanaka Lasantha
 
Clustering of Mule ESB
Clustering of Mule ESBClustering of Mule ESB
Clustering of Mule ESB
Sreekanth Kondapalli
 
Operating System Structure Of A Single Large Executable...
Operating System Structure Of A Single Large Executable...Operating System Structure Of A Single Large Executable...
Operating System Structure Of A Single Large Executable...
Jennifer Lopez
 
Ecdl v5 module 2 print
Ecdl v5 module 2 printEcdl v5 module 2 print
Ecdl v5 module 2 print
Michael Lew
 

Similar to Clustering Manual for Parallel Computing (20)

Complete MPICH2 Clustering Manual in Ubuntu
Complete MPICH2 Clustering Manual in UbuntuComplete MPICH2 Clustering Manual in Ubuntu
Complete MPICH2 Clustering Manual in Ubuntu
 
Clustering manual
Clustering manualClustering manual
Clustering manual
 
Activity 5
Activity 5Activity 5
Activity 5
 
cpu-affinity
cpu-affinitycpu-affinity
cpu-affinity
 
maXbox Starter 42 Multiprocessing Programming
maXbox Starter 42 Multiprocessing Programming maXbox Starter 42 Multiprocessing Programming
maXbox Starter 42 Multiprocessing Programming
 
fall2013
fall2013fall2013
fall2013
 
New204
New204New204
New204
 
Os notes
Os notesOs notes
Os notes
 
M11Cde Skills-Based Assessment
M11Cde Skills-Based AssessmentM11Cde Skills-Based Assessment
M11Cde Skills-Based Assessment
 
MYSQL DATABASE Operating System Part2 (1).pptx
MYSQL DATABASE Operating System Part2 (1).pptxMYSQL DATABASE Operating System Part2 (1).pptx
MYSQL DATABASE Operating System Part2 (1).pptx
 
Building an HPC Cluster in 10 Minutes
Building an HPC Cluster in 10 MinutesBuilding an HPC Cluster in 10 Minutes
Building an HPC Cluster in 10 Minutes
 
Rgk cluster computing project
Rgk cluster computing projectRgk cluster computing project
Rgk cluster computing project
 
Install websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsInstall websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bits
 
HPC Examples
HPC ExamplesHPC Examples
HPC Examples
 
Bài tập lớn hệ điều hành HCMUT_HK232.pdf
Bài tập lớn hệ điều hành HCMUT_HK232.pdfBài tập lớn hệ điều hành HCMUT_HK232.pdf
Bài tập lớn hệ điều hành HCMUT_HK232.pdf
 
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
15LLP108_Demo4_LedBlinking.pdf1. Introduction In D.docx
 
Linux clustering solution
Linux clustering solutionLinux clustering solution
Linux clustering solution
 
Clustering of Mule ESB
Clustering of Mule ESBClustering of Mule ESB
Clustering of Mule ESB
 
Operating System Structure Of A Single Large Executable...
Operating System Structure Of A Single Large Executable...Operating System Structure Of A Single Large Executable...
Operating System Structure Of A Single Large Executable...
 
Ecdl v5 module 2 print
Ecdl v5 module 2 printEcdl v5 module 2 print
Ecdl v5 module 2 print
 

Recently uploaded

Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
Deuglo Infosystem Pvt Ltd
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
ISH Technologies
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
Codeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdfCodeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdf
Semiosis Software Private Limited
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 

Recently uploaded (20)

Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 
Empowering Growth with Best Software Development Company in Noida - Deuglo
Empowering Growth with Best Software  Development Company in Noida - DeugloEmpowering Growth with Best Software  Development Company in Noida - Deuglo
Empowering Growth with Best Software Development Company in Noida - Deuglo
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Preparing Non - Technical Founders for Engaging a Tech Agency
Preparing Non - Technical Founders for Engaging  a  Tech AgencyPreparing Non - Technical Founders for Engaging  a  Tech Agency
Preparing Non - Technical Founders for Engaging a Tech Agency
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
Codeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdfCodeigniter VS Cakephp Which is Better for Web Development.pdf
Codeigniter VS Cakephp Which is Better for Web Development.pdf
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 

Clustering Manual for Parallel Computing

  • 1. CLUSTERING MANUAL Parallel Computing ABSTRACT Clustering is way to connect two or more computers with each other in such a way they behave like one single computer. It’s necessary for parallel processing, load balancing, and fault tolerance which is called parallel computing. This manual shows the steps to establish clustering in Linux OS. Khandaker Mamun Ahmed IIT, Dhaka University
  • 2. Contents 1 Introduction........................................................................................................ 1 2 What is clustering?.............................................................................................. 1 3 Why do we cluster? ............................................................................................ 1 4 How do we cluster multiple pcs’? ....................................................................... 1 4.1 What is MPI and MPICH? ............................................................................. 2 5 How to set npich2 cluster in Ubuntu?................................................................. 2 5.1 Defining hostnames ..................................................................................... 2 5.2 Defining a user for running MPI programs ................................................... 2 5.3 Installing ssh server...................................................................................... 5 5.4 Generate Rsa key pair for communicating the computers ........................... 5 5.5 Installing GCC and mpich2............................................................................ 6 5.6 Setting up the machinefile ........................................................................... 6 5.7 Testing ......................................................................................................... 6 6 Problem I have faced .......................................................................................... 7 6.1 solution............................................................................................................ 7
  • 3. 1 1 INTRODUCTION This report will discuss about the clustering and how to set MPICH in an individual’s PC. This report is also going to answer the following questions:  What is clustering?  Why do we cluster multiple PCs’?  How to cluster?  What is MPI and MPICH?  How to set MPICH?  What problem I have faced during clustering?  How did I solve that problem? 2 WHAT IS CLUSTERING? Clustering is connecting two or more computers in such a way that they behave like a single computer. In parallel processing, load balancing, fault tolerance clustering is used. 3 WHY DO WE CLUSTER? In clustering the work is divided among the computers who are interconnected through a dedicated network to work as one centralized data processing resource. Clusters are capable of performing multiple complex instructions by distribution the workload. Clustering improves the systems availability to users, its aggregate performance and overall tolerance fault and component failures. In clustering server if a server fails it automatically shuts down and its users are switched instantly to other servers. 4 HOW DO WE CLUSTER MULTIPLE PCS’? This section will discuss about clustering multiple PCs’.
  • 4. 2 4.1 WHAT IS MPI AND MPICH? MPI stands for message passing interface which allows processes to intercommunicate themselves to send and receive data. MPICH is a portable implementation of MPI which is commonly used in Linux and windows structure. 5 HOW TO SET NPICH2 CLUSTER IN UBUNTU? This section will show how to set MPICH2 cluster in Ubuntu. (This manual is created by clustering multiple PCs’ in Ubuntu 14.04 version). 5.1 DEFINING HOSTNAMES You can type “sudo gedit /etc/hosts” in the command line to edit the hosts file. Here you have to put the IP addresses of yours and other computers with whom you want to cluster your computer. Like the following 127.0.0.1 localhost 10.255.5.65 ub0 10.255.6.188 ub1 10.255.6.62 ub2 10.255.5.192 ub3 5.2 DEFINING A USER FOR RUNNING MPI PROGRAMS Here we have to create a user for running MPI programs. We can do this by the following: 1. Click the top most right icon. Then go to the system setting.
  • 5. 3 Figure 1: System Settings 2. Click User Accounts. Then click unlock. Now we are able to create a new user. Figure 2: User Accounts
  • 6. 4 Figure 3: Create user 3. Click the + sign. Then give the account type Administrator and give the user name mpiu and fill the other field. Figure 4: Creating new user (mpiuser) 4. Open Terminal (Ctrl+ Alt + T) and go to the root user using “Sudo su” command. Now you have to give password. Then type “passwd mpiuser” command, and now you have to give the new user’s password. After this the newly created user is activated. 5. Now logout from the current user and login the mpiu user. (Click the top most right icon → logout. Then login the mpiu user).
  • 7. 5 Figure 4: Login new user (mpiuser) 5.3 INSTALLING SSH SERVER Type “sudo apt-get install openssh-server” in the terminal. 5.4 GENERATE RSA KEY PAIR FOR COMMUNICATING THE COMPUTERS In the terminal type “ssh-keygen –t rsa”. Then type the following cd .ssh cat id_pub.rsa >> authorized_keys cat authorized_keys From the last command you can see the generated key. Do the same thing to all the other computers you want to cluster with. Then copy all the authorized keys to a text file. Finally paste again all the keys to the authorized_keys file. You can
  • 8. 6 do this by typing “cat > authorized_keys” then paste all the copied keys. Finally press “Ctrl+c”. 5.5 INSTALLING GCC AND MPICH2 In the terminal type sudo apt-get install build-essential sudo apt-get install mpich2 5.6 SETTING UP THE MACHINEFILE Create a machinefile in mpiu’s home directory. Write the following in the machinefile. First one is node name and followed by a colon the number of processes to spawn. ub0:2 ub1:2 ub2:2 ub3:2 5.7 TESTING Create an mpi_hello.c file in the mpiu’s home directory and write the following in the file. #include <stdio.h> #include <mpi.h> int main(int argc, char** argv) { int myrank, nprocs; MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
  • 9. 7 MPI_Comm_rank(MPI_COMM_WORLD, &myrank); printf("Hello from processor %d of %dn", myrank, nprocs); MPI_Finalize(); return 0; } Compile it: mpicc mpi_hello.c -o mpi_hello Run it: mpiexec -n 8 -f machinefile ./mpi_hello 6 PROBLEM I HAVE FACED port 22: No route to host 6.1 SOLUTION  Checked the current ssh connections by the following command.  Reinstalling the open-ssh server and client I have solved the problem. The command is as follows: Sudo apt-get –reinstall isntall openssh-client openssh-server