SlideShare a Scribd company logo
1
Cluster Setup Manual
Using Ubuntu and MPICH
prepared by BSSE-0516
2
Cluster Setup Manual
Using Ubuntu and MPICH
Institute of Information Technology,
University of Dhaka
Date of Submission
13 June 2015
Submitted to
Emon Kumar Dey
Course Instructor of SE-501
Lecturer
Institute of Information Technology
University of Dhaka
Submitted by
Md. Rakib Hossain
(BSSE 0516)
Submitted to
Amit Seal Ami
Lab Instructor of SE-501
Lecturer
Institute of Information Technology
University of Dhaka
3
TABLE OF CONTENTS
BACKGROUND..............................................................................................5
OBJECTIVES .................................................................................................5
BOARD OBJECTIVE: ..................................................................................................................... 5
SPECIFIC OBJECTIVES: ................................................................................................................. 5
ORIGIN OF THE DOCUMENT............................................................................5
WHAT IS PARALLEL COMPUTING? ..................................................................6
WHERE USED PARALLEL COMPUTING?............................................................6
SCIENCE AND ENGINEERING: ....................................................................................................... 6
INDUSTRIAL AND COMMERCIAL:.................................................................................................. 7
WHAT IS CLUSTER COMPUTING? ....................................................................7
WHAT ARE MPI AND MPICH? ..........................................................................7
MPI: ............................................................................................................................................ 7
MPICH:....................................................................................................................................... 8
MAKE A CLUSTER FOR PARALLEL COMPUTING................................................8
WHAT ARE THE PREREQUISITES? ................................................................................................. 8
WHAT ARE THE REQUIRED PACKAGES NEEDED TO BE INSTALLED?...................9
INSTALLING MPICH.................................................................................................................... 9
INSTALLING SSH SERVER.......................................................................................................... 10
INSTALLING GCC ...................................................................................................................... 10
HOW TO SETUP THE CLUSTER ENVIRONMENT? ..............................................11
DEFINING HOSTNAMES:.............................................................................................................. 11
SETTING UP AUTHORIZED KEYS FOR PASSWORD LESS COMMUNICATION BETWEEN NODES:....... 13
SETTING UP A MACHINE-FILE: .................................................................................................... 15
HOW TO WRITE A PROGRAM USING MPICH?............................................................................ 16
HOW TO COMPILE AND EXECUTE THE PROGRAM USING MPICH?............................................. 16
1) Using USB Flash Drive: ............................................................................................... 17
2) Using scp command:..................................................................................................... 17
3) Using sharing master folder:........................................................................................ 17
4
CONCLUSION..............................................................................................19
APPENDIX ..................................................................................................19
LIST OF COMMAND USED IN THIS MANUAL:................................................................................ 19
REFERENCES ..............................................................................................20
5
Background
Generally, a software program has been developed for serial computation. In order to solve a
computing problem, an algorithm is formulated and applied as a successive flow of instructions.
All these instructions are usually executed on a CPU in one computer. Merely single instruction
may execute at a time after that instruction is finished, the next instruction is executed.
In our real world there are lots of computing problem that needs huge calculation and
concurrency such as weather forecast, planetary movements, galaxy formulation etc. These types
of problems are so large and/or complex that it is impractical or impossible to solve them on a
single computer using serial computation especially given limited computer memory.
Objectives
Board Objective:
The main objective of this document is to show how to setup a cluster using two computer
having Linux based OS (Ubuntu 14.04) using MPICH.
Specific Objectives:
 To learn what is parallel computing and how it works.
 Why parallel computing is needed and important.
 What is cluster computing and how it works?
 What are MPI and MPICH and how they work?
 How to make a cluster
 How to write the first parallel computing code and execute it on cluster
Origin of the Document
As per our course tutor Mr. Emon Kumar Dey instructed us to submit a report as part of the
course evaluation, I prepare the paper. By writing the report I have learnt how to setup a cluster
for parallel computing. I have also learnt how to write a code that may execute parallel on a
cluster. So we are very thankful to our course tutor for giving us the opportunity.
6
What is Parallel Computing?
Parallel computing is used for multiple processing components simultaneously to resolve a
problem. This is carried out by splitting the problem into independent section in order that every
single processing component can easily execute its section of the algorithm simultaneously with
the others. The processing components may be diverse including resources like a single
computer with multiple processors, several networked computers, specialized hardware, or any
combination of the above
Figure 1: Parallel Computing
Where used Parallel Computing?
Science and Engineering:
 Historically, parallel computing has been considered to be "the high end of computing",
and has been used to model difficult problems in many areas of science and engineering:
o Atmosphere, Earth, Environment
o Physics - applied, nuclear, particle,
condensed matter, high pressure, fusion,
photonics
o Bioscience, Biotechnology, Genetics
o Chemistry, Molecular Sciences
o Geology, Seismology
o Mechanical Engineering - from
prosthetics to spacecraft
o Electrical Engineering, Circuit
Design, Microelectronics
o Computer Science,
Mathematics
o Defense, Weapons
7
Industrial and Commercial:
 Today, commercial applications provide an equal or greater driving force in the
