Beruflich Dokumente
Kultur Dokumente
9/8/09
Hypercubes
• Advantages:
– Best diameter and bisection width we have seen so far.
– Practically, these are very useful bounds and multiple systems
use a hypercube network topology.
• Disadvantages:
– Number of links per node is not constant
– p = 2d, 2d links per node = Θ(log p)
1
Bit labeling
• Because the number of processors along
any given dimension is 2, we can
represent a single coordinate by a single
bit: 0 or 1
Helpful facts
• Flipping any of the d bits returns a neighbor of a
given processor.
– Each flip corresponds to a link in the network.
2
Communication paths
• First, find the number of bits that two
messages differ.
3
Details
• We will assume that only one message is being
routed per processor.
More details
• The transmission of the message can be
performed at the rate of µ time per word.
4
Supporting simultaneous
communication
• A processor can send and receive a message at
any given time step.
Example
• This permutation (2 3 1 0) implies:
– Processor 0 sends a message to 2 (0, 2)
– Processor 1 sends a message to 3 (1, 3)
– Processor 2 sends a message to 1 (2, 1)
– Processor 3 sends a message to 0 (3, 0)
5
Multistage communication networks
6
In class example
• In small groups, what are some
permutations that can be achieved using a
ring network?
7
Shift permutations
• A shift permutation is one such that each
processor communicates with its neighbor
• Left shift:
– Processor i communicates with processor i -1
• Right shift:
– Processor i communicates with processor (i +
1) mod p
Hypercubic permutations
• Let d = ceiling (log p)
8
Another reason why
hypercubes are cool
• For example:
– Computation time = O(f(n,p))
– Communication time = O(τg(n,p) + µh(n,p))
9
A simple algorithm example
• Suppose we’d like to add n numbers,
where n >> p.
An approach
• It is clear that computing the sum of n/p
integers on a single processor requires n/p
time.
10
Communication time
• Communication time = O(τ + µ)log p
11
But why?
• Note τ and µ are constants, and we are
using O notation here, not Θ
12
An example
• Suppose our algorithm achieves ideal speedup
• Further,
– f(n,p) = g(n,p) = h(n,p) = T(n, 1) / p
Rules of thumb
• We would like f(n,p) to be as close to
O(T(n,1)/p) as possible
13