Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Science 320 Measuring Speedup. What Is Running Time? T(N, K) says that the running time T is a function of the problem size N and the number.

Similar presentations


Presentation on theme: "Computer Science 320 Measuring Speedup. What Is Running Time? T(N, K) says that the running time T is a function of the problem size N and the number."— Presentation transcript:

1 Computer Science 320 Measuring Speedup

2 What Is Running Time? T(N, K) says that the running time T is a function of the problem size N and the number of processors K To determine speedup, we’ll always determine both T seq (N, K) and T par (N, K), where K = 1 and K > 1, respectively

3 What Is Speed? Speed is the rate at which program runs can be done S(N, K) = 1 / T(N, K) Measured in program runs per second, rather than seconds per run

4 What Is Speedup? Speedup is the speed of a parallel version running on K processors relative to a sequential version running on one processor Speedup(N, K) = S par (N, K) / S seq (N, 1) Why seq in the denominator?

5 Speedup in Terms of Running Time Speedup(N, K) = T seq (N, K) / T par (N, K) Ideally, the speedup should equal K, or a linear speedup The real speedup of most algorithms is sublinear

6 What Is Efficiency? Eff(N, K) = Speedup (N, K) / K Usually a fraction < 1

7 Amdahl’s Law The sequential portion of a parallel program puts an upper bound on the efficiency it can achieve The sequential parts are usually run at startup and cleanup

8 What Is the Sequential Fraction? The sequential fraction F is the fraction of the code that must be run sequentially F * T(N, 1) is the running time of the sequential part on a single processor (1 – F) * T(N, 1) is the running time of the parallel part on a single processor

9

10 Amdahl’s Law T(N, K) = F * T(N, K) + 1/K * (1 – F) * T(N, K) Running time when the parallel part is equally divided among K processors

11 Speedup and Efficiency in Terms of Sequential Fraction Speedup(N, K) = 1 / (F + (1 – F) / K) Eff(N, K) = 1 / (K * F + 1 – F)

12 Consequences of Amdahl As K increases, the speedup approaches 1 / F As K goes to infinity, the efficiency approaches 0

13 Predicted Speedups

14 Predicted Efficiencies

15 A Normal Plot for up to 8 Processors

16 Experimentally Determining F To calculate the sequntial fraction F from the running time measurements, we rearrange Amdahl’s Law to get F = (K * T(N, K) - T(N, 1)) / (K * T(N, 1) - T(N, 1)) Called EDSF If F is not a constant or EDSF versus K is not a horizontal line, something’s not right with the program

17 Measuring Running Times Not the same on each run with the same data set Take the minimum time of several runs, not the average time. Why?

18 Experimental Situation Close all unnecessary apps and prevent remote logins T seq (N, 1) must be at least 60 seconds Run the sequential program 7 times on each data size N, and take the minimum time

19 Experimental Situation For each data size N and for each K from 1 up to the number of available processors, run T par (N, K) 7 times and take each minimum time

20 Running Time of Key Search

21 Speedup of Key Search

22 Efficiency of Key Search

23 EDSF of Key Search


Download ppt "Computer Science 320 Measuring Speedup. What Is Running Time? T(N, K) says that the running time T is a function of the problem size N and the number."

Similar presentations


Ads by Google