More Related Content
More from Ijarcsee Journal
More from Ijarcsee Journal (20)
93 99
- 1. ISSN: 2277 – 9043
International Journal of Advanced Research in Computer Science and Electronics Engineering
Volume 1, Issue 5, July 2012
Formulation of Homogenous Cluster Environment
using Commodity Grade computers and MPI
Paradigm
Tadrash Shah1, Neel Patel1, Nishidh Chavda2
1
B.E. (Computer Engineering).
2
Asst. Professor, CIT-Changa
Abstract - With the advent of market being flooded with called nodes in cluster taxonomy, connected in a network
cheaper processing power and memory, there is a and usually encompassed by an envelope that gives the
revolutionary shift from developing a single high end end user the feel of a single integrated system. The nodes
machine to combining cheaper and commercial machines to
may be spaced geographically distant. The most
serve the same purpose. In the interest of said proposition
important facet of the cluster is it should provide a
clusters have been the most effective option.
unified and coherent single system interpretation to the
This paper focuses on formulating and implementing end user, though the developer may work on multiple
simpler ways for homogeneous, private, high-performance, nodes for configuration and maintenance purposes.
Beowulf clustering environment, where in the nodes thus
connected and configured collectively execute a bigger tasks Cluster can be viewed as simultaneous execution of the
by breaking them up into processes, and each such process computational tasks on multiple processors with the aim
run parallel. The task gets distributed on various nodes of obtaining quick results [5]. Chief intention of setting
through processes and the final result is obtained at a single up a cluster is to provide high-performance computing as
node form where the original task was submitted. The
also distributing the large computations from a single
processes on different nodes execute in parallel. The
node to other nodes, of the network, belonging to the
Beowulf clustering environment was setup and used with
the MPICH2 message passing interface. The output trace single system envelope. The task to be run in parallel can
shows the id of processes running currently and also the be submitted to a master node which in turn breaks up the
hostname at which node they run. task into different processes and distributes to various
nodes to run in parallel and final results can cohesively
Keywords - Beowulf, Cluster, mpi, mpich2, mpiexec be obtained again from the master node. This kind of
setup is often referred to as Master-Slave mechanism.
This mechanism has been a core part of the cluster being
I. INTRODUCTION setup by the authors.
Cluster, a buzz in the market and research, apart from the Clusters can belong to either of the types, homogenous or
Grid and the Cloud technologies, which are evolving so heterogeneous. If the nodes are purely identical in terms
drastically that a lot of work, is being done in the said of hardware and operating system then the interconnect is
areas and even more needs to be done still. Cluster can called Homogenous Cluster. If these aspects of any
simply be described as a set of integrated computers, interconnect are not identical then it is called
93
All Rights Reserved © 2012 IJARCSEE
- 2. ISSN: 2277 – 9043
International Journal of Advanced Research in Computer Science and Electronics Engineering
Volume 1, Issue 5, July 2012
Heterogeneous Cluster. In the view of this paper we have single node is exposed to the external environment, as it
mainly focused on the homogenous cluster setup. may prove as a vulnerable gateway to the entire cluster.
A. Basic features of a cluster The next section describes the characteristics of the
cluster that was setup and the libraries that were utilized.
A cluster, after the setup, must possess these basic
features.
II. REPRESENTATIVE CLUSTER AND LIBRARIES USED
1. High throughput compared to the single
machine, for the same task A. Beowulf Cluster
2. Expandable to add more nodes and scalable to
serve the need of applications. The cluster that we attempted to setup was Beowulf
3. High performance gain compared to a single cluster. The name Beowulf comes from the old epic
system. English poem Beowulf. A Beowulf cluster needs a central
node that does some coordination among all the nodes. It
In a cluster, a node may communicate with another node defines no particular piece of software or a tool or a
with the message passing paradigm, messages are passed library. It simply identifies the interconnection of small
between the logical tasks to share data and to synchronize commodity grade computers to form a homogenous
their operations [12]. The results of the task submitted cluster. This cluster can be setup on the Unix or the
remain coherent. Linux operating system, though various flavors may be
used. A Beowulf cluster is capable of many things that
As said earlier this should also provide the end user with are applicable in areas ranging from data mining to
the feel that the results that he/she is obtaining are from research in physics and chemistry, all the way to the
the single system and not from a cluster of systems. This movie industry [7]. It is mainly used for two types of
is usually termed as Single System Image (SSI) of the parallelism namely, embarrassingly parallel and
cluster. A cluster should provide this feature so that the explicitly parallel [7].
end user is saved of the technical ado for submitting the
tasks and obtaining results. This concept also saves from We used the concept of explicit parallelism [7] in
the operator errors as the mechanism and the system may Beowulf cluster. The program that we implemented on
be kept centralized or decentralized, as desired, to avoid this cluster was one of the sample programs that come
the need of skilled administrator for the cluster. with MPICH2 library. The program that we used
calculated the value of PI (π) through distributed and
A cluster also requires job scheduling. The queues to be parallel processes approach. If you have the closer look at
maintained for the job scheduling may be a single queue the program, essentially a C program, it implements
on the master node or a multiple queues, single queue on various parallel message passing operations through the
each slave node. This characteristic may vary as per the MPI calls.
requirements for which the cluster is being setup. It must
also be noted that if multiple queues are used then all of B. MPICH
them must be coordinated and synchronized for the
purpose of coherence and cohesiveness. MPI stands for Message Passing Interface. This interface
handles all the message passing mechanisms required
Final look on the security of the cluster, it must be made between the nodes of the cluster for the coherence and
secure through various algorithms if it is exposed to the cohesion purposes. This interface frees the developer
external environment, however final decision may be from the need to design the message passing mechanisms
rested upon the fact that the cluster is being set up for for the application. The deployer can simply focus on the
which purpose. Usually for an inter-organizational cluster application that he wants to get deployed on the cluster
the cluster security may be not be a dire requirement. At platform. The message passing and related aspects can be
the same time security must not be ignored even if a taken care of by this interface. This has been accepted as
94
All Rights Reserved © 2012 IJARCSEE
- 3. ISSN: 2277 – 9043
International Journal of Advanced Research in Computer Science and Electronics Engineering
Volume 1, Issue 5, July 2012
a standard for message passing in the cluster system. MPI Intel Core2 Duo processor,
is not and IEEE or an ISO standard but essentially an 2.93GHz
“industry standard” [8]. Various implementations and 1GB RAM
libraries are available for this standard, namely MPICH, 250 GB hard disk
Open MPI, LAM-MPI, etc. It defines interface No extra graphics card
specification in C, C++ and FORTRAN languages. There Already installed Ethernet card
are defined MPI calls and primitives for the same. These C. Software
can be found and explored in the MPI manual.
The system consisted of dual boot between Windows XP
For this purpose we have used the open source library and Red Hat Linux 5.0. We used the bash shell of Linux
that allows the MPI implementation in C. It is named for running commands. Required Parallel Virtual
MPICH; developed by Mathematics and Computer Machine (PVM), already installed on RHEL. The C/C++
Science Division, Argonne National Laboratory. The compiler “gcc” was also already installed on the same.
version 2 of the MPICH has been used for setting up the Later we were required to install MPICH2 on the system,
cluster for which the steps are discussed below, MPICH2. which will be discussed later on. The root user of the
MPICH2 is a high performance and widely portable system was root. All the systems had this user, and the
implementation of the message passing interface (MPI) cluster was installed for this user itself. Although a
standard [9]. This is an open source and easy to extend different user may be created for the purpose of
modular framework. The only drawback that we came installation of cluster.
across was the fact that MPICH2 cannot be used with the
cluster of system that has heterogeneous representation of D. Network
the data. And that is the reason that we chose the
homogenous cluster setup. Default runtime environment The price per node of any system consists of the cost of
for the MPICH2 is called Hydra [10]. Although other network interface, and amortized to the cost of network
managers are available. switches. A switch was used to connect the PCs. We used
the switch 1 to 100GBPS, 24 port Ethernet switch. All
The section following will explore the steps and the the communication was allowed through TCP.
necessary housekeeping required for setting up the
private Beowulf cluster. The internal nodes are not directly connected to the
external internet the reserved set of IP address can be
used [12]. IP addresses of class B were used in the range
of 172.16.0.1 and onwards. We had 172.16.0.1 as the
III. SETTING UP CLUSTER
master node and the following 172.16.0.XX as the slave
nodes. It should be also noted that the IP configuration
A. Cluster nodes
was static. The host names were given as, master node
We setup a cluster on 3 nodes initially which was with node00 and the slaves as node01 and onwards. The
expanded there on. For the paper we will continue with network, thus setup was to support a standalone cluster of
three systems that we used for clustering, though the PCs. No special topology was designed for the purpose.
same can be extrapolated for any number of nodes. Out All the nodes were connected through the switch.
of them one was the master node and the rest were slave
E. Configuration in Linux
nodes.
We used the Remote Shell (rsh) for the message passing
B. Hardware and communication among nodes. There were two
reasons to use rsh, i.e. it was easy to configure and we
We used the integrated homogenous PC of the
need not focus on security then as it was a private cluster
configurations said as under -
that was being setup. The prime focus rested on the fact
of interconnecting the nodes so that they form a cluster.
95
All Rights Reserved © 2012 IJARCSEE
- 4. ISSN: 2277 – 9043
International Journal of Advanced Research in Computer Science and Electronics Engineering
Volume 1, Issue 5, July 2012
Next we were required to alter certain Linux files for our Next we configured the remote shell. We faced the
purpose. If some of them were not available they were problem that rsh was not installed on our OS. That was
created. We installed the cluster on root user only. So we done through running the yum command and installing
created a file named .rhosts in the root directory on all the missing package. The parent package for rsh was
the nodes. This file was replicated on all the nodes. The xinet, and then the child package was rsh-server. Both
file was something like this – were installed. It was found that some OS already had rsh
installed, if so then this step could be saved on those OS.
node00 root
node01 root Next we were required to add the security permissions to
node02 root the root user for rsh and related components. Added to
the /etc/securetty file-
This allowed the users to connect to the said host names
through remote shell. And it reads that each node will use rsh, rlogin, exec, pts/0, pts/1
its root user for clusters. If that needs to be done for a
particular user on a particular node, then that user name Next we modified the /etc/pam.d/rsh file –
should be mentioned in rhosts file.
#%PAM-1.0
Next was required to create a file named hosts in the /etc # For root login to succeed here with
directory. Through this hosts file we will allow the pam_securetty, "rsh" must be
communication among all the nodes with the help of IP # listed in /etc/securetty.
configuration of the node that we did before hand.The auth sufficient
file for node00 was as under – /lib/security/pam_nologin.so
172.16.0.1 node00.home.net node00 auth optional
127.0.0.1 localhost /lib/security/pam_securetty.so
172.16.0.2 node01
172.16.0.3 node02 auth sufficient
/lib/security/pam_env.so
This file for node01 will be as under –
auth sufficient
172.16.0.2 node01.home.net node01 /lib/security/pam_rhosts_auth.so
127.0.0.1 localhost
172.16.0.1 node00 account sufficient
172.16.0.3 node02 /lib/security/pam_stack.so
service=system-auth
Similar steps were followed for the rest of the node.
session sufficient
Next was required to allow each node to access every /lib/security/pam_stack.so
other node, so the permissions were to be set. They were service=system-auth
set by changing the hosts.allow file as
Next it was required to enable the rsh, rlogin, telnet and
ALL+
rexec, they are disabled by default in RHEL. That was
There was this single line in the file. This was a loosely done by modifying each file with the name bearing the
set parameter that we set and allow almost everything name of the services that we needed in /etc/xinetd.d,
without any of the security constraints. This may pose a where the
security threat if used for some highly secretive purpose
or for sensitive data.
service shell
96
All Rights Reserved © 2012 IJARCSEE
- 5. ISSN: 2277 – 9043
International Journal of Advanced Research in Computer Science and Electronics Engineering
Volume 1, Issue 5, July 2012
{ mpiexec -n <number> ./examples/cpi
socket_type = stream
wait = no where <number> is the number of processes you want to
user = root
submit to the master for execution. It can be any numeral
log_on_success += USERID
log_on_failure += USERID digit.
server = /usr/sbin/in.rshd
disable = no Also we controlled the number of processes that were to
} be submitted to each node. That was done by creating a
machinefile in the mpich2-1.4.1 directory. The
Then we restarted the xinetd service, by xinted –restart machinefile took the form as under –
command on the bash shell.
node00 : 2
F. Installing MPICH2 node01 : 4
node02 : 6
The MPICH2 package was downloaded from the site
http://mcs.anl.gov/mpi/mpich/download.html. This was The numbers that followed “:” indicate the number of
installed on the master node only. MPICH2 was installed processes that were allowed to run on each node,
with the steps as under – indicated by a host name. These are the numbers that
control the processes submitted to each node. We found
We had this file named mpich2-1.4.1.tar.gz. We untar
that default was set to 1. Each node cannot run more
this file in the folder of the name mpich2-1.4.1. Then
processes than indicated in machinefile.
MPICH was installed using the terminal. Migrating to the
MPI directory that was just created, the command was The command used to run the program in this way is –
fired in bash shell –
mpiexec -f machinefile -n <number>
./configure ./examples/cpi
This command sets up the check for the dependency that
must be checked before installation of any package. After IV. OUTPUT
the configuration completes the command –
With the command that we fired as :
make
mpiexec -f machinefile -n 16
./examples/cpi
was issued to setup the environment for the MPICH
installation. All ran fine and finally MPICH2 was
installed with a command and machinefile content as under -
node00 : 2
make install node01 : 4
node02 : 6
This took a few minutes to install.
we had output something like this –
G. Running programs Process 1 of 16 is on node00
Process 2 of 16 is on node00
Once installed, we started executing the sample programs Process 3 of 16 is on node01
from the examples directory of the mpich2-1.4.1 Process 4 of 16 is on node01
directory. These programs were executed through the Process 5 of 16 is on node01
command, also mentioned in the MPICH2 documentation Process 6 of 16 is on node01
– Process 7 of 16 is on node02
97
All Rights Reserved © 2012 IJARCSEE
- 6. ISSN: 2277 – 9043
International Journal of Advanced Research in Computer Science and Electronics Engineering
Volume 1, Issue 5, July 2012
Process 8 of 16 is on node02 Process 21 of 16 is on node01
Process 9 of 16 is on node02 Process 22 of 16 is on node01
Process 10 of 16 is on node02 Process 23 of 16 is on node01
Process 11 of 16 is on node02 Process 24 of 16 is on node01
Process 12 of 16 is on node02 Process 25 of 16 is on node01
Process 13 of 16 is on node00 Process 26 of 16 is on node01
Process 14 of 16 is on node00 Process 27 of 16 is on node01
Process 15 of 16 is on node01 Process 28 of 16 is on node01
Process 16 of 16 is on node01 Process 29 of 16 is on node01
pi is approximately Process 30 of 16 is on node01
3.1416009869231249, Error is Process 31 of 16 is on node01
0.0000083333333318 Process 32 of 16 is on node02
pi is approximately
Next we tested the same for another command with even
3.1415926535902168, Error is
more number of processes and the machinefile edited
with drastic difference in number of processes allowed in 0.0000000000004237
a node -
Thus it was seen from the two outputs described as above
mpiexec -f machinefile -n 32 that the processes get distributed as per the policy that are
./examples/cpi decided by the machinefile. It was further also noticed
that if a process, by the policy of machinefile, should go
to a particular node, but that node being busy with some
and machinefile content as under -
node00 : 1 other processes and cannot accept the processes that are
node01 : 12 sent to it from the master node, the process was then
node02 : 5 transferred to the subsequent node that can accept the
process and has not reached the maximum number of
we had output something like this – processes by policy. Such rigorous tests were done for
the said example program and the results were not at all
Process 1 of 16 is on node00 dissatisfying. The parallel execution of the processes, as
Process 2 of 16 is on node01 seen from the output trace was blatant.
Process 3 of 16 is on node01
Process 4 of 16 is on node01 And hence it was seen that the nodes were interconnected
Process 5 of 16 is on node01 and processes migrated amongst the nodes. Any
Process 6 of 16 is on node01 application that uses the MPI calls can further be
Process 7 of 16 is on node01 developed on this platform. The program can be in
Process 8 of 16 is on node01 C/C++ of FORTRAN.
Process 9 of 16 is on node01
Process 10 of 16 is on node01
Process 11 of 16 is on node01
V. CONCLUSION
Process 12 of 16 is on node01
Process 13 of 16 is on node01 Prime objective of setting up the Beowulf Cluster was
Process 14 of 16 is on node02 thus accomplished and the processes were distributed on
Process 15 of 16 is on node02 three different nodes, which ran in parallel. The
Process 16 of 16 is on node02 communication was insecure through rsh and the cluster
Process 17 of 16 is on node02 was homogeneous. The further scope of research and
Process 18 of 16 is on node02 implementation requires the use of Network File System
Process 19 of 16 is on node00 (NFS),encrypting the communication through Secure
Process 20 of 16 is on node01 Shell (ssh) and securing the connections with the help of
98
All Rights Reserved © 2012 IJARCSEE
- 7. ISSN: 2277 – 9043
International Journal of Advanced Research in Computer Science and Electronics Engineering
Volume 1, Issue 5, July 2012
firewall. This platform is scalable enough to deploy Developer for FOSS. He is pursuing his apprenticeship at Indian
Institute of Management, Ahmedabad.
clustering applications, the authors focus on such
E-mail : tadrash-106@yahoo.co.in
application in the interest of data mining. The authors
appreciate hearing from anyone who can further help
accomplish the scopes said prior.
Neel Patel completed his under-
graduation in B.E. in Computer
Engineering from Gujarat
ACKNOWLEDGMENT Technological University. He has
co-authored the paper on “A study
The authors would like to acknowledge and appreciate of ensemble applications of
the infrastructure and the resources that were provided by Occam’s Razor” recently. He is
Charotar Institute of Technology, throughout the course interested in the areas of Object
Oriented Programming with Java,
of research and study.
Database, Algorithms, High-performance computing. He has been a
treasurer of the IEEE Student Branch at Charotar Institute of
REFERENCES Technology, Changa and currently a student member of the same. He
has also worked with Times of India under the movement called Teach
[1] Rajkumar Buyya, "High Performance Cluster Computing",
India. He has worked with various companies towards various projects
Vol 1, Pearson Education, 1999.
[2] Amit Jain, "Beowulf Cluster Design and Setup", Boise State and is pursuing his apprenticeship at Indian Institute of Management,
University, April 2006 Ahmedabad.
[3] http://www.beowulf.org E-mail : neel_pa_25@yahoo.co.in
[4] http://www.beowulf/underground.org
[5] Dr. Deven Shah, "Advanced Computing
Technology",Dreamtech Press, pp.2, 2011.
Nishidh Chavda is an Assistant
[6] T. Sterling, J. Salmon, D. Becker and D. Savarese, "How To
Build a Beowulf", MIT Press, 1999 Professor at Charotar University of
[7] http://fscked.org/writings/clusters/cluster-1.html Science and technology
[8] ttps://computing.llnl.gov/tutorials/mpi/ (CHARUSAT). He has guided the
[9] http://www.anl.gov/research/projects/mpich2/ other two authors in this paper. He
[10] MPICH2 User's Guide completed his Masters Degee, M.E.
[11] http://linuxjournal.com/article/5690 in Computer Engineering from
[12] T. sterling, “Beowulf Cluster Computing with Linux”, MIT
Dharamsinh Desai University,
Press, October 2001
[13] R.J. Allan, S. J. Andrews and M.F. Guest, “High Nadiad. His research interests include
Performance Computing and Beowulf Clusters”, 6th Data Mining, Computer Networks,
European SGI/Cray MPP Workshop, Manchester, 7- Computer Organization, Data
8/9/2000. Structures, Compiler Construction and High-performance computing.
E-mail : nishidhchavda.ce@charusat.ac.in
AUTHORS
Tadrash Shah obtained his
bachelor’s degree, B.E. in
Computer Engineering from Gujarat
Technological University. He stood
first in his college in Degree
Engineering. He has published his
paper on “A study of ensemble
applications of Occam’s Razor”
recently. He is interested in the
research in the subjects like
Algorithms, High-performance computing and Databases. He has been
an intern at IIT-Gandhinagar and worked on the project titled” Virtual
Geotechnical Laboratory”, funded by MHRD. He currently works with
IIT-Bombay for Spoken Tutorials project as a Promoter and Tutorials
99
All Rights Reserved © 2012 IJARCSEE