Document
Document
Amdahl's Law and Gustafson's Law are crucial concepts in understanding the limits and potential of
parallel computing. They provide frameworks for analyzing how programs can benefit from additional
processors, helping developers make informed decisions about scalability and optimization strategies.
These laws highlight the importance of balancing parallelizable and sequential code sections. While
Amdahl's Law focuses on fixed-size problems, Gustafson's Law considers scenarios where problem size
can grow with available resources, offering a more optimistic view of parallel scaling potential.
Top images from around the web for Quantifying Maximum Speedup
Amdahl's Law | Introduction to High Performance and High Throughput Computing View original
Amdahl's Law | Introduction to High Performance and High Throughput Computing View original
Is this image relevant?
Amdahl's Law | Introduction to High Performance and High Throughput Computing View original
2 of 3
Amdahl's Law quantifies maximum speedup achievable through parallelization considering parallel and
sequential components
+
p
S=
(1−p)+
Overall speedup limited by fraction of program that cannot be parallelized (sequential portion)
Even small sequential portions can severely limit potential speedup in highly parallel systems (1%
sequential portion limits maximum speedup to 100x)
Optimization Strategies
Focusing efforts on parallelizable sections yields diminishing returns as sequential bottlenecks dominate
Algorithmic improvements in sequential portion can have more significant impact than simply adding
processors
Does not account for scenarios where problem size scales with number of processors (addressed by
Gustafson's Law)
Neglects real-world factors like communication overhead, load balancing, and memory constraints
Speedup Bounds
1−p
For programs with 90% parallelizable code, maximum theoretical speedup limited to 10x regardless of
processors added
Adding more processors yields diminishing returns, especially when sequential portion significant
Real-world speedups often fall short of theoretical limits due to various overheads and inefficiencies
Diminishing Returns
Law demonstrates adding more processors provides negligible improvements beyond certain point
Illustrates concept of "knee of the curve" where additional processors offer minimal benefit (typically
occurs when number of processors approaches
−
p
1−p
Highlights need for balanced approach to parallel system design considering both hardware and software
optimizations
Practical Considerations
Does not consider communication overhead between processors (can become significant bottleneck)
Ignores load balancing issues that may arise in real-world parallel systems
Fails to account for memory constraints that may limit scalability (cache coherence, memory bandwidth)
Assumes perfect parallelization which is often unrealistic due to synchronization and data dependencies
May not accurately represent performance of dynamic or irregular workloads common in many
applications
Addresses limitations of Amdahl's Law by considering scenarios where problem size scales with number
of processors
Assumes as more processors become available, problem size increases proportionally, maintaining
constant execution time
Introduces concept of "scaled speedup" measuring how much larger problem can be solved in same time
with more processors
Formula expressed as
(
P
S(P)=P−α(P−1) where S represents speedup, P represents number of processors, and α represents non-
parallelizable fraction
Demonstrates more optimistic potential speedup for problems that can scale with available resources
Gustafson's Law assumes problem size grows with number of processors while Amdahl's Law assumes
fixed problem size
Provides more optimistic outlook for parallel scaling especially for large-scale scientific and engineering
problems
Addresses limitation of Amdahl's Law in scenarios where increased computational power allows for
more detailed or larger-scale problems
Shifts focus from speeding up fixed-size problems to solving larger problems in same time
Highlights importance of considering both laws when analyzing parallel performance potential
Particularly relevant in scenarios such as scientific simulations, data analytics, and machine learning
Encourages development of scalable algorithms that can utilize additional resources effectively
Supports justification for large-scale parallel systems in fields where problem sizes can grow with
available computing power
Emphasizes importance of developing parallel algorithms that can efficiently handle increasing problem
sizes
Calculate theoretical maximum speedup for given program with known parallel fraction and number of
processors
Use formula
S=
(1−p)+
p
1
Analyze impact of varying parallel fraction on potential speedup (create graphs showing speedup vs.
number of processors for different p values)
Use results to determine cost-effectiveness of adding more processors for fixed-size problems
Estimate scaled speedup when problem size can increase with number of processors
Apply formula
Analyze how problem size can grow while maintaining constant execution time as processors increase
Compare scaled speedup predictions with fixed-size speedup from Amdahl's Law
Use results to justify investment in larger parallel systems for scalable problems
Real-world Considerations
Recognize limitations of both laws in real-world scenarios (communication overhead, load balancing,
memory constraints)
Incorporate additional factors into performance models (network topology, data locality, synchronization
costs)
Use profiling tools to identify actual parallel and sequential portions in real applications
Compare theoretical predictions with measured performance to refine models and identify optimization
opportunities
Apply insights from both laws to optimize parallel algorithms by identifying and minimizing sequential
bottlenecks in code
I was trying to understand the working of Amdahl's law but got confused in the process. Consider
the following problem:
Suppose
a program has a part at the beginning that is sequential in nature (must be executed by only one
processor) and takes 3 ms. Also, there is a part at the end of the program that is sequential (must
be executed by only one processor) and takes 4 ms. The rest of the code is divided into 5 equal
parts that are executed in parallel on 5 processes and each of these parts takes 16 ms. Calculate
speedup using Amdahl's law.
Here is how I approached this problem. I first calculated the serial and parallel fraction, where 0.3 is
the serial part and 0.7 is the parallel part calculated from the following logic:
Serial Part = 3 ms + 4 ms = 7 ms
Parallel Part = 16 ms (Only taking once as the code executes parallel on 5 processors)
Total = 7 ms + 16 ms = 23 ms