Professional Documents
Culture Documents
Coa Chapter-2
Coa Chapter-2
Problem 3
2.3 Amdahl’s law and Little’s
law
These two laws are unrelated but both provide insight into the
performance of parallel systems and multicore systems.
1 Amdahl’s Law
► Consider an example,
► If a single processor finish task within a time t, how much time do the 2 processor
finish the same task,
► Obviously ½ means half, and suppose 1 processor takes 1 sec
for
finishing task, that means T1 = 1 OR ts = 1sec.
► How much time the n processor finish the same task? It is 1/n.
► So time taken for 2 processors should be ½. That means ½ sec.
That
means speedup is doubled.
Speed-Up
► So speed up means, the time taken for one processor to complete a task divided by the
time taken for parallel processors to complete the same task.
► We can say that speedup doubles in this case.
► So the number of processors increases, the speedup also increases.
Amdahl’s Law
► They are:
1. Time taken for sequential execution (s)
2. Time taken for parallel execution (p)
3. No. of processors (p)
►As programs are made up of various data structures, serial operations like (Linked-
Lists) and Parallel operations like (trees, concurrent operations and all).
►Amdahl’s law say that speed-up depends on how much percentage of program is serial
and how much percentage of program is parallel.
Amdahl’s Law
► This is the total time taken by n processors to finish a task, which depends
on serial part of the program and also the parallel part of the program.
► This is called as Amdahl’s Law.
► According to Amdahl’s Law:
► This is the total time taken by n processors to finish a task, which depends
on serial part of the program and also the parallel part of the program.
► This is called as Amdahl’s Law.
► According to Amdahl’s Law:
Program running on a single processor such that fraction(1-f) of the execution time involves
code that is serial and fraction f which is inherently parallel. Let T be the execution time of
the program using single processor.
= 1
(1-f)+f/N
Amdahl’s Law
Suppose the feature of the system is used during execution is a fraction of the time f, before
Enhancement and the speed up of the feature after enhancement is Suf. Overall speedup of the
system is,
Speedup= 1
(1-f)+f/Suf
Suppose the task takes 40% of the time consumed .when a new hardware is added the module
is speeded up by factor K, then the overall speed up is
Speedup= 1
0.6+0.4/K
► For Eg:
n=10, P=60%, S=40%
Speed-Up = 1
(1-p)+p/n
= 1
(1-0.6)+0.6/10
=(1/(0.6) + (0.6)) / 10
= 2.17
Amdahl's law is an expression used to find the maximum expected improvement to an
overall system when only part of the system is improved. It is often used in parallel
computing to predict the theoretical maximum speedup using multiple processors.
Ex:Predict System Speedup: Let a program have 40 percent of its code enhanced to run
2.3 times faster. What is the overall system speedup S?
s= 1
(1-f)+f/N
s= 1
(1-f)+f/k
Assume the limit, where k = infinity, s=1/(1-f)
S = 1/(1 – 0.4)= 1 / 0.6 = 1.67 .
So S = 1.67 is the maximum possible speedup, and we cannot achieve S = 4.3
LITTLE’S LAW
where
L – the average number of items in a queuing system
λ – the average number of items arriving at the system per unit of time
W – the average waiting time an item spends in a queuing system
1.Assume customers arrive at the rate of 10 per hour and stay an average of 0.5 hour.
find the average number of customers in the store?
L = lamda * W
2. consider the counter and its queue. Assume we notice that there are on average 2
customers in the queue and at the counter. We know the arrival rate is 10 per hour, so
how much time customers must be spending on average for checking out?
W= L /lamda=2/10=0.2
Little’s law cont...
The central element of the system is a server, which provides some service to
items.
Items from some population of items arrive at the system to be served.
If the server is idle/free, an item is served immediately. Otherwise, an arriving
item joins a waiting line, or queue.
There can be a single queue for a single server,
a single queue for multiple servers, or
multiples queues, one for each of multiple servers.
When a server has completed serving an item, the item departs
Examples:
A processor provides service to processes; a transmission line provides
a transmission service to packets or frames of data; and
Little’s law cont...
To summarize:
under steady state conditions, the average number of items in a queuing system
equals the average rate at which items arrive multiplied by the average time that
an item spends in the system.
Few assumptions:
We do not need to know what the service time distribution is,
What the distribution of arrival times is, or
the order or priority in which items are served
Because of its simplicity and generality, Little’s Law is extremely useful in
performance problems related to multi-core computers
Little’s law for multi-core system
Multi-core systems
• Each core supporting multiple threads of execution
• The cores share a common main memory and
• share a common cache memory
The best known of the SPEC benchmark suites is SPEC CPU2006:SPEC CPU2006 is
appropriate for measuring performance for applications that spend most of their time
doing computation rather than I/O.
Other SPEC suites include the following: