Lecture 24: Parallel Processor Architecture & Algorithms
Lecture 24: Parallel Processor Architecture & Algorithms
Algorithms
Processor Architecture
Computer architecture has evolved:
• Intel 80486 (1989): 25 MHz (became i486 because of a court ruling that prohibits the
trademarking of numbers)
• Pentium D (2005): 3.2 GHz (and then the clock speed stopped increasing)
• Quadcore Xeon (2008): 3 GHz (increasing number of cores on chip is key to perfor
mance scaling)
P P
P P
slow
fast DRAM
SRAM
$: cache P: processor
P P P
$ $ $
P P P
$ $ $
P P P
$ $ $
Most of the time program running on the processor accesses local or “cache” memory
P data
$
request
(addr)
data
P
$
2
Lecture 24 Beyond 6.006 6.006 Fall 2011
P migrate
$
program
“context”
P
$
Example
p1 p2 p2 p1 p1 p3 p2
costmig (s, d) = distance(s, d) + L ← load latency L is a function of context size
costaccess (s, d) = 2 ∗ distance(s, d)
if s == d, costs are defined to be 0
Problem
Decide when to migrate to minimize total memory cost of trace For example:
local accesses
Example: p1 p2 p2 p1 p1 p3 p2
costs
Subproblems?
Define DP (k, pi ) as cost of optimal solution for the prefix m1 , . . . , mk of memory accesses
when program starts at p1 and ends up at pi .
Complexity?
O( N ·Q · Q ) = O(N Q2 )
' ' ' '
no.of subproblems cost per subproblem
• algorithmic sculpture
• design: algorithms to fold any polyhedral surface from a square of paper [Demaine,
Demaine, Mitchell (2000); Demaine & Tachi (2011)]
Self-Assembly
Geometric model of computation
• can build n × n square using O lglglgnn tiles [Rothemund & Winfree 2000] or using
O(1) tiles & O(lg n) “stages” algorithmic steps by the bioengineer [Demaine, Demaine,
Fekete, Ishaque, Rafalin, Schweller, Souvaine (2007)]
• can replicate ∞ copies of given unknown shape using O(1) tiles and O(1) stages [Abel,
Benbernou, Damian, Demaine, Flatland, Kominers, Schweller (2010)]
6
Lecture 24 Beyond 6.006 6.006 Fall 2011
CACHE DISK/MAIN
MEMORY
FAST
SLOW
c blocks
CPU
}
block B
} block B
n lg2 n
• Bellman-Ford in O time [Mozes & Wolff-Nilson (2010)]
lg lg n
• Many problems NP-hard, even on planar graphs. But can find a solution within 1 + ε
. r k
k k
7
Lecture 24 Beyond 6.006 6.006 Fall 2011
Recreational Algorithms
• many algorithms and complexities of games [some in SP.268 and our book Games,
Puzzles & Computation (2009)]
n2
• n × n × n Rubik’s Cube diameter is Θ [Demaine, Demaine, Eisenstat, Lubiw,
lg n
Winslow (2011)]
• 6.856: Randomized Algorithms (how randomness makes algorithms simpler & faster)
10
MIT OpenCourseWare
http://ocw.mit.edu
For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.