1.3. Underlying Principles of Parallel and Distributed Computing
1.3. Underlying Principles of Parallel and Distributed Computing
By
M.Gomathy Nayagam
Assistant Professor(SG)/CSE
Clusters
Mainframes
Stream
Stream
OutputStream
InputStream
y = sin(x) + cos(x) + tan(x)
DataOutput
DataInput
Machines built using MISD model are
SingleData
SingleData
not useful in most of the applications.
Single
Single
Processor
Processor22
Few machines are built but none of them
available commercially.
This type of systems are more of an
intellectual exercise than a practical Processor
ProcessorNN
configuration.
Elements of Parallel Computing
Multiple – Instruction , Multiple Instructi
Instructi
on
Instructi
Instructi
on
Instructi
Instructi
on
on on on
Data (MIMD) systems Stream
Stream
11
Stream
Stream
22
Stream
Stream
NN
It is a multi processor machine.
It can capable of executing multiple
instructions on multiple data sets. Data
Data Input
11
Input Data
DataOutput
Output
11
Each PE in the MIMD model has
separate instruction and data streams. Processor
Processor
11
So,this model are well suited to any
kind of application. Data
Data Input
Input Data
DataOutput
Output
22 22
Unlike SIMD, MISD machine, PEs in
MIMD machines work asynchronously, Processor
Processor
There are two types of MIMD based on 22
Very
Very Fine
Fine Level
Level
+ x load (Cores,
(Cores, Pipeline, Instructions)
Pipeline, Instructions)
Elements of Parallel Computing
Laws of Caution
Studying how much an application or a software system can
gain from parallelism
One think keep it in mind as:
Parallelism is used to perform multiple activities together
So that the system can increase its throughput or its speed.
But the relations that control the increment of speed are not
linear.
For example: for a given n processors, the user expects speed
to be increase by in times.
This is an ideal situation, but it rarely happens because of the
communication overhead.
Elements of Parallel Computing
Here two important guidelines to take into
account
Speed of computation is proportional to the square root of the system cost; they never
increase linearly. Therefore, the faster a system becomes, the more expensive it is to
increase its speed
Speed by a parallel computer increases as the logarithm of the number of processors
(i.e. y=k*log(N)).
Quiz V
https://www.menti.com/xn1bff18pv
56 35 59
Time Limit-20 Seconds
Quiz V-Answer
SISD
Elements of Distributed
Computing
Previously, we discussed techniques and architecture which
allows introduction of parallelism with in a single machine.
i.e., explained how parallelsim operates at different levels of
computing stack.
Here, in distributed computing,
Extends these conscepts
Explore how multiple activites can be perfromed by leverging
systems composed of multiple heterogenous machines and systems.
So, what exactly a distributed computing ?
What are the most common guidelines & Patterns for
imlementing distributed computing from the perspective of
software designer?
Elements of Distributed
Computing
General concepts and definitions
Distributed computing?
It studies about the models, architectures, and algorithms
used for building and managing distributed systems.
Definition by Tanenbaum:
A distributed system is a collection of independent
computers that appears to its users as a single coherent
system
It especially focused on unified usage and
aggregation of distributed resources.
Elements of Distributed
Computing
Some of the aspects for distributed computing are:
Architectural Model
That are used to harness independent computers and present them as a whole
coherent system.
Communication
It another fundamental aspects of distributed computing
Distributed systems are composed of more than one computer that colloborate
together
So, it is necessary to provide some sort of data and information exchange between
them, which generally occurs through networks.
A distributed system is one in which components located at networked
computers communicate and coordinate their action only by passing messages.
A distrbuted system is one in which components located at networked
computers communicate and coordinate their action only by passing message.
Elements of Distributed
Computing
The components of a distributed system
communicate with some sort of message passing.
This is a term the encompasses several
communication models.
Some of them are:
Hardware
Operating System
Middleware
Applications
Elements of Distributed
Computing
Components of Distributed
Systems
A distributed system is the result of
the interaction of several
components.
Applicatio
Applicatio
It traverses the entire computing Frameworks
Frameworks
for
ns
ns
for distributed
distributed
stack from hardware to software. programming
programming
Procedure
Procedure C:Node
C:Node
Procedure
Procedure A
A BB Procedure
Procedure C
C
Procedure
Procedure B
B RPC
RPC Library
Library RPC
RPC Service
Service
Program
Program AA (RPC
(RPC Program
Program CC (RPC
(RPC
Client)
Client) Server)
Server)
Parameters
Parameters Marshaling
Marshaling Return
Return Value
Value Parameters
Parameters Unmarshaling
Unmarshaling Return
Return Value
Value
and
and Procedure
Procedure Name
Name Unmarshaling
Unmarshaling and
and Procedure
Procedure Name
Name Marshaling
Marshaling
Network
Network
Technologies for distributed computing
Remote Procedure Call (RPC) Contd…
Marshaling- identifies theprocess of converting parameter and return
values in to a form that is more suitable to be transported over a
network througha sequence of bytes.
The term unmarshaling refers to the opposite procedure.
Marshaling and unmarshaling are performed by the RPC runtime
infrastructure.
The client and server user code does not necessarily have to perform
these tasks.
The RPC runtime, on the other hand, is not only responsible for
parameter packing and unpacking but also for handling the request-
reply interaction.
It happens between the client and the server process in a completely
transparent manner.
Technologies for distributed computing
Remote Procedure Call (RPC) Contd…
Therefore, developing a system leveraging RPC for IPC
consists of the following steps:
Design and implementation of the server procedures that will be
exposed for remote invocation.
Registration of remote procedures with the RPC server on the
node where they will be made available.
Design and implementation of the client code that invokes the
remote procedure(s).
Technologies for distributed computing
Remote Procedure Call (RPC) Contd…
Each RPC implementation generally provides client and server
application programming inter- faces (APIs).
It facilitate the use of this simple and powerful abstraction.
An important observation has to be made concerning the passing of
parameters and return values.
Since the server and the client processes are in two separate address
spaces, the use of parameters passed by references or pointers is not
suitable in this scenario.
Second, in user-defined parameters and return value types, it is
necessary to ensure that the RPC runtime is able to marshal them.
This is generally possible, especially when user-defined types are
composed of simple types, for which marshaling is naturally provided.
Technologies for distributed computing
Remote Procedure Call (RPC) Contd…
There also exist platform independent solutions for RPC
are:
XML-RPC and JSON-RPC
It provide RPC facilities over XML and JSON,
respectively.
Thrift is the framework developed at Facebook for
enabling a transparent cross-language RPC model.
Currently, the term RPC implementations encompass a
variety of solutions including frameworks such
distributed object programming (CORBA, DCOM, Java
RMI, and .NET Remoting) and Web services that
evolved from the original RPC concept.
Technologies for distributed computing
Distributed Object Frameworks
Extend object-oriented programming systems.
It allows objects to be distributed across a heterogeneous
network and provide facilities.
So that they can be coherently act as though they were in
the same address space.
Distributed object frameworks leverage the basic
mechanism introduced with RPC and extend it to enable
the remote invocation of object methods
Technologies for distributed computing
Distributed Object Frameworks Contd…
With respect to the RPC model, the infrastructure manages
instances that are exposed through well- known interfaces instead
of procedures.
Therefore, the common interaction pattern is the following:
The server process maintains a registry of active objects that are made
available to other processes.According to the specific implementation,
active objects can be published using interface definitions or class
definitions.
The client process,by using a given addressing scheme,obtains a reference to
the active remote object.This reference is represented by a pointer to an
instance that is of a shared type of interface and class definition.
The client process invokes the methods on the active object by calling them
through the reference previously obtained. Parameters and return values are
marshaled as happens in the case of RPC.
Technologies for distributed computing
Distributed Object Frameworks Contd…
Distributed objectf rame works give the illusion of
interaction with a local instance while invoking remote
methods.
This is done by a mechanism called a proxy skeleton.
Figure gives an overview of how this infrastructure
works.
Distributed Object Programming model
Node
Node A
A Node
Node B
B
Application
Application BB
21
21
10
10 16
16
Instance Remote
15
15
Instance
5:
5: Object
Object
1:
1:Ask
Ask for
for Object
Object
Object Proxy
Proxy Object Skeleton
Skeleton Activation
Activation
Reference
Reference
99 11
11 20
20 17
17 14 66 44
14
Remote
Remote Reference
Reference Module
Module Remote
Remote Reference
Reference Module
Module
Application
ApplicationAA
88 12
12 77
13
13
22 19
19 18 33
18
Network
Network
Technologies for distributed computing
Distributed Object Frameworks Contd…
Proxy and skeleton always constitute a pair.
The server process maintains the skeleton component.
It is in charge of executing the methods that are remotely invoked,.
The client maintains the proxy component.
It allows its hosting environment to remotely invoke methods through the proxy
interface.
The transparency of remote method invocation is achieved using one of the
fundamental properties of object-oriented programming: inheritance and
subclassing.
Both the proxy and the active remote object expose the same interface, defining
the set of methods that can be remotely called.
On the client side, a runtime object subclassing the type pub- lished by the server
is generated.
This object translates the local method invocation into an RPC call for the
corresponding method on the remote active object
Technologies for distributed computing
Distributed Object Frameworks Contd…
On the server side, whenever an RPC request is received,
it is unpacked and the method call is dispatched to the
skeleton that is paired with the client that issued the
request.
Once the method execution on the server is completed,
the return values are packed and sent back to the client,
and the local method call on the proxy returns.
Quiz 2
https://www.menti.com/c7zptw3pcv
20 29 71
Quiz 2 Answer
The following are the RPC distributed computing
Technologies
XML RPC
JSON RPC
BOTH
Examples of distributed Object
frameworks
Common Object Request Broker Architecture (CORBA):
cross platform and cross language interoperability among distributed components.
.NET Remoting:
IPC among .NET applications, a uniform platform for accessing remote objects
from within any application developed in any of the languages supported by .NET.
Service Oriented Computing
Service – oriented computing organizes distributed systems in
terms of services.
It represent the major abstraction for building systems.
Service orientation expresses applications and software
systems as an aggregation of services that are coordinated
within a service oriented architecture (SOA).
Even though there is no designed technology for the
development of service-oriented software systems, web
services are the de facto approach for developing SOA.
Web services, the fundamental component enabling Cloud
computing systems, leverage the Internet as the main
interaction channel between users and the system.
What is Services?
A service encapsulates a software component that
provides a set of coherent and related function alities
that can be reused and integrated into bigger and more
complex applications
Four Major Characteristics to identify
Service
Boundaries are explicit
A service-oriented application is generally composed of
services that are spread across different domains, trust
authorities, and execution environments.
Crossing such boundaries is costly;
Services are autonomous
Services are components that exist to offer functionality and
are aggregated and coordinated to build more complex system.
They are not designed to be part of a specific system, but they
can be integrated in several software systems, even at the same
time.
The deployment of applications is atomic,
Four Major Characteristics to identify
Service
Services share shema and contracts, not class or interface
defnintion
Services are not expressed in terms of classes or interfaces,
as happens in object-oriented systems
Services compatibility is determined based on policy.
Service orientation separates structural compatibility from
semantic compatibility.
Structural compatibility is based on contracts and schema
and can be validated or enforced by machine-based
techniques.
Semantic compatibility is expressed in the form of policies
that define the capabilities and requirements for a service
Quiz 3
https://www.menti.com/zwq5vxr2hc
28 95 6
Quiz 3 ANswer
_____ is the framework developed at Facebook for
enabling a transparent cross-language RPC model.
CORBA
XML-RPC
Thrift
Service-Oriented Architecture
(SOA)
SOA is an architectural style supporting service orientation.
It organizes a software system into a collection of interacting
services.
SOA encompasses a set of design principles that structure system
development and provide means for integrating components into a
coherent and decentralized system.
SOA based computing packages functionalities into a set of
interoperable services.
It can be integrated into different software systems belonging to
separate business domains.
There are two major roles within SOA:
Service Provider
Service Consumer
Web Services
Web Services are the prominent technology for implementing SOA
systems and applications.
They leverage Internet technologies and standards for building
distributed systems.
Several aspects make Web Services the technology of choice for
SOA.
First, they allow for interoperability across different platforms and
programming languages.
Second, they are based on well-known and vendor-independent
standards such as HTTP, SOAP, and WSDL.
Third, they provide an intuitive and simple way to connect
heterogeneous software systems, enabling quick composition of
services in distributed environment.
Web Service Interaction
References
Rajkumar Buyya, Christian Vecchiola, and
Thamarai Selvi, Mastering Cloud Computing,
McGraw Hill, ISBN-13: 978-1-25-902995-0, New
Delhi, India, 2013.
Rajkumar Buyya, Christian Vecchiola, and
Thamarai Selvi, Mastering Cloud Computing,
Morgan Kaufmann, ISBN: 978-0-12-411454-8,
Burlington, Massachusetts, USA, May 2013.