Algorithm Assessment and Simulating Large Machines
Tom Kelliher, CS 315
Jan. 29, 1999
Sorting on a linear array, algorithm assessment.
 Algorithm assessment.
 Simulating larger machines.
 Examples.
Bit models, lower bounds.
How can we measure a parallel algorithm? Apply following to sorting on the
linear array.
 Run time: T.
 Number of processors: N.
 Speedup: Let be the running time of the fastest sequential
algorithm. Then:
What is linear speedup?
Say you have P processors. Speedup is at most P. Why? (Hint: a
parallel algorithm that runs in T steps on P processors can be
simulated on a sequential machine in how many steps?)
 Work: W = TP.
Measures algorithm inefficiencies due to idle processors.
 Efficiency of processor utilization:
 Is it always possible to minimize T and E?
Example: consider two algorithms for solving a problem of size M:
 M steps on an M processor machine.
 steps on an processor machine.
If we have an processor machine and need to run the algorithm X
times, which algorithm should we use? Assume the processor machine
may be split in M M processor machines.
(Recall: .)
Let's say we want to solve a problem of size N with P processors.
 We generally assume that P = N. Is this valid?  More later.
 Suppose, we have finegrain processors in a
linear array. Can we sort N numbers?
Finegrain vs. coarsegrain processing.
 Assuming appropriate granularity, here's how we simulate 12
processors on 3 processors:
What about simulating processors on processors, where ?
What slowdown do we encounter?
 Is the scaleddown algorithm less efficient?
 So, why do we assume, in general, that P = N?
Implications:
 Given an algorithm efficient for large P, we can construct one
efficient for small P.
 What about the converse?
 1.2

Consider two algorithms for solving a a problem of size M, one that runs
in M steps on an Mprocessor machine and one that runs in
steps on an processor machine. Which algorithm is more
efficient?
Assume that the cost of running a Pprocessor machine for T steps is
, where and are constants and P = M or
. For what values of and is the first algorithm
cheaper to run? For what values of and is the second
algorithm cheaper to run?
 1.3

Consider two algorithms for solving a problem of size M, one that runs in
M steps on an Mprocessor machine and one that runs in steps
on an processor machine. Which algorithm will run faster on an
Nprocessor machine? (Hint: Your answer depends on the relative sizes of
M and N, and you will need to use the fact that an Nprocessor
machine can simulate a Pprocessor machine with slowdown .)
Thomas P. Kelliher
Fri Jan 29 10:40:33 EST 1999
Tom Kelliher