6.1.3 · D3 · HinglishParallelism & Multicore

Worked examplesAmdahl's Law and Gustafson's Law

2,849 words13 min read↑ Read in English

6.1.3 · D3 · Hardware › Parallelism & Multicore › Amdahl's Law and Gustafson's Law

Is page mein parent laws ko har tarah ke inputs ke saath drill kiya gaya hai: ek aam middle-of-the-road case, do extreme cases ( aur ), "infinite cores" ka limit, ek word problem mein chupi hui serial fraction, aur woh classic exam trap jahan tumhe sahi law choose karni padti hai. Kuch bhi compute karne se pehle, har symbol ka naam le lete hain.

Scenario matrix

Neeche har worked example us cell ke saath tagged hai jahan woh fit hota hai. Saath milke yeh har cell ko cover karte hain.

# Case class Input mein kya khaas hai Kaunsi law Example
A Typical mid-range , finite Amdahl Ex 1
B Degenerate: kuch bhi serial nahi dono Ex 2
C Degenerate: kuch bhi parallel nahi dono Ex 2
D Limit serial ceiling Amdahl Ex 3
E Hidden (profiling trap) time se, code lines se nahi Amdahl Ex 4
F Scaled workload problem ke saath badhti hai Gustafson Ex 5
G Same numbers, dono laws pessimist vs optimist compare karo dono Ex 6
H Inverse problem given , nikalo Amdahl Ex 7
I Exam twist: law choose karo word problem, ambiguous judgment Ex 8

Woh picture jo poori matrix ko jodhti hai — speedup kaise muda jaata hai jab badalta hai. Figure s01: horizontal axis processors ki sankhya hai (1 se 64); vertical axis Amdahl speedup hai. Grey dashed line impossible ideal hai. Green curve () us ideal par chadhi hai; jaise badhta hai (blue), (orange), (red) tak, curves door hokar jaldi flatten ho jaate hain — red arrow dikhata hai ki bada kaise flatter, neechi curve deta hai.

Figure — Amdahl's Law and Gustafson's Law

Case A — ordinary Amdahl case ()

Load imbalance aur coordination effective ko algorithmic se bura bana dete hain — dekho Load Balancing aur Thread Synchronization.


Cases B & C — do degenerate extremes ( aur )


Case D — infinite-core ceiling

Neeche figure mein dashed line exactly yahi ceiling hai. Figure s02: horizontal axis hai (1 se 120), vertical axis ke liye hai (blue curve). Red dashed horizontal line par baithi hai. Do dots hamare worked points mark karte hain — orange dot par aur green dot par — dikhata hai curve red ceiling ki taraf creep kar raha hai lekin touch nahi karta.

Figure — Amdahl's Law and Gustafson's Law

Case E — hidden serial fraction (profiling trap)


Case F — scaled workload (Gustafson)

Amdahl ke relative kahan rehta hai? Figure s03: horizontal axis hai (1 se 64); vertical axis speedup hai. Green line ke liye Gustafson hai — yeh grey dashed ideal ke thoda neeche chadhi rehti hai aur badhti rehti hai. Blue curve same ke liye Amdahl hai, jo apni ceiling (red dashed) ki taraf flatten hoti hai. Green aur blue ke beech ka gap poori "pessimist vs optimist" story hai.

Figure — Amdahl's Law and Gustafson's Law

Case G — same numbers, dono laws (pessimist vs optimist)


Case H — inverse problem (given speedup, bottleneck dhundho)


Case I — exam twist: kaunsi law?


Recall Quick self-test

aur ka matlab hai ::: ek core par run-time, aur cores par run-time, respectively. Amdahl kaunsi clock ke against measure karta hai? ::: one-core time . Gustafson kaunsi clock ke against measure karta hai? ::: -core run-time . par Amdahl aur Gustafson dono dete hain ::: (woh agree karte hain). par Amdahl ceiling hai ::: . Measured se recover karne ke liye use karo ::: . Woh akela word jo Amdahl-vs-Gustafson decide karta hai ::: kya problem fixed hai ya scaled.