Title: Efficient Communication and Routing for Parallel Computing
1Lecture 4 Routing Algorithms - II
By Shietung Peng
2Turn Model
- The turn model is a systematic approach to
develop partially adaptive routing algorithm for
a given network. The fundamental concept behind
the turn model is to prohibit the smallest number
of turns such that cycles are prevented. Thus,
deadlock can be avoided by prohibiting just
enough turns to break the cycles. There are five
steps for developing maximally adaptive routing
algorithms for meshes and k-ary n-cubes.
3Turn Model
- Classify channels according to the directions in
which they route packets. - Identify the turns that occur between one
direction and another. - Identify the simple cycles that turns can form.
- Prohibit one turn in each cycle.
- Add 0-degree and 180-degree turns without
reintroducing cycles.
4An Example
- Consider a 2-D mesh. There are 8 possible turns
and two possible abstract cycles. XY routing
prohibits 4 of them. However, to prevent cycles,
only 2 cycles need to be prohibited.
5An Example (Conti.)
- The corresponding west-first routing algorithm
routes a packet first west, if necessary, and
then adaptively south, east, and north. The two
turns prohibited are the turns to the west. The
minimal west-first routing algorithm is shown in
the next page. For a non-minimal version of this
algorithm, see Exercise 4.5. For minimal routing,
the algorithm is fully adaptive if the
destination is on the right-hand side of the
source.
6Minimal West-first Routing Algorithm
7West-first Routing
- Examples of west-first routing in 2-D mesh.
8Alternatives
- Of the 16 different ways to prohibit two turns,
12 prevent deadlock (a counter-example is shown
in the figure) and only 3 are unique if symmetry
is taken into account. These 3 combinations
correspond to the west-first, north first, and
negative-first routing algorithms. The
north-first does not allow turns from north to
west or from north to east. The negative-first
does not allow turns from north to west and from
east to south.
9A Counter-example
10Turn Model in Hypercubes
- An adaptive routing algorithm (called P-cube
routing) in an n-cube Let E be the set of all
dimension numbers in which the source s and the
destination t differ. Divide E into two disjoint
subsets E0 and E1, where i in E0 (E1) if the ith
bit of s is 0 (1), - The fundamental concept of P-cube routing is to
divide the routing selection into two phases
route through dimensions in E0 first, and then
route through dimensions in E1.
11Minimal P-cube Routing Algorithm
12Fully Adaptive Algorithms
- We first introduce the algorithms designed for
SAF networks using central queues. Deadlocks are
avoided by splitting buffers into several classes
and restricting packets to move from one buffer
to another in such a way that buffer class is
never decremented. These algorithms are known as
hop algorithms. The simplest hop algorithm
(positive-hop algorithm) starts by injecting a
packet into the buffer of class 0 at the current
node. Every time a packet stored in a buffer of
class i takes a hop to another node, it moves to
a buffer of class i1.
13Fully Adaptive Algorithms in SAF
- The number of buffers per node can be reduced by
allowing packets to move between buffers of the
same class. In this case, classes must be defined
such that packets moving between buffers of the
same class cannot form cycles. In the
negative-hop algorithm, network is partitioned
into several subsets such that no subset contains
two adjacent nodes.
14A Partition Scheme
15Fully Adaptive Algorithm for Wormhole Switching
- The methodology starts from a hop algorithm,
replacing central buffers by virtual channels.
The basic idea consists of splitting each
physical channel into as many virtual channels as
there were central buffers in the original hop
algorithm, and assigning virtual channels the
same way that central buffers were assigned. The
situation is depicted in the figure in the next
page.
16Extension of the SAF Algorithm
17Virtual Networks
- Idea splitting the network into several virtual
networks, each of them is a subset of channels
that are used to route packets toward a
particular set of destinations. The channel sets
corresponding to different virtual networks are
disjoint. Depending on the destination, each
packet is injected into a particular virtual
network, where it is routed until it arrives at
its destination.
18Virtual Networks for a 2-D mesh
- Idea splitting the network into several virtual
networks such that packets injected into a
virtual network can only move in one direction
for each dimension. The figure in the next page
shows the four virtual networks for a 2-D mesh.
Packets are injected into a single virtual
network depending on the destination. Once a
packet is being routed in a given virtual
network, the packet cannot be transferred to
another virtual network.
19Virtual Networks for a 2-D mesh
20Reducing the Number of Virtual Networks for a 2-D
mesh
- Idea each virtual network has channels in both
directions in the 0th dimension and only one
direction in the remaining dimensions. The
figures in the next pages show an example for a
2-D mesh and the routing algorithms for 2-D
meshes.
21Two Virtual Networks for a 2-D mesh
22Routing Algorithm for 2-D Meshes
23Routing Algorithm for 2-D Meshes
24Extension of Virtual Networks to k-ary n-cube
Networks
- IdeaEach virtual network is split into several
levels, each level has its own virtual channels.
Every time a packet crosses a wraparound channel,
it moves to the next level. The figure in the
next page shows the virtual network and their
levels for a 2-D torus. - The number of resources required can be reduced
by using proper routing sub-function and extended
channel dependency graphs.
25- Virtual
- network
- for 2-D torus