阿姆達爾定律和Gustafson law


阿姆達爾定律

Strong scaling is a measure of how, for a fixed overall problem size, the time to solution decreases as more processors are added to a system. An application that exhibits linear strong scaling has a speedup equal to the number of processors used.

Strong scaling is usually equated with Amdahl's Law, which specifies the maximum speedup that can be expected by parallelizing portions of a serial program. Essentially, it states that the maximum speedup S of a program is:

S =1(1 -P)+PN

Here P is the fraction of the total serial execution time taken by the portion of code that can be parallelized and N is the number of processors over which the parallel portion of the code runs.

The larger N is(that is, the greater the number of processors), the smaller the P/N fraction. It can be simpler to view N as a very large number, which essentially transforms the equation into S=1/ (1-P). Now, if 3/4 of the running time of a sequential program is parallelized, the maximum speedup over serial code is 1 / (1 - 3/4) = 4.

In reality, most applications do not exhibit perfectly linear strong scaling, even if they do exhibit some degree of strong scaling. For most purposes, the key point is that the larger the parallelizable portion P is, the greater the potential speedup. Conversely, if P is a small number (meaning that the application is not substantially parallelizable), increasing the number of processors N does little to improve performance. Therefore, to get the largest speedup for a fixed problem size, it is worthwhile to spend effort on increasing P, maximizing the amount of code that can be parallelized.

並行計算中的加速比是用並行前的執行速度和並行後的執行速度之比來表示的,它表示了在並行化之後的效率提升情況。

阿姆達爾定律固定負載(計算總量不變時)時的量化標準。可用公式:\frac{W_s + W_p}{W_s + \frac{W_p}{p}}來表示。式中W_s, W_p分別表示問題規模的串行分量(問題中不能並行化的那一部分)和並行分量,p表示處理器數量。


Read more at: http://docs.nvidia.com/cuda/cuda-c-best-practices-guide/index.html#ixzz322tn7J9x 

Follow us: @GPUComputing on Twitter | NVIDIA on Facebook








Gustafson's Law 


Gustafson's Law (also known as Gustafson–Barsis' law) is a law in computer science which says that computations involving arbitrarily large data sets can be efficiently parallelized. Gustafson's Law provides a counterpoint to Amdahl's law, which describes a limit on the speed-up that parallelization can provide, given a fixed data set size. Gustafson's law was first described [1] by John L. Gustafson and his colleague Edwin H. Barsis:

S(P) = P - \alpha\cdot(P-1)

where P is the number of processors, S is the speedup, and \alpha the non-parallelizable fraction of any parallel process.



兩者的形象的解釋

Amdahl's Law approximately suggests:

Suppose a car is traveling between two cities 60 miles apart, and has already spent one hour traveling half the distance at 30 mph. No matter how fast you drive the last half, it is impossible to achieve 90 mph average before reaching the second city. Since it has already taken you 1 hour and you only have a distance of 60 miles total; going infinitely fast you would only achieve 60 mph.

Gustafson's Law approximately states:

Suppose a car has already been traveling for some time at less than 90mph. Given enough time and distance to travel, the car's average speed can always eventually reach 90mph, no matter how long or how slowly it has already traveled. For example, if the car spent one hour at 30 mph, it could achieve this by driving at 120 mph for two additional hours, or at 150 mph for an hour, and so on.







發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章