Professional Documents
Culture Documents
Speedup and Efficiency of Parallel Algorithms: N N N P T Sequential T N P S
Speedup and Efficiency of Parallel Algorithms: N N N P T Sequential T N P S
ALGORITHMS
For a given algorithm or computation let Tp be the time to perform the
computation using p processors or arithmetic units. Note that T gives depth
of the algorithm, and T1 gives its size. Speedup with p processors is defined
as
Sp
T1
Tp
Sp
p
Then T , S and E are the time, speedup and efficiency for , where
is the number of processors for shortest time completion.
( P ul ( N )) [ N / 2]
Maximal speedup is
S ( P ul ( N ))
T1 [ N / 2]*] log 2 N [
=]N/2[
T
] log 2 N [
But this may be viewed as misleading measure because nobody will execute
Pul algorithm on 1 processor, instead there will be used ordinary algorithm
with size N-1,
So
S ( P ul ( N ))
T1 ( sequential )
N 1
ul
] log 2 N [
T ( P ( N ))
11
N 1
1
2
*
,N 4
] log 2 N [ [ N / 2] log 2 N
It is obvious that parallelism and speedup depends on the algorithm. But for
some cases there may be obtained bounds for parallelism, it is the case of
arithmetic expressions.
Lemma. For any number p of processors,
T p ( E ( N )) ] log 2 N [ ,
12
PERFORMANCE ISSUES
Factors influencing performance:
Hardware (fundamentals)
Architecture (both individual and system level)
Operating system (as extension to hardware)
Language (compiler and run-time libraries)
Program (structure and synchronization)
Algorithm (dependence graph)
AMDAHLS LAW
Let P be the number of parallel processing units (processors, ALUs, stages in
pipelines)
Let T(P) be execution time with hardware parallelism P.
Let S be the time which is required to made sequential part of an algorithm
Let Q be the time which is required to make parallel part of the algorithm
sequentially.
Then
T(P)=S+Q/P
Lets introduce
f
S
S Q
Then
T(P)=f*T(1)+(1-f)*T(1)/P
Then speedup is
S ( P)
T (1)
1
T ( P) f (1 f ) / P
S ( P)
1
P
1 f ( P 1)
13
14