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 n Major Premise: Sixty men can do a piece of work sixty times as quickly as one man. n Minor Premise: One man can dig a post- hole in sixty seconds. n Conclusion: Sixty men can dig a post-hole in one second.
Performance Analysis: "Tar Baby" n Ask the right questions n Questions to consider –What is time? –What is work? n Objectivity is the key –Take a step back from your program
Performance Analysis Statements n There is always a trade-off between time and solution quality. n We should compare the quality of the answer for a given execution time. n For any performance reporting, find and clearly state the quality measure.
Efficiency n Efficiency is defined as speedup/P n With superlinear speedup efficiency > 1 –Does cache make a processor work at 110%? n Why is communication not considered work but rather overhead?
Speedup n Conventional speedup is defined as the reduction in execution time. n 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 n Conventional speedup penalizes faster absolute speed. n Assumption that task size is constant as the computing power increases results in an exaggeration of task overhead. n Scaling the problem size reduces these distortion effects.
Solution n Gustafson introduces scaled speedup. n Scale the problem size as you increase the number of processors. n Calculated in two ways –Experimentally –Analytical models
Traditional Speedup )( )( 1 NC NC Speedup P C 1 is complexity (time) taken on a single processor C P is complexity (time) taken on P processors
Scaled Speedup )( )( 1 PNC C Speedup P C 1 is complexity (time) taken on a single processor C P is complexity (time) taken on P processors
Experimental Scaled Speedup n Keep the ratio N/P constant between single processor case and many processor case when testing n Example:Calculate the speedup for 8, and 16 processors. –N/P = 256 n How big should the problem be?
Using analytical models n Examine the control flow of the algorithm n Find a general algebraic form for the complexity (execution time). n Fit the curve with experimental data. n If the fit is poor, find the missing terms and repeat. n Calculate the scaled speedup using formula.
Example n Serial Time = N seconds n Parallel Time = N/P + 5P seconds n Let N/P = 128 n Scaled Speedup for 4 processors is: )4(5)4/)128(4(124 ))128(4(122 )( )( 1 PNC C P
Traditional Speedup ideal measured Number of Processors Speedup
Scaled Speedup ideal Number of Processors Speedup Small problem Medium problem Large Problem
Assignment n Problems on the web n Create a model for your program n Use the model to calculate –traditional speedup –scaled speedup n Experimentally calculate the values n Compare the results.