development of faster computers. These applications require the processing of large
amounts of data in sophisticated ways. For example:
o Databases, data mining
o Oil exploration
o Web search engines, web based
business services
o Medical imaging and diagnosis
o Pharmaceutical design
o Financial and economic modeling
o Management of national and multi-
national corporations
o Advanced graphics and virtual reality,
particularly in the entertainment industry
o Networked video and multi-media
technologies
o Collaborative work environments
What is Cluster Computing?
Cluster computing is a model of computing where a collection of computers are interconnected
with each other in order that they can behave like a single entity. The components of a cluster are
normally linked to one another through fast local area networks, among each node running its
own instance of an operating system. Generally in most situations, all the nodes use the same
hardware and the same operating system, even though in a few configurations different operating
systems may be used for each computer, as well as different hardware.
Clusters are generally implemented to enhance performance and availability over compared to a
single computer, while usually being much more cost-effective than single computers of
comparable speed or availability.
Cluster Computing is used for parallel processing, load balancing etc. Clustering is a popular
strategy for implementing parallel processing programs as it enables the programs to run each
independent component simultaneously in each computer. Clusters are able to executing multiple
complex instructions by distributing workload throughout all connected computers. Clustering
enhances the system's availability to users, its aggregate performance, and overall tolerance to
faults and component failures.
What are MPI and MPICH?
MPI: Message Passing Interface (MPI) is a standardized and transportable message-passing
system developed by a group of researchers from academia and industry to work on a wide range
8
of parallel computers. The goal of the Message Passing Interface is to establish a portable,
efficient, and flexible standard for message passing that will be widely used for writing message
passing programs. Using this API connected computer in a cluster can communicate to each
other through message passing .It enables them to send and receive message and then
synchronize themselves.
The standard defines the syntax and semantics of a core of library routines useful to a wide range
of users writing portable message-passing programs in different computer programming
languages such as Fortran, C, C++ and Java.
MPICH: MPICH is a high performance and widely portable implementation of the Message
Passing Interface (MPI) standard.
Make a Cluster for Parallel Computing
What are the Prerequisites?
Here we develop a cluster using MPI and then write a program, compile and execute this
program using MPICH
The prerequisites are
1. We need at-least two computers having Linux distribution installed on it (here we use
Ubuntu 14.04 LTS) .We have to make it sure that our system has GCC installed. As
Ubuntu has installed GCC built in on it, for the time being we need not to install it
2. A network connection between this two computers and they must have IP addresses
assigned on them. Now let us assume that we have two computers fulfilling our
prerequisites. Let the host name and the IP addresses of these computers be. Here we call
all this computer node
misubeimp 10.255.4.125
minhas-pc 10.255.4.98
9
What are the Required Packages needed to be installed?
Installing MPICH
As we are using mpich2 as our message passing system so we should install its packages in all
the nodes. To install it we have to run the following command
***Here one important point must be noted that we have to install the same version of MPICH in
all the nodes. We use MPICH2.To check the version properly run the following command.
To ensure where installing MPICH2 run the following command
10
We may test that the program did indeed install successfully by entering the following
commands in all nodes.
Installing SSH Server
Mpich communicates among the nodes using remote login and also distribute the processes
among the nodes through remote log in. So we need to confirm that our nodes have the ability of
remote log in. Remote log in can be performed using different way for example telnets, openssh
.In our case we use openssh as it gives better security of data than telnet. To install openssh we
have to run the following command in all nodes.
Installing GCC
As it is said before Ubuntu has built-in GCC installed but to ensure that which version of GCC is
installed we may execute the following command
If exceptionally GCC is missed then we may easily installed it using the following command in
all nodes.
11
How to Setup the Cluster Environment?
Defining hostnames:
We have to define the two node host name in every node hosts file. To define that we have to
edit the host file by executing the following command
First the hosts file looks like the given picture. We have to edit the hosts file with our two nodes
ip address and host name in this way mentioned in the below picture
After editing out hosts file is looked as the following picture.
Add a New User for running MPI programs:
Now we have to add a new user in every node for running MPI program. In every node the new
user must have the same user name. It is better to give the same password for availability. So
first we make a directory in our root directory then we add our new user in the directory. Our
12
new user name would be mpiuser and the directory name is cluster. To do it we have to run the
following command.
As we directly add our user to the cluster directory without create our user that’s why the system
will ask to add the new user automatically
.
For the time being here we just enter our password and leave all other stuff default.
Now our new mpiuser successfully add to this directory and we now changes the owner ship of
this directory to mpiuser .To do it we have to enter the following command.
13
Setting up Authorized Keys for password less communication
between nodes:
After successfully adding new user now we log in to the new user.
Now we will generate a new ssh key. On executing the following command
Here it'll ask for a paraphrase. Leave it blank as we want to create a password-less ssh
(Assuming that we have a trusted LAN with no security issues).
14
After executing the command a folder called .ssh will be created in home directory. It’s a hidden
folder. This folder will contain a file id_dsa.pub that contains your public key. This public key is
used for sending cryptic message. The distinguishing technique used in public key cryptography
is the use of asymmetric key algorithms, where the key used to encrypt a message is not the same
as the key used to decrypt it. Each user has a pair of cryptographic keys- a public encryption
key and a private decryption key. The publicly available encrypting-key is widely distributed,
while the private decrypting-key is known only to the recipient. Messages are encrypted with the
recipient's public key and can only be decrypted with the corresponding private key. The keys are
related mathematically, but the private key cannot feasibly be derived from the public key.
Now copy this key to another file called authorized_keys in the same directory. Execute the
Commands in the terminal
The authorized_keys file contains the key for one node and it will look like the following
picture. It will show misubeimp pc’s mpiuser authorize keys
We have also got another authorized_keys in minhas-pc‘s mpiuser authorize keys. Now we
have to make a common authorized_keys file for both user pc so that both nodes contains the
same keys in their authorized_keys file. We may do it using simply copy past command with
nano editor.
After make the common file the file would be look like the below picture.
15
Setting up the keys we setup the environment successfully. Up to that log out from the mpiuser
and restart the pc.
Setting up a machine-file:
Now we create a file called "machinefile" in mpiuser home directory with node names followed
by a colon and a number of processes to we want to execute on each node.
16
How to Write a Program using MPICH?
Now we write our very first program using mpich convention. There is a demo example is given
below.
How to Compile and Execute the Program Using MPICH?
To compile the above program using mpich we have to execute the following command
.
After compiling we can execute the compiled file using mpich to our local node without using
the machine file. To do it we have to execute the following command.
17
Now as our goal is to execute the compiled program in both nods of our cluster so we have to
make sure that in both nodes the compiled file and the machine file are present in their mpiuser
home directory. After that we may execute the program with machine in any node.
Here we can transfer the executable file in all nodes using different ways.
1. Using Usb Flash drive
2. Using scp command
3. Using sharing master folder.
1) Using USB Flash Drive: When we transfer the executable file among the nodes using
usb flash drive we have to place the file in the same location of mpiuser account. We
also make sure that this file is in executable mode .To do that we may run the following
command to make the file executable.
2) Using scp command: We may transfer the executable file using scp command from
one node to another node into the same location. To do that we may execute the
following command.
3) Using sharing master folder: Here we first make a folder in all nodes, and then we'll
store our data and programs in this folder. And then we share the contents of this folder
located on the master node to all the other nodes. As we didn’t make any master folder in
our cluster so if someone is interested to know how to make a master folder, they are
requested to check out the following link’s 2 and 3 no points. MpichCluster.
18
Now to execute the program in multiple modes we have to execute the following commands
with machine file
Now it will show the following output
19
Conclusion
In the manual, firstly we have discussed on parallel computing, how parallel computing works,
in which situation we need to compute parallel and why parallel computing is necessary for
scientific research and industrial works. The main focus of this manual based on how to setup a
cluster using Ubuntu (14.04) operating system and mpich along with writing the first parallel
program and executes it in multiple pc parallel. To do so step by step procedures are mentioned
in this manual .We hope this manual will be very helpful for understanding cluster computing
and setting up first cluster computer.
Appendix
List of command used in this manual:
1) misubeimp@misubeimp:~$ sudo apt-get update
2) misubeimp@misubeimp:~$ sudo apt-get install mpich2
3) misubeimp@misubeimp:~$ mpichversion
4) misubeimp@misubeimp:~$ which mpiexec
5) misubeimp@misubeimp:~$ which mpirun
6) misubeimp@misubeimp:~$ sudo apt-get install openssh-server
7) misubeimp@misubeimp:~$ gcc -- version
8) misubeimp@misubeimp:~$ sudo apt-get install build-essential
9) misubeimp@misubeimp:~$ sudo gedit /etc/hosts
10) misubeimp@misubeimp:~$ sudo mkdir /cluster
11) misubeimp@misubeimp:~$ sudo adduser mpiuser --home /clutser
12) misubeimp@misubeimp:~$ sudo chown mpiuser / cluster
13) misubeimp@misubeimp:~$ su – mpiuser
14) mpiuser@misubeimp:~$ cd .ssh
15) mpiuser@misubeimp:~$ ssh-keygen -t dsa
16) mpiuser@misubeimp:~$ cat id_dsa.pub >> authorized_keys
17) mpiuser@misubeimp:~$ cat authorized_keys
18) mpiuser@misubeimp:~$ nano authorized_keys
19) misubeimp@misubeimp:~$ mpicc I_am_alive –o I_am_alive.c
20) misubeimp@misubeimp:~$ mpiexe –n 8 ./I_am_alive
21) misubeimp@misubeimp:~$ sudo scp I_am_alive @minhas-pc
22) misubeimp@misubeimp:~$ sudo chmod +x I_am_alive
23) misubeimp@misubeimp:~$ mpiexe –n 8 –f machinefile ./I_am_alive
20
References
https://help.ubuntu.com/community/MpichCluster
https://computing.llnl.gov/tutorials/parallel_comp/

