lecture 9: 9/24/2002cs170 fall 20021 cs170 computer organization and architecture i ayman...

10
Lecture 9: 9/24/ 2002 CS170 Fall 2002 1 CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture 9: 9/24/2002

Upload: madlyn-york

Post on 04-Jan-2016

217 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Lecture 9: 9/24/2002CS170 Fall 20021 CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University

Lecture 9: 9/24/2002 CS170 Fall 2002 1

CS170 Computer Organization and Architecture I

Ayman Abdel-Hamid

Department of Computer Science

Old Dominion University

Lecture 9: 9/24/2002

Page 2: Lecture 9: 9/24/2002CS170 Fall 20021 CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University

Lecture 9: 9/24/2002 CS170 Fall 2002 2

Outline

•Problem 2.44 (Another example of Amdahl’s law)

•Harmonic Mean

•Fallacies and Pitfalls

Using arithmetic mean with normalized execution times

Geometric Mean of execution time ratios is proportional to total execution time

Other pitfalls

Should cover section 2.7

Page 3: Lecture 9: 9/24/2002CS170 Fall 20021 CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University

Lecture 9: 9/24/2002 CS170 Fall 2002 3

Another example For Amdahl’s Law

Problem 2.44 on page 102

Page 4: Lecture 9: 9/24/2002CS170 Fall 20021 CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University

Lecture 9: 9/24/2002 CS170 Fall 2002 4

Arithmetic Mean with Normalized Execution Times1/2

M/C A M/C B

P1 1 10

P2 1000 100

Normalize to A

M/C A M/C B

P1 1 10

P2 1 0.1

AM 1 5.05

Normalize to B

M/C A M/C B

P1 0.1 1

P2 10 1

AM 5.05 1

Machine A is 5.05 times faster than B Machine B is 5.05 times faster than A

Problem ? (result depends on which machine is used as reference)

AM: Arithmetic Mean

ET(B)/ET(A)

10/1

Page 5: Lecture 9: 9/24/2002CS170 Fall 20021 CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University

Lecture 9: 9/24/2002 CS170 Fall 2002 5

Arithmetic Mean with Normalized Execution Times2/2

Normalize to A

M/C A M/C B

P1 1 10

P2 1 0.1

GM 1 1

Normalize to B

M/C A M/C B

P1 0.1 1

P2 10 1

GM 1 1

According to GM, machine A and B have the same speed

Normalized results should be combined with the geometric mean and not arithmetic mean

Geometric mean independent of which machine is used a reference because of the property

GM

Geometric Mean

Y

XGM

YGM

XGM

)(

)( Take ratio of means or means of ratios produces the same results

Page 6: Lecture 9: 9/24/2002CS170 Fall 20021 CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University

Lecture 9: 9/24/2002 CS170 Fall 2002 6

Geometric Mean does not track total ET

M/C A M/C B

P1 1 10

P2 1000 100

AM 500.5 55

•GM suggested that A and B have same performance

•Advantages

independent of running times of individual programs

Does not matter which machine used for normalization

•Disadvantage

Does not predict execution time

AM of execution times (proportional to total ET) suggests that B is 9.1 times faster than A

Page 7: Lecture 9: 9/24/2002CS170 Fall 20021 CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University

Lecture 9: 9/24/2002 CS170 Fall 2002 7

Harmonic Mean•When performance is expressed as a rate, such as MIPS, or MFLOPS (million floating point operations per second)

•see page 99 for a discussion of MFLOPS

•Harmonic mean tracks total execution (HM)

•Exercise 2.39 page 100

Page 8: Lecture 9: 9/24/2002CS170 Fall 20021 CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University

Lecture 9: 9/24/2002 CS170 Fall 2002 8

Other pitfalls1/2

Using hardware-independent metrics predict performance

Use code size as measure of speed

COPYRIGHT 1998 MORGAN KAUFMANN PUBLISHERS, INC. ALL RIGHTS RESERVED

•CDC 6600 runs Algol programs almost 6 times faster than B5500

•CDC6600 programs are over three times as big as B5500 programs

Page 9: Lecture 9: 9/24/2002CS170 Fall 20021 CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University

Lecture 9: 9/24/2002 CS170 Fall 2002 9

Other pitfalls2/2

Synthetic benchmarks predict performance

Artificial programs that are constructed to try to match characteristics of a large set of problems

Examples

•Whetstone: measurements of Algol problems in a scientific and engineering environment, later converted to Fortran

•Dhrystone: benchmark for systems programming environment (originally written in Ada, then converted to C)

•Not interesting as real applications, and do not reflect program behavior

•Compiler and hardware optimizations can inflate performance

Page 10: Lecture 9: 9/24/2002CS170 Fall 20021 CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University

Lecture 9: 9/24/2002 CS170 Fall 2002 10

Big Picture

•Execution time is the only valid measure of performance

Remember the problems with MIPS as a measure of performance

•Any measure that summarizes performance should reflect execution time

•Weighted arithmetic mean summarizes performance while tracking execution time