All Numerical Unit-1
All Numerical Unit-1
system, the execution time on each processor is composed of computing time and
the overhead time required for locked critical sections and/or to send data from one
processor to another. Assume a program requires t=100s of execution time on one
processor. When run on p processors, each processor requires pts, as well as an
additional 4s of overhead, irrespective of the number of processors.
Compute the per-processor execution time for 2, 4, 8, 16, 32, 64, and 128
processors. For each case, list the corresponding speedup relative to a single
processor and the ratio between actual speedup versus ideal speedup (speedup if
there was no overhead).
The per-processor execution time for 2, 4, 8, 16, 32, 64, and 128 processors,
with each having an additional 4 s of overhead, is t/p + 4 seconds for each
case. Speedup and the ratio between actual speedup and ideal speedup can
be calculated accordingly.
Explanation:
Now, let's calculate the per-processor execution time for different cases:
Next, let's calculate the speedup for each case relative to a single processor:
Finally, we can calculate the ratio between actual speedup and ideal speedup:
Ideal speedup would be equal to the number of processors used (2, 4, 8, 16,
32, 64, 128) for each case. Comparing the actual speedup to ideal speedup
provides insights into the impact of overhead.
The ratio can be calculated by dividing the actual speedup by the ideal
speedup.
2/21/25, 12:45 PM CS301: Amdahl's Law | Saylor Academy | Saylor Academy
Mark as done
This article introduces Amdahl's law, which can be used to measure how certain improvements to performance can be measured. A general form of
Amdahl's law is: (that part of the time that is improved/the improvement factor) plus that part of the time that is not improved equals the new improved
time. Speedup factor is the old time divided by the new time. Be sure to study the examples.
In computer architecture, Amdahl's law (or Amdahl's argument) is a formula which gives the theoretical speedup in latency of the execution
of a task at fixed workload that can be expected of a system whose resources are improved. It is named after computer scientist Gene
Amdahl, and was presented at the AFIPS Spring Joint Computer Conference in 1967.
Amdahl's law is often used in parallel computing to predict the theoretical speedup when using multiple processors. For example, if a
program needs 20 hours to complete using a single thread, but a one hour portion of the program cannot be parallelized, therefore only the
remaining 19 hours (p = 0.95) of execution time can be parallelized, then regardless of how many threads are devoted to a parallelized
execution of this program, the minimum execution time cannot be less than one hour. Hence, the theoretical speedup is limited to at most 20
1
times the single thread performance, ( = 20) .
1 − p
Amdahl's Law
20
18
Parallel portion
16 50%
75%
14 90%
95%
12
Speedup
10
0
1
16
32
64
128
256
512
1024
2048
4096
8192
16384
32768
65536
Number of processors
The theoretical speedup of the latency of the execution of a program as a function of the number of processors executing it, according to
Amdahl's law. The speedup is limited by the serial part of the program. For example, if 95% of the program can be parallelized, the
theoretical maximum speedup using parallel computing would be 20 times.
Definition
Amdahl's law can be formulated in the following way:
1
Slatency (s) = p
(1 − p) +
s
where
Furthermore,
https://learn.saylor.org/mod/page/view.php?id=27029 1/4
2/21/25, 12:45 PM CS301: Amdahl's Law | Saylor Academy | Saylor Academy
⎧ 1
⎪S
⎪ latency (s) ≤
1 − p
⎨
1
⎪
⎩ (8pt] lim Slatency (s) =
⎪ .
s→∞ 1 − p
shows that the theoretical speedup of the execution of the whole task increases with the improvement of the resources of the system and
that regardless of the magnitude of the improvement, the theoretical speedup is always limited by the part of the task that cannot benefit
from the improvement.
Amdahl's law applies only to the cases where the problem size is fixed. In practice, as more computing resources become available, they
tend to get used on larger problems (larger datasets), and the time spent in the parallelizable part often grows much faster than the inherently
serial work. In this case, Gustafson's law gives a less pessimistic and more realistic assessment of the parallel performance.
Derivation
A task executed by a system whose resources are improved compared to an initial similar system can be split up into two parts:
a part that does not benefit from the improvement of the resources of the system;
a part that benefits from the improvement of the resources of the system.
An example is a computer program that processes files from disk. A part of that program may scan the directory of the disk and create a list
of files internally in memory. After that, another part of the program passes each file to a separate thread for processing. The part that scans
the directory and creates the file list cannot be sped up on a parallel computer, but the part that processes the files can.
The execution time of the whole task before the improvement of the resources of the system is denoted as T . It includes the execution time
of the part that would not benefit from the improvement of the resources and the execution time of the one that would benefit from it. The
fraction of the execution time of the task that would benefit from the improvement of the resources is denoted by p. The one concerning the
part that would not benefit from it is therefore 1 − p. Then:
T = (1 − p)T + pT
It is the execution of the part that benefits from the improvement of the resources that is accelerated by the factor s after the improvement of
the resources. Consequently, the execution time of the part that does not benefit from it remains the same, while the part that benefits from it
becomes:
p
T
s
The theoretical execution time T (s) of the whole task after the improvement of the resources is then:
p
T (s) = (1 − p)T + T
s
Amdahl's law gives the theoretical speedup in latency of the execution of the whole task at fixed workload W , which yields
TW T 1
Slatency (s) = = = p
T (s)W T (s) 1−p+
s
Parallel programs
If 30% of the execution time may be the subject of a speedup, p will be 0.3; if the improvement makes the affected part twice as fast, s will
be 2. Amdahl's law states that the overall speedup of applying the improvement will be:
1 1
Slatency = p = = 1.18
0.3
1−p+ 1−0.3+
s 2
For example, assume that we are given a serial task which is split into four consecutive parts, whose percentages of execution time are p1 =
0.11, p2 = 0.18, p3 = 0.23, and p4 = 0.48 respectively. Then we are told that the 1st part is not sped up, so s1 = 1, while the 2nd part is sped up
5 times, so s2 = 5, the 3rd part is sped up 20 times, so s3 = 20, and the 4th part is sped up 1.6 times, so s4 = 1.6. By using Amdahl's law, the
overall speedup is
1 1
Slatency = p1 p2 p3 p4
= 0.11 0.18 0.23 0.48
= 2.19
+ + + + + +
s1 s2 s3 s4 1 5 20 1.6
Notice how the 5 times and 20 times speedup on the 2nd and 3rd parts respectively don't have much effect on the overall speedup when the
4th part (48% of the execution time) is accelerated by only 1.6 times.
Serial programs
https://learn.saylor.org/mod/page/view.php?id=27029 2/4
2/21/25, 12:45 PM CS301: Amdahl's Law | Saylor Academy | Saylor Academy
Original process
Make B 5x faster
Make A 2x faster
Assume that a task has two independent parts, A and B. Part B takes roughly 25% of the time of the whole computation. By working very
hard, one may be able to make this part 5 times faster, but this reduces the time of the whole computation only slightly. In contrast, one may
need to perform less work to make part A perform twice as fast. This will make the computation much faster than by optimizing part B, even
though part B's speedup is greater in terms of the ratio, (5 times versus 2 times).
For example, with a serial program in two parts A and B for which TA = 3 s and TB = 1 s,
if part B is made to run 5 times faster, that is s = 5 and p = TB/(TA + TB) = 0.25, then
1
Slatency = 0.25
= 1.25
1−0.25+
5
if part A is made to run 2 times faster, that is s = 2 and p = TA/(TA + TB) = 0.75, then
1
Slatency = = 1.60
0.75
1−0.75+
2
Therefore, making part A to run 2 times faster is better than making part B to run 5 times faster. The percentage improvement in speed can
be calculated as
1
percentage improvement = 100 (1 − )
S latency
Improving part A by a factor of 2 will increase overall program speed by a factor of 1.60, which makes it 37.5% faster than the original
computation.
However, improving part B by a factor of 5, which presumably requires more effort, will achieve an overall speedup factor of 1.25 only,
which makes it 20% faster.
It follows from Amdahl's law that the speedup due to parallelism is given by
1
T (O) (1−p) +p
O
Slatency (O, s) = = 1−p p
T (O,s) +
O s
When s = 1, we have S (O, s) = 1, meaning that the speedup is measured with respect to the execution time after the non-
latency
When s = ∞,
1
T (O) (1−p) +p
O
p
Slatency (O, ∞) = = 1−p p
= 1 + O
T (O,s) 1−p
+
O s
increased. Then
1−p 1−p T
′ ′
T (O , s) = ′
T + (1 − ′
)
O O s
It follows from Amdahl's law that the speedup due to parallelism is given by
https://learn.saylor.org/mod/page/view.php?id=27029 3/4
2/21/25, 12:45 PM CS301: Amdahl's Law | Saylor Academy | Saylor Academy
′ ′
T (O ) 1
′ ′
S (O , s) = ′ ′
=
latency T (O ,s)
1−p 1−p 1
+(1− )
′ ′ s
O O
The derivation above is in agreement with Jakob Jenkov's analysis of the execution time vs. speedup tradeoff.
Amdahl's law does represent the law of diminishing returns if on considering what sort of return one gets by adding more processors to a
machine, if one is running a fixed-size computation that will use all available processors to their capacity. Each new processor added to the
system will add less usable power than the previous one. Each time one doubles the number of processors the speedup ratio will diminish, as
the total throughput heads toward the limit of 1/(1 − p).
This analysis neglects other potential bottlenecks such as memory bandwidth and I/O bandwidth. If these resources do not scale with the
number of processors, then merely adding processors provides even lower returns.
An implication of Amdahl's law is that to speedup real applications which have both serial and parallel portions, heterogeneous
computing techniques are required. For example, a CPU-GPU heterogeneous processor may provide higher performance and energy
efficiency than a CPU-only or GPU-only processor.
Policies
Get the mobile app
Powered by Moodle
© Saylor Academy 2010-2024 except as otherwise noted. Excluding course final exams, content authored by Saylor Academy is available under a
Creative Commons Attribution 3.0 Unported license . Third-party materials are the copyright of their respective owners and shared under various
licenses. See detailed licensing information. Saylor Academy®, Saylor.org®, and Harnessing Technology to Make Education Free® are trade names
of the Constitution Foundation, a 501(c)(3) organization through which our educational activities are conducted.
b ~ y
Privacy Policy
https://learn.saylor.org/mod/page/view.php?id=27029 4/4
Amdahl’s Law
No text on concurrency is complete without mentioning Amdahl’s Law. Blindly adding
threads to speed up program execution may not always be a good idea. The law
specifies the cap on the maximum speedup that can be achieved when parallelizing the
execution of a program.
many people you hire to process the laid eggs, you still need to wait an entire day for the
100 eggs to be laid. Increasing the number of workers on the farm can’t shorten the time
it takes for a hen to lay an egg. Similarly, software programs consist of parts that can’t be
sped up even if the number of processors is increased. These parts of the program must
Example
Let’s say our program has a parallelizable portion of P = 90% = 0.9. Now let’s see how
Example:
https://gateoverflow.in/422797/gate-cse-2024-set-1-question-
45?show=445501#a445501
2/21/25, 12:58 PM Amdahl's law - Wikipedia
Amdahl's law
In computer architecture, Amdahl's
law (or Amdahl's argument[1]) is a
formula that shows how much faster
a task can be completed when more
resources are added to the system.
Definition
In the context of Amdahl's law, speedup can be defined as: [3]
or
https://en.wikipedia.org/wiki/Amdahl%27s_law 1/8
2/21/25, 12:58 PM Amdahl's law - Wikipedia
where
Implications
Followings are implications of Amdahl's law: [5][6]
Diminishing Returns: Adding more processors gives diminishing returns. Beyond a certain
point, adding more processors doesn't significantly increase speedup.
Limited Speedup: Even with many processors, there's a limit to how much faster a task can
be completed due to parts of the task that cannot be parallelized.
Limitations
Followings are limitations of Amdahl's law: [7][3][8]
Assumption of Fixed Workload: Amdahl's Law assumes that the workload remains constant.
It doesn't account for dynamic or increasing workloads, which can impact the effectiveness of
parallel processing.
Overhead Ignored: Amdahl's Law neglects overheads associated with concurrency, including
coordination, synchronization, inter-process communication, and concurrency control. Notably,
merging data from multiple threads or processes incurs significant overhead due to conflict
resolution, data consistency, versioning, and synchronization. [9]
Neglecting extrinsic factors: Amdahl's Law addresses computational parallelism, neglecting
extrinsic factors such as data persistence, I/O operations, and memory access overheads, and
assumes idealized conditions.
Scalability Issues: While it highlights the limits of parallel speedup, it doesn't address practical
scalability issues, such as the cost and complexity of adding more processors.
Non-Parallelizable Work: Amdahl's Law emphasizes the non-parallelizable portion of the task
as a bottleneck but doesn’t provide solutions for reducing or optimizing this portion.
Assumes Homogeneous Processors: It assumes that all processors are identical and
contribute equally to speedup, which may not be the case in heterogeneous computing
environments.
https://en.wikipedia.org/wiki/Amdahl%27s_law 2/8
2/21/25, 12:58 PM Amdahl's law - Wikipedia
Amdahl's law applies only to the cases where the problem size is fixed. In practice, as more
computing resources become available, they tend to get used on larger problems (larger datasets),
and the time spent in the parallelizable part often grows much faster than the inherently serial
work. In this case, Gustafson's law gives a less pessimistic and more realistic assessment of the
parallel performance.[10]
Universal Scalability Law (USL), developed by Neil J. Gunther, extends the Amdahl's law and
accounts for the additional overhead due to inter-process communication. USL quantifies
scalability based on parameters such as contention and coherency. [11]
Derivation
A task executed by a system whose resources are improved compared to an initial similar system
can be split up into two parts:
a part that does not benefit from the improvement of the resources of the system;
a part that benefits from the improvement of the resources of the system.
An example is a computer program that processes files. A part of that program may scan the
directory of the disk and create a list of files internally in memory. After that, another part of the
program passes each file to a separate thread for processing. The part that scans the directory and
creates the file list cannot be sped up on a parallel computer, but the part that processes the files
can.
The execution time of the whole task before the improvement of the resources of the system is
denoted as . It includes the execution time of the part that would not benefit from the
improvement of the resources and the execution time of the one that would benefit from it. The
fraction of the execution time of the task that would benefit from the improvement of the resources
is denoted by . The one concerning the part that would not benefit from it is therefore .
Then:
It is the execution of the part that benefits from the improvement of the resources that is
accelerated by the factor after the improvement of the resources. Consequently, the execution
time of the part that does not benefit from it remains the same, while the part that benefits from it
becomes:
The theoretical execution time of the whole task after the improvement of the resources is
then:
Amdahl's law gives the theoretical speedup in latency of the execution of the whole task at fixed
workload , which yields
https://en.wikipedia.org/wiki/Amdahl%27s_law 3/8
2/21/25, 12:58 PM Amdahl's law - Wikipedia
Parallel programs
If 30% of the execution time may be the subject of a speedup, p will be 0.3; if the improvement
makes the affected part twice as fast, s will be 2. Amdahl's law states that the overall speedup of
applying the improvement will be:
For example, assume that we are given a serial task which is split into four consecutive parts,
whose percentages of execution time are p1 = 0.11, p2 = 0.18, p3 = 0.23, and p4 = 0.48
respectively. Then we are told that the 1st part is not sped up, so s1 = 1, while the 2nd part is sped
up 5 times, so s2 = 5, the 3rd part is sped up 20 times, so s3 = 20, and the 4th part is sped up 1.6
times, so s4 = 1.6. By using Amdahl's law, the overall speedup is
Notice how the 5 times and 20 times speedup on the 2nd and 3rd parts respectively don't have
much effect on the overall speedup when the 4th part (48% of the execution time) is accelerated by
only 1.6 times.
Serial programs
For example, with a serial program in
two parts A and B for which TA = 3 s
and TB = 1 s,
https://en.wikipedia.org/wiki/Amdahl%27s_law 4/8
2/21/25, 12:58 PM Amdahl's law - Wikipedia
if part A is made to run 2 times faster, that is s = 2 and p = TA/(TA + TB) = 0.75, then
Therefore, making part A to run 2 times faster is better than making part B to run 5 times faster.
The percentage improvement in speed can be calculated as
Improving part A by a factor of 2 will increase overall program speed by a factor of 1.60, which
makes it 37.5% faster than the original computation.
However, improving part B by a factor of 5, which presumably requires more effort, will achieve
an overall speedup factor of 1.25 only, which makes it 20% faster.
It follows from Amdahl's law that the speedup due to parallelism is given by
When ,
If , and , then:
https://en.wikipedia.org/wiki/Amdahl%27s_law 5/8
2/21/25, 12:58 PM Amdahl's law - Wikipedia
It follows from Amdahl's law that the speedup due to parallelism is given by
Amdahl's law does represent the law of diminishing returns if one is considering what sort of
return one gets by adding more processors to a machine, if one is running a fixed-size computation
that will use all available processors to their capacity. Each new processor added to the system will
add less usable power than the previous one. Each time one doubles the number of processors the
speedup ratio will diminish, as the total throughput heads toward the limit of 1/(1 − p).
This analysis neglects other potential bottlenecks such as memory bandwidth and I/O bandwidth.
If these resources do not scale with the number of processors, then merely adding processors
provides even lower returns.
An implication of Amdahl's law is that to speed up real applications which have both serial and
parallel portions, heterogeneous computing techniques are required.[12] There are novel speedup
and energy consumption models based on a more general representation of heterogeneity, referred
to as the normal form heterogeneity, that support a wide range of heterogeneous many-core
architectures. These modelling methods aim to predict system power efficiency and performance
ranges, and facilitates research and development at the hardware and system software levels.[13][14]
See also
Gustafson's law
Universal Law of Computational Scalability
Analysis of parallel algorithms
Critical path method
Moore's law
References
1. Rodgers, David P. (June 1985). "Improvements in multiprocessor system design". ACM
SIGARCH Computer Architecture News. 13 (3). New York, NY, USA: ACM: 225–231 [p. 226].
doi:10.1145/327070.327215 (https://doi.org/10.1145%2F327070.327215). ISBN 0-8186-0634-
https://en.wikipedia.org/wiki/Amdahl%27s_law 6/8
The Pentium 4 Prescott processor, released in 2004, had a clock rate of 3.6 GHz
and voltage of 1.25 V. Assume that, on average, it consumed 10 W of static
power and 90 W of dynamic power. The Core i5 Ivy Bridge, released in 2012, had
a clock rate of 3.4 GHz and voltage of 0.9 V. Assume that, on average, it
consumed 30 W of static power and 40 W of dynamic power.
1.8.2 Find the percentage of the total dissipated power comprised by static
power and the ratio of static power to dynamic power for each technology.
1.8.3 If the total dissipated power is to be reduced by 10%, how much should
the voltage be reduced to maintain the same leakage current? Note: power is
defined as the product of voltage and current
Short Answer
Expert verified
1.8.1)
1.8.2)
Ratio of the static power to the dynamic power for each of the technology is 0.75
1.8.3)
01
Determine the formulas
Pentiumrprescootprocessor=StaticDynamic
….. (2)
Newvoltage-OldvoltageNewvoltage×100
The average capacitive load for both of the processors is given by the formula:
Capacitiveload=DynamicPower0.5*v2*clockrate
=400.5·0.92·3.4×109=2.904×10-8
So, we can see that the capacitive load on the core i5 processor is less than that
of the Pentium 4 Prescoot processor.
03
Find the percentage of the total dissipated power
1.8.2)
Ratio of the static power to the dynamic power for each of the technology is given
as:
=StaticpowerDynamicPower=1090=0.11
For core i5
=StaticpowerDynamicPower=3040=0.75
04
Find after dissipated power is to be reduced by 10%
1.8.3)
Since P=IV ,
P2=1-0.1P1=0.9P1
where P₁is the total power dissipated before the 10% reduction and P₂is the new
power dissipated after the 10% reduction in total dissipated power.
localid="1650927872055" P2=NewstaticpowerI2V2+newdynamicpower12×V22×
f2P2=I2V2+12×V22×f2=0.9P1
localid="1650928232901" =10Watt1.25V=8A
8A×V2+12×32×10F×V22×3.6×10Hz=0.9×100
newvoltage-oldvoltagenewvoltage×100%=1.18-1.251.18×100%
Since
I(leakage current)=staticpowervoltage=30W0.9v=33.33A
33.33A×V2+12×29.05×10F×V22×3.4×10Hz=0.9×7033.33V+49.385V2=63
33.33V+49.385V2-63=0
V=0.82V or -2.30V
. Percentage reduction=0.82-0.90.82×100%=-9.8%
1 1