More Related Content

What's hot

Network Operating System
Network Operating SystemNetwork Operating System
Network Operating Systemisma ishak
 
Karnaughmaprev1 130728135103-phpapp01
Karnaughmaprev1 130728135103-phpapp01Karnaughmaprev1 130728135103-phpapp01
Karnaughmaprev1 130728135103-phpapp01
Neha Agarwal
 
Z buffer
Z bufferZ buffer
Z buffer
AmitBiswas99
 
Clipping
ClippingClipping
Clipping
Pooja Dixit
 
Weiler atherton
Weiler athertonWeiler atherton
Weiler atherton
Arvind Kumar
 
Recovery in Multi database Systems
Recovery in Multi database SystemsRecovery in Multi database Systems
Recovery in Multi database Systems
Moutasm Tamimi
 
Polygon filling algorithm
Polygon filling algorithmPolygon filling algorithm
Polygon filling algorithm
Aparna Joshi
 
IT6601 MOBILE COMPUTING UNIT1
IT6601 MOBILE COMPUTING UNIT1IT6601 MOBILE COMPUTING UNIT1
IT6601 MOBILE COMPUTING UNIT1
RMK ENGINEERING COLLEGE, CHENNAI
 
Unix operating system architecture with file structure
Unix operating system architecture with file structure Unix operating system architecture with file structure
Unix operating system architecture with file structure
amol_chavan
 
Replication in Distributed Systems
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed Systems
Kavya Barnadhya Hazarika
 
2D Rotation- Transformation in Computer Graphics
2D Rotation- Transformation in Computer Graphics2D Rotation- Transformation in Computer Graphics
2D Rotation- Transformation in Computer Graphics
Susmita
 
Unit 1 architecture of distributed systems
Unit 1 architecture of distributed systemsUnit 1 architecture of distributed systems
Unit 1 architecture of distributed systemskaran2190
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
sgpraju
 
Distributed operating system
Distributed operating systemDistributed operating system
Distributed operating system
udaya khanal
 
Unix File System
Unix File SystemUnix File System
Unix File Systemstudent(MCA)
 
SHORTEST PATH FINDING VISUALIZER
SHORTEST PATH FINDING VISUALIZERSHORTEST PATH FINDING VISUALIZER
SHORTEST PATH FINDING VISUALIZER
IRJET Journal
 
Topology presentation
Topology  presentationTopology  presentation
Topology presentationJobaida Nahar
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared Memory
SHIKHA GAUTAM
 
Peer to Peer services and File systems
Peer to Peer services and File systemsPeer to Peer services and File systems
Peer to Peer services and File systems
MNM Jain Engineering College
 
Operating system concepts (notes)
Operating system concepts (notes)Operating system concepts (notes)
Operating system concepts (notes)Sohaib Danish
 

What's hot (20)

Network Operating System
Network Operating SystemNetwork Operating System
Network Operating System
 
Karnaughmaprev1 130728135103-phpapp01
Karnaughmaprev1 130728135103-phpapp01Karnaughmaprev1 130728135103-phpapp01
Karnaughmaprev1 130728135103-phpapp01
 
Z buffer
Z bufferZ buffer
Z buffer
 
Clipping
ClippingClipping
Clipping
 
Weiler atherton
Weiler athertonWeiler atherton
Weiler atherton
 
Recovery in Multi database Systems
Recovery in Multi database SystemsRecovery in Multi database Systems
Recovery in Multi database Systems
 
Polygon filling algorithm
Polygon filling algorithmPolygon filling algorithm
Polygon filling algorithm
 
IT6601 MOBILE COMPUTING UNIT1
IT6601 MOBILE COMPUTING UNIT1IT6601 MOBILE COMPUTING UNIT1
IT6601 MOBILE COMPUTING UNIT1
 
Unix operating system architecture with file structure
Unix operating system architecture with file structure Unix operating system architecture with file structure
Unix operating system architecture with file structure
 
Replication in Distributed Systems
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed Systems
 
2D Rotation- Transformation in Computer Graphics
2D Rotation- Transformation in Computer Graphics2D Rotation- Transformation in Computer Graphics
2D Rotation- Transformation in Computer Graphics
 
Unit 1 architecture of distributed systems
Unit 1 architecture of distributed systemsUnit 1 architecture of distributed systems
Unit 1 architecture of distributed systems
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
 
Distributed operating system
Distributed operating systemDistributed operating system
Distributed operating system
 
Unix File System
Unix File SystemUnix File System
Unix File System
 
SHORTEST PATH FINDING VISUALIZER
SHORTEST PATH FINDING VISUALIZERSHORTEST PATH FINDING VISUALIZER
SHORTEST PATH FINDING VISUALIZER
 
Topology presentation
Topology  presentationTopology  presentation
Topology presentation
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared Memory
 
Peer to Peer services and File systems
Peer to Peer services and File systemsPeer to Peer services and File systems
Peer to Peer services and File systems
 
Operating system concepts (notes)
Operating system concepts (notes)Operating system concepts (notes)
Operating system concepts (notes)
 

Similar to Cluster Setup Manual Using Ubuntu and MPICH

Thesies_Cheng_Guo_2015_fina_signed
Thesies_Cheng_Guo_2015_fina_signedThesies_Cheng_Guo_2015_fina_signed
Thesies_Cheng_Guo_2015_fina_signedCheng Guo
 
The Parallel Architecture Approach, Single Program Multiple Data (Spmd) Imple...
The Parallel Architecture Approach, Single Program Multiple Data (Spmd) Imple...The Parallel Architecture Approach, Single Program Multiple Data (Spmd) Imple...
The Parallel Architecture Approach, Single Program Multiple Data (Spmd) Imple...
ijceronline
 
Isometric Making Essay
Isometric Making EssayIsometric Making Essay
Isometric Making Essay
Alana Cartwright
 
Introduction into the problems of developing parallel programs
Introduction into the problems of developing parallel programsIntroduction into the problems of developing parallel programs
Introduction into the problems of developing parallel programs
PVS-Studio
 
Seminar Report - Managing the Cloud with Open Source Tools
Seminar Report - Managing the Cloud with Open Source ToolsSeminar Report - Managing the Cloud with Open Source Tools
Seminar Report - Managing the Cloud with Open Source ToolsNakul Ezhuthupally
 
CC LECTURE NOTES (1).pdf
CC LECTURE NOTES (1).pdfCC LECTURE NOTES (1).pdf
CC LECTURE NOTES (1).pdf
HasanAfwaaz1
 
