Parallel and Distributed Computing
Parallel and Distributed Computing
G
CLOUD COMPUTING
DEFINITION
•Parallel computing (processing):
• the use of two or more processors (computers), usually within a single
system, working simultaneously to solve a single problem.
Serial Computing:
•Traditionally, software has been written for serial
computation:
•A problem is broken into a discrete series of instructions
•Instructions are executed sequentially one after another
•Executed on a single processor
•Only one instruction may execute at any moment in time
SERIAL EXECUTION
PARALLEL COMPUTING
•We want things done fast. If we can get it by the end of the
week, we actually want it tomorrow. If we can get it tomorrow, we
would really like it today. Let's face it, we're a society that doesn't
like to wait.
•Just think about the last time you stood in line at a fast food
restaurant and had to wait for more than a couple of minutes for
your order.
THE INHERENT NEED FOR SPEED
•But did you know that a single computer is often not up to the
task? That is where the idea of parallel computing comes in.
PARALLEL COMPUTING
•In simple terms, parallel computing is breaking up a task into smaller pieces
and executing those pieces at the same time, each on their own processor
or on a set of computers that have been networked together. Let's look at a
simple example. Say we have the following equation:
•Y = (4 x 5) + (1 x 6) + (5 x 3)
•On a single processor, the steps needed to calculate a value for Y might look
like:
•Step 1: Y = 20 + (1 x 6) + (5 x 3)
•Step 2: Y = 20 + 6 + (5 x 3)
•Step 3: Y = 20 + 6 + 15
•Step 4: Y = 41
PARALLEL COMPUTING
Processing Mechanism
•In parallel computing multiple processors perform processing.
•In distributed computing, computers rely on message passing.
Memory
•In Parallel computing, computers can have shared memory
or distributed memory.
•In Distributed computing, each computer has their own
memory.
PARALLEL VS DISTRIBUTED COMPUTING
Usage
•Parallel computing is used to increase performance and
for scientific computing.
•Distributed computing is used to share resources and to
increase scalability.
Synchronization
•All processors share a single master clock for synchronization.
•There is no global clock in distributed computing, it
uses synchronization algorithms.
.
HARDWARE ARCHITECTURES FOR
PARALLEL PROCESSING
•The core elements of parallel processing are CPUs. Based
on the number of instructions and data streams, that can
be processed simultaneously,
computing classified into the following
systems are four
categories:
••Single-instruction,
Single-instruction,Single-data (SISD)
Multiple-data systems
(SIMD) systems
•Multiple-instruction, Single-data (MISD) systems
•Multiple-instruction, Multiple-data (MIMD)
systems
.
SINGLE – INSTRUCTION , SINGLE DATA (SISD)
SYSTEMS
•SISD computing system is a uni-processor machine capable of executing a
single instruction, which operates on a single data stream.
•Machine instructions are processed sequentially, hence computers adopting
this model are popularly called sequential computers.
•Most conventional computers are built using SISD model.
•All the instructions and data to be processed have to be stored in
primary
memory.
•The speed of processing element in the SISD model is limited by the rate at
which the computer can transfer information internally.
•Dominant representative SISD systems are IBM
PC, Macintosh, and
workstations.
SINGLE – INSTRUCTION , SINGLE DATA (SISD)
SYSTEMS
Instruction
Stream
Processo
r
SINGLE – INSTRUCTION , MULTIPLE DATA
(SIMD) SYSTEMS
•SIMD computing system is a multiprocessor machine capable of executing
the same instruction on all the CPUs but operating on different data
streams.
•Machines based on this model are well suited for scientific computing since
they involve lots of vector and matrix operations.
•For instance statement Ci = Ai * Bi, can be passed to all the processing
elements (PEs), organized data elements of vectors A and B can be divided
into multiple sets ( N- sets for N PE systems), and each PE can process one
data set.
•Dominant representative SIMD systems are Cray’s Vector processing machine
and Thinking Machines Cm*, and GPGPU accelerators.
SINGLE – INSTRUCTION , MULTIPLE DATA
(SIMD) SYSTEMS
Single Instruction Stream
Data Data
Input 1 Output 1
Processor 1
Data
Data
Output 2
Input 2
Processor
2
Data
Data
Output N
Input N
Processor N
MULTIPLE – INSTRUCTION , SINGLE DATA
(MISD) SYSTEMS
•MISD computing system is a multi processor machine capable of executing
different instructions on different Pes all of them operating on the same data
set.
•For example
•y = sin(x) + cos(x) + tan(x)
•Machines built using MISD model are not useful in most of the
applications.
•Few machines are built but none of them available commercially.
•This type of systems are more of an intellectual exercise than a
practical
configuration.
MULTIPLE – INSTRUCTION , SINGLE DATA
(MISD) SYSTEMS
Instructio Instructio Instructio
n Stream n Stream n Stream
1 2 N
Processor 1
Processor 2
Processor N
MULTIPLE – INSTRUCTION , MULTIPLE DATA
(MIMD) SYSTEMS
•MIMD computing system is a multi processor machine capable of executing
multiple instructions on multiple data sets.
•Each PE in the MIMD model has separate instruction and data streams,
hence
machines built using this model are well suited to any kind of application.
•Unlike SIMD, MISD machine, PEs in MIMD machines work asynchronously,
•MIMD machines are broadly categorized into shared-memory MIMD and
distributed memory MIMD based on the way PEs are coupled to the main
memory.
MULTIPLE – INSTRUCTION , MULTIPLE DATA
(MIMD) SYSTEMS
Instructi Instructi Instructi
on on on
Stream 1 Stream 2 Stream N
Processor
1
Processor
2
Processor
N
SHARED MEMORY MIMD
MACHINES
•All the PEs are connected to a single global memory and they all have
access
to it.
•Systems based on this model are also called tightly coupled multi processor
systems.
•The communication between PEs in this model
takes place through the shared memory.
•Modification of the data stored in the global memory by one PE is visible to
all other PEs.
•Dominant representative shared memory MIMD systems are silicon graphics
machines and Sun/IBM SMP ( Symmetric Multi-Processing).
SHARED M E M O R Y M I M D MACHIN
ES
Memor
y
Bus
Global System
Memory
DISTRIBUTED MEMORY MIMD MACHINES
•All PEs have a local memory. Systems based on this model are also
called
loosely coupled multi processor systems.
•The communication between PEs in this model takes place through the
interconnection network, the inter process communication channel, or
IPC.
•The network connecting PEs can be configured to tree, mesh, cube, and
so on.
•Each PE operates asynchronously, and if communication/synchronization
among tasks is necessary, they can do so by exchanging messages
between them.
DISTRIBUTED MEMORY MIMD MACHINE
S
IPC IPC
Channel Channel