Parallel Computation Models: Slide 1
Parallel Computation Models: Slide 1
Lecture 3
Lecture 4
Slide 1
Boolean Circuits
Combinatorial Circuits
BSP
LOGP
Slide 2
P4
P5
P3
INTERCONNECTION
NETWORK
P2
P1
....
Pn
CONNECTION MACHINE
INTERNET
Slide 3
Slide 4
Slide 5
PARALLEL ALGORITHMS
WHICH MODEL OF COMPUTATION IS THE BETTER TO USE?
HOW MUCH TIME WE EXPECT TO SAVE USING A PARALLEL ALGORITHM?
HOW TO CONSTRUCT EFFICIENT ALGORITHMS?
MANY CONCEPTS OF THE COMPLEXITY THEORY MUST BE REVISITED
IS THE PARALLELISM A SOLUTION FOR HARD PROBLEMS?
ARE THERE PROBLEMS NOT ADMITTING AN EFFICIENT PARALLEL SOLUTION,
THAT IS INHERENTLY SEQUENTIAL PROBLEMS?
Slide 6
degree = 4 (N)
diameter = 2N
Slide 7
HYPERCUBE
0110
0111
1110
0100
degree = 4 (log2N)
0000
0101
0010
1111
1100
0011
1101
1010
diameter = 4
1011
0001
1000
1001
N = 24 PROCESSORS
Slide 8
Model Equivalence
given two models M1 and M2, and a problem
of size n
if M1 and M2 are equivalent then solving
requires:
T(n) time and P(n) processors on M1
T(n)O(1) time and P(n)O(1) processors on M2
Slide 10
PRAM
Parallel Random Access Machine
Shared-memory multiprocessor
unlimited number of processors, each
has unlimited local memory
knows its ID
able to access the shared memory
PRAM MODEL
1
2
3
P1
P2
.
Pi
Common Memory
.
.
.
Pn
m
Slide 12
PRAM
Inputs/Outputs are placed in the shared
memory (designated address)
Memory cell stores an arbitrarily large
integer
Each instruction takes unit time
Instructions are synchronized across the
processors
Slide 13
PRAM machine
time: time taken by the longest running processor
hardware: maximum number of active processors
Slide 15
Slide 16
Processor Activation
P0 places the number of processors (p) in the
designated shared-memory cell
each active Pi, where i < p, starts executing
O(1) time to activate
all processors halt when P0 halts
For the PRAM model there exists a well developed body of techniques
and methods to handle different classes of computational problems.
The discussion on parallel model of computation is still HOT
The actual trend:
COARSE-GRAINED MODELS
The degree of parallelism allowed is independent from the number
of processors.
The computation is divided in supersteps, each one includes
local computation
communication phase
syncronization phase
the study is still at the beginning!
Slide 19
Metrics
A measure of relative performance between a multiprocessor
system and a single processor system is the speed-up S( p),
defined as follows:
S( p) =
S( p) =
T1
Tp
Efficiency =
Sp
p
Cost = p Tp
Slide 20
Metrics
Parallel algorithm is cost-optimal:
parallel cost = sequential time
C p = T1
Ep = 100%
Amdahls Law
f = fraction of the problem thats
inherently sequential
(1 f) = fraction thats parallel
Tp f (1 f ) p
1
Speedup with p processors: S p
1 f
f
p
Slide 22
Amdahls Law
Upper bound on speedup (p = )
1
Sp
1 f
f
p
Converges to 0
1
S
f
Example:
f = 2%
S = 1 / 0.02 = 50
Slide 23
PRAM
Too many interconnections gives problems with synchronization
However it is the best conceptual model for designing efficient
parallel algorithms
due to simplicity and possibility of simulating efficiently PRAM
algorithms on more realistic parallel architectures
Slide 24
Shared-Memory Access
Concurrent (C) means, many processors can do the operation simultaneously in
the same memory
Exclusive (E) not concurent
ERCW
CRCW
Many processors can write/read at/from the same memory location
Slide 25
Example CRCW-PRAM
Initially
table A contains values 0 and 1
output contains value 0
Slide 26
Example CREW-PRAM
Assume initially table A contains [0,0,0,0,0,1] and we
Slide 27
Pascal triangle
PRAM CREW
Slide 28