Performance evaluation of larger matrices over cluster of four nodes using mpi
Performance evaluation of larger matrices over cluster of four nodes using mpiPerformance evaluation of larger matrices over cluster of four nodes using mpi
Performance evaluation of larger matrices over cluster of four nodes using mpi
eSAT Journals
 
Tutorial on Parallel Computing and Message Passing Model - C1
Tutorial on Parallel Computing and Message Passing Model - C1Tutorial on Parallel Computing and Message Passing Model - C1
Tutorial on Parallel Computing and Message Passing Model - C1Marcirio Chaves
 
Building A Linux Cluster Using Raspberry PI #1!
Building A Linux Cluster Using Raspberry PI #1!Building A Linux Cluster Using Raspberry PI #1!
Building A Linux Cluster Using Raspberry PI #1!
A Jorge Garcia
 
unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
RAHULNARAYANGAWARE
 
2023comp90024_Spartan.pdf
2023comp90024_Spartan.pdf2023comp90024_Spartan.pdf
2023comp90024_Spartan.pdf
LevLafayette1
 
A REVIEW ON PARALLEL COMPUTING
A REVIEW ON PARALLEL COMPUTINGA REVIEW ON PARALLEL COMPUTING
A REVIEW ON PARALLEL COMPUTING
Amy Roman
 
parallel programming models
 parallel programming models parallel programming models
parallel programming models
Swetha S
 
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTESPARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
suthi
 
Hardback solution to accelerate multimedia computation through mgp in cmp
Hardback solution to accelerate multimedia computation through mgp in cmpHardback solution to accelerate multimedia computation through mgp in cmp
Hardback solution to accelerate multimedia computation through mgp in cmp
eSAT Publishing House
 
Automated LiveMigration of VMs
Automated LiveMigration of VMs Automated LiveMigration of VMs
Automated LiveMigration of VMs
Akhila Chatlapalle
 
A Parallel Computing-a Paradigm to achieve High Performance
A Parallel Computing-a Paradigm to achieve High PerformanceA Parallel Computing-a Paradigm to achieve High Performance
A Parallel Computing-a Paradigm to achieve High Performance
AM Publications
 
CLOUD COMPUTING Unit-I.pdf
CLOUD COMPUTING Unit-I.pdfCLOUD COMPUTING Unit-I.pdf
CLOUD COMPUTING Unit-I.pdf
lakshmidevi853216
 

Similar to Cluster Setup Manual Using Ubuntu and MPICH (20)

Thesies_Cheng_Guo_2015_fina_signed
Thesies_Cheng_Guo_2015_fina_signedThesies_Cheng_Guo_2015_fina_signed
Thesies_Cheng_Guo_2015_fina_signed
 
The Parallel Architecture Approach, Single Program Multiple Data (Spmd) Imple...
The Parallel Architecture Approach, Single Program Multiple Data (Spmd) Imple...The Parallel Architecture Approach, Single Program Multiple Data (Spmd) Imple...
The Parallel Architecture Approach, Single Program Multiple Data (Spmd) Imple...
 
Isometric Making Essay
Isometric Making EssayIsometric Making Essay
Isometric Making Essay
 
Introduction into the problems of developing parallel programs
Introduction into the problems of developing parallel programsIntroduction into the problems of developing parallel programs
Introduction into the problems of developing parallel programs
 
Seminar Report - Managing the Cloud with Open Source Tools
Seminar Report - Managing the Cloud with Open Source ToolsSeminar Report - Managing the Cloud with Open Source Tools
Seminar Report - Managing the Cloud with Open Source Tools
 
CC LECTURE NOTES (1).pdf
CC LECTURE NOTES (1).pdfCC LECTURE NOTES (1).pdf
CC LECTURE NOTES (1).pdf
 
Performance evaluation of larger matrices over cluster of four nodes using mpi
Performance evaluation of larger matrices over cluster of four nodes using mpiPerformance evaluation of larger matrices over cluster of four nodes using mpi
Performance evaluation of larger matrices over cluster of four nodes using mpi
 
Tutorial on Parallel Computing and Message Passing Model - C1
Tutorial on Parallel Computing and Message Passing Model - C1Tutorial on Parallel Computing and Message Passing Model - C1
Tutorial on Parallel Computing and Message Passing Model - C1
 
Building A Linux Cluster Using Raspberry PI #1!
Building A Linux Cluster Using Raspberry PI #1!Building A Linux Cluster Using Raspberry PI #1!
Building A Linux Cluster Using Raspberry PI #1!
 
V5I1-IJERTV5IS010514
V5I1-IJERTV5IS010514V5I1-IJERTV5IS010514
V5I1-IJERTV5IS010514
 
unit 1.pptx
unit 1.pptxunit 1.pptx
unit 1.pptx
 
2023comp90024_Spartan.pdf
2023comp90024_Spartan.pdf2023comp90024_Spartan.pdf
2023comp90024_Spartan.pdf
 
A REVIEW ON PARALLEL COMPUTING
A REVIEW ON PARALLEL COMPUTINGA REVIEW ON PARALLEL COMPUTING
A REVIEW ON PARALLEL COMPUTING
 
parallel programming models
 parallel programming models parallel programming models
parallel programming models
 
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTESPARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
PARALLEL ARCHITECTURE AND COMPUTING - SHORT NOTES
 
035
035035
035
 
Hardback solution to accelerate multimedia computation through mgp in cmp
Hardback solution to accelerate multimedia computation through mgp in cmpHardback solution to accelerate multimedia computation through mgp in cmp
Hardback solution to accelerate multimedia computation through mgp in cmp
 
