How does performance improve with additional cores? More cores/hardware do not always result in a linear speedup.
Limiting factors
- parts of a program that cannot be executed parallelly
- data strcutres that require sequential access (f.ex. linked list)
- Verteilung auf Cores und Threads
- Overhead and time for synchronization/locking
- Memory bandwidth, cache misses
Speedup
S: Speedup, How performance improves with additional cores
T: Execution time
Success
: sequential execution time : Execution time on p CPUs.
: linear speedup
: normal speedup
Parallel speedup on p CPUs
- : linear
- (sub-linear, performance loss)
Efficiency
Beispiel
80% parallelisierbar, 20% sequenziell.
- CPUs
Amdahl’s Law
The speedup from parallelization is limited by the part that must run sequentially.
… time spend on non-parallelizable work … time spend on parallelizable work
So in the definition of speedup:
Formula with percentage
is the percentage of how much is sequential
Gustafson’s Law
Parallel part of a program scales with the problem size.
Wie viel Arbeit können wir in einem fixen Zeitfenster ausführen, wenn wir mehr Hardware hinzufügen?
Formulas
- : Percentage of sequential part
- : parallelizable part
- : number of cores
- : total time allowed for execution
- : amount of work
- : speedup achieved by processors
Gustafson’s Law can be seen as more work in the same time, Amdahl’s Law would be same work but faster need to happen.
Siehe exam , Kosten-Nutzen Analyse, lohnt es sich, mehr Hardware hinzuzufügen?