170 likes | 259 Views
CS 584. Logic. The art of thinking and reasoning in strict accordance with the limitations and incapacities of the human misunderstanding. The basis of logic is the syllogism, consisting of a major and minor premise and a conclusion. Example.
E N D
Logic The art of thinking and reasoning in strict accordance with the limitations and incapacities of the human misunderstanding. The basis of logic is the syllogism, consisting of a major and minor premise and a conclusion.
Example • Major Premise: Sixty men can do a piece of work sixty times as quickly as one man. • Minor Premise: One man can dig a post-hole in sixty seconds. • Conclusion: Sixty men can dig a post-hole in one second.
Performance Analysis:"Tar Baby" • Ask the right questions • Questions to consider • What is time? • What is work? • Objectivity is the key • Take a step back from your program
Performance Analysis Statements • There is always a trade-off between time and solution quality. • We should compare the quality of the answer for a given execution time. • For any performance reporting, find and clearly state the quality measure.
Efficiency • Efficiency is defined as speedup/P • With superlinear speedup efficiency > 1 • Does cache make a processor work at 110%? • Why is communication not considered work but rather overhead?
Speedup • Conventional speedup is defined as the reduction in execution time. • Consider running a problem on a slow parallel computer and on a faster one. • Same serial component • Speedup will be lower on the faster computer.
Speedup and Amdahl's Law • Conventional speedup penalizes faster absolute speed. • Assumption that task size is constant as the computing power increases results in an exaggeration of task overhead. • Scaling the problem size reduces these distortion effects.
Solution • Gustafson introduces scaled speedup. • Scale the problem size as you increase the number of processors. • Calculated in two ways • Experimentally • Analytical models
Traditional Speedup C ( N ) = 1 Speedup C ( N ) P C1 is complexity (time) taken on a single processor CP is complexity (time) taken on P processors
C ( PN ) = 1 Speedup C ( PN ) P Scaled Speedup C1 is complexity (time) taken on a single processor CP is complexity (time) taken on P processors
Experimental Scaled Speedup • Keep the ratio N/P constant between single processor case and many processor case when testing • Example:Calculate the speedup for 8, and 16 processors. • N/P = 256 • How big should the problem be?
Using analytical models • Examine the control flow of the algorithm • Find a general algebraic form for the complexity (execution time). • Fit the curve with experimental data. • If the fit is poor, find the missing terms and repeat. • Calculate the scaled speedup using formula.
+ C ( PN ) 2 12 ( 4 ( 128 )) 6146 = = = 1 3 . 93 + + C ( PN ) 4 12 ( 4 ( 128 ) / 4 ) 5 ( 4 ) 1560 P Example • Serial Time = 2 + 12 N seconds • Parallel Time = 4 + 12 N/P + 5P seconds • Let N/P = 128 • Scaled Speedup for 4 processors is:
Traditional Speedup ideal Speedup measured Number of Processors
Scaled Speedup Large Problem ideal Speedup Medium problem Small problem Number of Processors
Assignment • Problems on the web • Create a model for your program • Use the model to calculate • traditional speedup • scaled speedup • Experimentally calculate the values • Compare the results.