Automated LiveMigration of VMs
Automated LiveMigration of VMs Automated LiveMigration of VMs
Automated LiveMigration of VMs
 
A Parallel Computing-a Paradigm to achieve High Performance
A Parallel Computing-a Paradigm to achieve High PerformanceA Parallel Computing-a Paradigm to achieve High Performance
A Parallel Computing-a Paradigm to achieve High Performance
 
CLOUD COMPUTING Unit-I.pdf
CLOUD COMPUTING Unit-I.pdfCLOUD COMPUTING Unit-I.pdf
CLOUD COMPUTING Unit-I.pdf
 

Recently uploaded

Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Lapbook sobre os Regimes TotalitĂĄrios.pdf
Lapbook sobre os Regimes TotalitĂĄrios.pdfLapbook sobre os Regimes TotalitĂĄrios.pdf
Lapbook sobre os Regimes TotalitĂĄrios.pdf
Jean Carlos Nunes PaixĂŁo
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
timhan337
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 

Recently uploaded (20)

Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Lapbook sobre os Regimes TotalitĂĄrios.pdf
Lapbook sobre os Regimes TotalitĂĄrios.pdfLapbook sobre os Regimes TotalitĂĄrios.pdf
Lapbook sobre os Regimes TotalitĂĄrios.pdf
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Honest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptxHonest Reviews of Tim Han LMA Course Program.pptx
Honest Reviews of Tim Han LMA Course Program.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 

