<<

1

Homework Assignment 3: Solutions

ENEE646

Problem 1.1(a): 1 Throughput of a single processor = 10×10−3 = 100 transactions/sec 1000 Desired capacity gain = 100 = 10 p Using the formula: Capacity gain = 1+b(p−1) , we have 120 10 = 1 + b(120 − 1) 11 11 which gives b = 119 . Thus each extra processor processor must work 10 + 10 × 119 = 10.924 millisec- onds/transaction.

Problem 1.1(b): As the number of processors remains the same, we can increase capacity by making each extra processor to do lesser additional work per transaction. Suppose each extra processor must do a fraction b additional work, then we require 120 1800 Capacity gain = ≥ 1 + 119b 100 thus b ≤ 1/21. Thus if each extra processor takes ≤ 10 + 10/21 = 10.48 milliseconds/transaction, the required capacity is achieved.

Problem 1.2(a): Suppose there are three workloads W1, W2, W3 requiring 10, 60 and 120 operations respectively and the throughputs of the three processors A, B and C for these workloads is given in following table:

Throughputs (operation/sec) Processor workload-1 workload-2 workload-3 A 10 20 30 B 20 30 10 C 30 10 20 Suppose each vendor compares the performance of their system with others by taking the arithmetic of normalized throughputs then following results are obtained 1 10 20 30 A w.r.t B = + + ≈ 1.4 3 20 30 10 1 10 20 30 A w.r.t C = + + ≈ 1.3 3 30 10 20 1 20 30 10 B w.r.t A = + + ≈ 1.3 3 10 20 30 1 20 30 10 B w.r.t C = + + ≈ 1.4 3 30 10 20 1 30 10 20 C w.r.t A = + + ≈ 1.4 3 10 20 30 2

1 30 10 20 C w.r.t B = + + ≈ 1.3 3 20 30 10 Thus using the of normalized throughputs as performance measure for the above workload all the vendors can claim that their product is the best.

If we take the weighted of throughputs as performance measure, we get following results: weighted harmonic mean of throughputs for processor A: 1 10 60 120 = 23.75 operations/sec 190×10 + 190×20 + 190×30 weighted harmonic mean of throughputs for processor B: 1 10 60 120 ≈ 13.1 operations/sec 190×20 + 190×30 + 190×10 weighted harmonic mean of throughputs for processor C: 1 10 60 120 ≈ 15.4 operations/sec 190×30 + 190×10 + 190×20 Thus using weighted harmonic mean of throughputs as performance measure we find that the processor of vendor A is best.

Problem 1.3: Suppose for n workloads of m1, m2, ··· , mn instructions, throughputs of processor A are r1, r2, ··· rn respectively and throughputs of processor b are s1, s2, ··· , sn respectively. Then the weighted of throughput ratios A/B can be defined as:

n mi   m +m +···+m Y ri 1 2 n s i=1 i This performance measure will always show one of the systems better than the other because:

mi   m +m +···+m of throughput ratios B/A = Qn si 1 2 n = 1/(weighted geometric i=1 ri mean of throughput ratios A/B)

We can define of throughput ratios A/B as: n X ri w ∗ i s i=1 i where wi = mi/(m1 + m2 + ··· + mn). This is not a good measure to compare throughput ratios of two systems as their is no relation between “weighted arithmetic mean of throughput ratios A/B” and “weighted arithmetic mean of throughput ratios B/A”. Thus, it will not consistently show one system better than the other.

Problem 1.4: When all the workloads are the same, harmonic mean of throughputs gives the exact value of throughput. For example, suppose there are n workloads each requiring m operations and suppose the 3

throughputs for a processor for these workloads are m/t1, m/t2, ··· , m/tn respectively. Then the harmonic mean of the throughput is nm

t1 + t2 + ··· + tn which is actually the average throughput. If we use arithmetic mean we will not get the correct value of average throughput.

Similarly if the workloads require different number of operations (suppose m1, m2, ··· , mn) then weighted harmonic mean of the throughputs gives the average throughput which is:

m1 + m2 + ··· + mn

t1 + t2 + ··· + tn Thus whenever we need to average some kind of rates, harmonic mean is the best.

Harmonic mean is not effective when we compare speedups. Consider two processors A and B which perform two workloads each requiring 100 operations. Suppose A has a throughput of 10 operations/sec for workload-1 and 20 operations/sec for workload-2 and B has a throughput of 20 operations/sec for workload-1 and 10 operations/sec for workload-2.

The harmonic mean of speedups (A/B) is: 1 1 20 10  = 0.8 2 10 + 20 The harmonic mean of speedups (B/A) is: 1 1 10 20  = 0.8 2 20 + 10 Thus the harmonic mean suggests that either of the two processors is worse than the other, which is wrong. Performance of one of the processors has to be either same or better than the other, i.e. one of the average speedups should be ≥ 1, which is not true if take harmonic mean in this example. If we take geometric mean of speedups, we find that the two processors are equivalent, i.e., geometric mean of speedups is 1. Thus the harmonic mean is not suitable for calculating average speedup.