Cluster Setup Manual Using Ubuntu and MPICH

  • 1. 1 Cluster Setup Manual Using Ubuntu and MPICH prepared by BSSE-0516
  • 2. 2 Cluster Setup Manual Using Ubuntu and MPICH Institute of Information Technology, University of Dhaka Date of Submission 13 June 2015 Submitted to Emon Kumar Dey Course Instructor of SE-501 Lecturer Institute of Information Technology University of Dhaka Submitted by Md. Rakib Hossain (BSSE 0516) Submitted to Amit Seal Ami Lab Instructor of SE-501 Lecturer Institute of Information Technology University of Dhaka
  • 3. 3 TABLE OF CONTENTS BACKGROUND..............................................................................................5 OBJECTIVES .................................................................................................5 BOARD OBJECTIVE: ..................................................................................................................... 5 SPECIFIC OBJECTIVES: ................................................................................................................. 5 ORIGIN OF THE DOCUMENT............................................................................5 WHAT IS PARALLEL COMPUTING? ..................................................................6 WHERE USED PARALLEL COMPUTING?............................................................6 SCIENCE AND ENGINEERING: ....................................................................................................... 6 INDUSTRIAL AND COMMERCIAL:.................................................................................................. 7 WHAT IS CLUSTER COMPUTING? ....................................................................7 WHAT ARE MPI AND MPICH? ..........................................................................7 MPI: ............................................................................................................................................ 7 MPICH:....................................................................................................................................... 8 MAKE A CLUSTER FOR PARALLEL COMPUTING................................................8 WHAT ARE THE PREREQUISITES? ................................................................................................. 8 WHAT ARE THE REQUIRED PACKAGES NEEDED TO BE INSTALLED?...................9 INSTALLING MPICH.................................................................................................................... 9 INSTALLING SSH SERVER.......................................................................................................... 10 INSTALLING GCC ...................................................................................................................... 10 HOW TO SETUP THE CLUSTER ENVIRONMENT? ..............................................11 DEFINING HOSTNAMES:.............................................................................................................. 11 SETTING UP AUTHORIZED KEYS FOR PASSWORD LESS COMMUNICATION BETWEEN NODES:....... 13 SETTING UP A MACHINE-FILE: .................................................................................................... 15 HOW TO WRITE A PROGRAM USING MPICH?............................................................................ 16 HOW TO COMPILE AND EXECUTE THE PROGRAM USING MPICH?............................................. 16 1) Using USB Flash Drive: ............................................................................................... 17 2) Using scp command:..................................................................................................... 17 3) Using sharing master folder:........................................................................................ 17
  • 4. 4 CONCLUSION..............................................................................................19 APPENDIX ..................................................................................................19 LIST OF COMMAND USED IN THIS MANUAL:................................................................................ 19 REFERENCES ..............................................................................................20
  • 5. 5 Background Generally, a software program has been developed for serial computation. In order to solve a computing problem, an algorithm is formulated and applied as a successive flow of instructions. All these instructions are usually executed on a CPU in one computer. Merely single instruction may execute at a time after that instruction is finished, the next instruction is executed. In our real world there are lots of computing problem that needs huge calculation and concurrency such as weather forecast, planetary movements, galaxy formulation etc. These types of problems are so large and/or complex that it is impractical or impossible to solve them on a single computer using serial computation especially given limited computer memory. Objectives Board Objective: The main objective of this document is to show how to setup a cluster using two computer having Linux based OS (Ubuntu 14.04) using MPICH. Specific Objectives:  To learn what is parallel computing and how it works.  Why parallel computing is needed and important.  What is cluster computing and how it works?  What are MPI and MPICH and how they work?  How to make a cluster  How to write the first parallel computing code and execute it on cluster Origin of the Document As per our course tutor Mr. Emon Kumar Dey instructed us to submit a report as part of the course evaluation, I prepare the paper. By writing the report I have learnt how to setup a cluster for parallel computing. I have also learnt how to write a code that may execute parallel on a cluster. So we are very thankful to our course tutor for giving us the opportunity.
  • 6. 6 What is Parallel Computing? Parallel computing is used for multiple processing components simultaneously to resolve a problem. This is carried out by splitting the problem into independent section in order that every single processing component can easily execute its section of the algorithm simultaneously with the others. The processing components may be diverse including resources like a single computer with multiple processors, several networked computers, specialized hardware, or any combination of the above Figure 1: Parallel Computing Where used Parallel Computing? Science and Engineering:  Historically, parallel computing has been considered to be "the high end of computing", and has been used to model difficult problems in many areas of science and engineering: o Atmosphere, Earth, Environment o Physics - applied, nuclear, particle, condensed matter, high pressure, fusion, photonics o Bioscience, Biotechnology, Genetics o Chemistry, Molecular Sciences o Geology, Seismology o Mechanical Engineering - from prosthetics to spacecraft o Electrical Engineering, Circuit Design, Microelectronics o Computer Science, Mathematics o Defense, Weapons
  • 7. 7 Industrial and Commercial:  Today, commercial applications provide an equal or greater driving force in the development of faster computers. These applications require the processing of large amounts of data in sophisticated ways. For example: o Databases, data mining o Oil exploration o Web search engines, web based business services o Medical imaging and diagnosis o Pharmaceutical design o Financial and economic modeling o Management of national and multi- national corporations o Advanced graphics and virtual reality, particularly in the entertainment industry o Networked video and multi-media technologies o Collaborative work environments What is Cluster Computing? Cluster computing is a model of computing where a collection of computers are interconnected with each other in order that they can behave like a single entity. The components of a cluster are normally linked to one another through fast local area networks, among each node running its own instance of an operating system. Generally in most situations, all the nodes use the same hardware and the same operating system, even though in a few configurations different operating systems may be used for each computer, as well as different hardware. Clusters are generally implemented to enhance performance and availability over compared to a single computer, while usually being much more cost-effective than single computers of comparable speed or availability. Cluster Computing is used for parallel processing, load balancing etc. Clustering is a popular strategy for implementing parallel processing programs as it enables the programs to run each independent component simultaneously in each computer. Clusters are able to executing multiple complex instructions by distributing workload throughout all connected computers. Clustering enhances the system's availability to users, its aggregate performance, and overall tolerance to faults and component failures. What are MPI and MPICH? MPI: Message Passing Interface (MPI) is a standardized and transportable message-passing system developed by a group of researchers from academia and industry to work on a wide range
  • 8. 8 of parallel computers. The goal of the Message Passing Interface is to establish a portable, efficient, and flexible standard for message passing that will be widely used for writing message passing programs. Using this API connected computer in a cluster can communicate to each other through message passing .It enables them to send and receive message and then synchronize themselves. The standard defines the syntax and semantics of a core of library routines useful to a wide range of users writing portable message-passing programs in different computer programming languages such as Fortran, C, C++ and Java. MPICH: MPICH is a high performance and widely portable implementation of the Message Passing Interface (MPI) standard. Make a Cluster for Parallel Computing What are the Prerequisites? Here we develop a cluster using MPI and then write a program, compile and execute this program using MPICH The prerequisites are 1. We need at-least two computers having Linux distribution installed on it (here we use Ubuntu 14.04 LTS) .We have to make it sure that our system has GCC installed. As Ubuntu has installed GCC built in on it, for the time being we need not to install it 2. A network connection between this two computers and they must have IP addresses assigned on them. Now let us assume that we have two computers fulfilling our prerequisites. Let the host name and the IP addresses of these computers be. Here we call all this computer node misubeimp 10.255.4.125 minhas-pc 10.255.4.98
  • 9. 9 What are the Required Packages needed to be installed? Installing MPICH As we are using mpich2 as our message passing system so we should install its packages in all the nodes. To install it we have to run the following command ***Here one important point must be noted that we have to install the same version of MPICH in all the nodes. We use MPICH2.To check the version properly run the following command. To ensure where installing MPICH2 run the following command
  • 10. 10 We may test that the program did indeed install successfully by entering the following commands in all nodes. Installing SSH Server Mpich communicates among the nodes using remote login and also distribute the processes among the nodes through remote log in. So we need to confirm that our nodes have the ability of remote log in. Remote log in can be performed using different way for example telnets, openssh .In our case we use openssh as it gives better security of data than telnet. To install openssh we have to run the following command in all nodes. Installing GCC As it is said before Ubuntu has built-in GCC installed but to ensure that which version of GCC is installed we may execute the following command If exceptionally GCC is missed then we may easily installed it using the following command in all nodes.
  • 11. 11 How to Setup the Cluster Environment? Defining hostnames: We have to define the two node host name in every node hosts file. To define that we have to edit the host file by executing the following command First the hosts file looks like the given picture. We have to edit the hosts file with our two nodes ip address and host name in this way mentioned in the below picture After editing out hosts file is looked as the following picture. Add a New User for running MPI programs: Now we have to add a new user in every node for running MPI program. In every node the new user must have the same user name. It is better to give the same password for availability. So first we make a directory in our root directory then we add our new user in the directory. Our
  • 12. 12 new user name would be mpiuser and the directory name is cluster. To do it we have to run the following command. As we directly add our user to the cluster directory without create our user that’s why the system will ask to add the new user automatically . For the time being here we just enter our password and leave all other stuff default. Now our new mpiuser successfully add to this directory and we now changes the owner ship of this directory to mpiuser .To do it we have to enter the following command.
  • 13. 13 Setting up Authorized Keys for password less communication between nodes: After successfully adding new user now we log in to the new user. Now we will generate a new ssh key. On executing the following command Here it'll ask for a paraphrase. Leave it blank as we want to create a password-less ssh (Assuming that we have a trusted LAN with no security issues).
  • 14. 14 After executing the command a folder called .ssh will be created in home directory. It’s a hidden folder. This folder will contain a file id_dsa.pub that contains your public key. This public key is used for sending cryptic message. The distinguishing technique used in public key cryptography is the use of asymmetric key algorithms, where the key used to encrypt a message is not the same as the key used to decrypt it. Each user has a pair of cryptographic keys- a public encryption key and a private decryption key. The publicly available encrypting-key is widely distributed, while the private decrypting-key is known only to the recipient. Messages are encrypted with the recipient's public key and can only be decrypted with the corresponding private key. The keys are related mathematically, but the private key cannot feasibly be derived from the public key. Now copy this key to another file called authorized_keys in the same directory. Execute the Commands in the terminal The authorized_keys file contains the key for one node and it will look like the following picture. It will show misubeimp pc’s mpiuser authorize keys We have also got another authorized_keys in minhas-pc‘s mpiuser authorize keys. Now we have to make a common authorized_keys file for both user pc so that both nodes contains the same keys in their authorized_keys file. We may do it using simply copy past command with nano editor. After make the common file the file would be look like the below picture.
  • 15. 15 Setting up the keys we setup the environment successfully. Up to that log out from the mpiuser and restart the pc. Setting up a machine-file: Now we create a file called "machinefile" in mpiuser home directory with node names followed by a colon and a number of processes to we want to execute on each node.
  • 16. 16 How to Write a Program using MPICH? Now we write our very first program using mpich convention. There is a demo example is given below. How to Compile and Execute the Program Using MPICH? To compile the above program using mpich we have to execute the following command . After compiling we can execute the compiled file using mpich to our local node without using the machine file. To do it we have to execute the following command.
  • 17. 17 Now as our goal is to execute the compiled program in both nods of our cluster so we have to make sure that in both nodes the compiled file and the machine file are present in their mpiuser home directory. After that we may execute the program with machine in any node. Here we can transfer the executable file in all nodes using different ways. 1. Using Usb Flash drive 2. Using scp command 3. Using sharing master folder. 1) Using USB Flash Drive: When we transfer the executable file among the nodes using usb flash drive we have to place the file in the same location of mpiuser account. We also make sure that this file is in executable mode .To do that we may run the following command to make the file executable. 2) Using scp command: We may transfer the executable file using scp command from one node to another node into the same location. To do that we may execute the following command. 3) Using sharing master folder: Here we first make a folder in all nodes, and then we'll store our data and programs in this folder. And then we share the contents of this folder located on the master node to all the other nodes. As we didn’t make any master folder in our cluster so if someone is interested to know how to make a master folder, they are requested to check out the following link’s 2 and 3 no points. MpichCluster.
  • 18. 18 Now to execute the program in multiple modes we have to execute the following commands with machine file Now it will show the following output
  • 19. 19 Conclusion In the manual, firstly we have discussed on parallel computing, how parallel computing works, in which situation we need to compute parallel and why parallel computing is necessary for scientific research and industrial works. The main focus of this manual based on how to setup a cluster using Ubuntu (14.04) operating system and mpich along with writing the first parallel program and executes it in multiple pc parallel. To do so step by step procedures are mentioned in this manual .We hope this manual will be very helpful for understanding cluster computing and setting up first cluster computer. Appendix List of command used in this manual: 1) misubeimp@misubeimp:~$ sudo apt-get update 2) misubeimp@misubeimp:~$ sudo apt-get install mpich2 3) misubeimp@misubeimp:~$ mpichversion 4) misubeimp@misubeimp:~$ which mpiexec 5) misubeimp@misubeimp:~$ which mpirun 6) misubeimp@misubeimp:~$ sudo apt-get install openssh-server 7) misubeimp@misubeimp:~$ gcc -- version 8) misubeimp@misubeimp:~$ sudo apt-get install build-essential 9) misubeimp@misubeimp:~$ sudo gedit /etc/hosts 10) misubeimp@misubeimp:~$ sudo mkdir /cluster 11) misubeimp@misubeimp:~$ sudo adduser mpiuser --home /clutser 12) misubeimp@misubeimp:~$ sudo chown mpiuser / cluster 13) misubeimp@misubeimp:~$ su – mpiuser 14) mpiuser@misubeimp:~$ cd .ssh 15) mpiuser@misubeimp:~$ ssh-keygen -t dsa 16) mpiuser@misubeimp:~$ cat id_dsa.pub >> authorized_keys 17) mpiuser@misubeimp:~$ cat authorized_keys 18) mpiuser@misubeimp:~$ nano authorized_keys 19) misubeimp@misubeimp:~$ mpicc I_am_alive –o I_am_alive.c 20) misubeimp@misubeimp:~$ mpiexe –n 8 ./I_am_alive 21) misubeimp@misubeimp:~$ sudo scp I_am_alive @minhas-pc 22) misubeimp@misubeimp:~$ sudo chmod +x I_am_alive 23) misubeimp@misubeimp:~$ mpiexe –n 8 –f machinefile ./I_am_alive