• 沒有找到結果。

雙向的廣義Shuffle-Exchange網路之逆向網路之快速標記式路線安排演算法

N/A
N/A
Protected

Academic year: 2021

Share "雙向的廣義Shuffle-Exchange網路之逆向網路之快速標記式路線安排演算法"

Copied!
25
0
0

加載中.... (立即查看全文)

全文

(1)

國 立 交 通 大 學

應 用 數 學 系

碩 士 論 文

雙向的廣義 Shuffle-Exchange 網路之逆向網路之

快速標記式路線安排演算法

Efficient Tag-Based Routing Algorithms for

the Backward Network of

a Bidirectional General Shuffle-Exchange Network

研 究 生: 羅 經 凱

指導老師: 陳 秋 媛 教 授

(2)

雙向的廣義 Shuffle-Exchange 網路之逆向網路之

快速標記式路線安排演算法

Efficient Tag-Based Routing Algorithms for

the Backward Network of

a Bidirectional General Shuffle-Exchange Network

研 究 生:

羅 經 凱

Student: Jing-Kai Lou

指導老師: 陳 秋 媛 教 授 Advisor: Chiuyuan Chen

國 立 交 通 大 學

應 用 數 學 系

碩 士 論 文

A Thesis

Submitted to Department of Applied Mathematics

College of Science

National Chiao Tung University

In partial Fulfillment of Requirement

For the Degree of Master

In

Applied Mathematics

June 2005

Hsinchu, Taiwan, Republic of China

(3)

雙向的廣義Shuffle-Exchange 網路之逆向網路之

快速標記式路線安排演算法

研 究 生: 羅經凱

指導老師: 陳秋媛 教授

國 立 交 通 大 學

應 用 數 學 系

摘要

在記憶體管理、 通訊技術中, shuffle-exchange network 是廣泛被拿

來運用以及討論的網路。 在 1991 年的時候, Padmanbhan 定義並討

論了廣義的 shuffle-exchange network(簡記為GSEN), 此網路不再

限制輸入與輸出個數必為k的次方 (假設 switch element 的 size 均

為k × k)。 Padmanbhan也提出了快速標記式路線安排演算法。 到了

2003年, Chen、Liu 以及 Qiu 又將GSEN推廣成所有的連線均為雙向,

並稱之為 bidirectional GSEN。 一個 bidirectional GSEN包含了兩

個網路: 一個正向網路與一個逆向網路。 關於正向網路的路線安排, 可

以用 Padmanbhan 所提出的演算法解決; 關於逆向網路的路線安排,

Chen、Liu 以及 Qiu 等人也提出了利用 Padmanbhan 的演算法, 先

求出正向網路的標記, 然後利用此標記得出逆向網路的路線安排。 在這

篇論文中, 我們證出了逆向網路具有很好的性質: 對每個終點i而言, 有

兩個標記伴隨著它, 任意一個起點j均可利用這兩個標記中的一個, 來安

排訊息傳送路線。 我們利用此性質做出快速的一對一路線安排演算法,

此演算法在建構 routing table 時, 速度比使用 Chen、Liu 以及 Qiu

所提出的演算法來得快。

關鍵字: 連接網路, 多級式網路, shuffle-exchange 網路, Omega 網路,

標記式路線安排演算法。

(4)

Efficient Tag-Based Routing Algorithms for

the Backward Network of

a Bidirectional General Shuffle-Exchange Network

Student: Jing-Kai Lou

Advisor: Chiuyuan Chen

Department of Applied Mathematics National Chiao Tung University

Abstract

In [7], Padmanbhan proposed the general shuffle-exchange network (GSEN) and an efficient tag-based routing algorithm for it. In [1], Chen, Liu and Qiu further enhanced the GSEN with bidirectional links. The bidirectional GSEN can be divided into two dependent networks, the forward network and the backward network. Since the forward network is a GSEN, Padmanbhan’s tag-based routing algorithm can be applied on it. As for the backward network, Chen et al. [1] proposed a routing algorithm which is based on the idea of inversely using the forward control tag. In this thesis, we will show that the backward network has a wonderful property: for each destination i, there are two backward control tags associated with it such that every source j can get to i by using one of the two control tags. We will use this property to derive efficient algorithms for one-to-one routing and for constructing a routing table.

Keywords: Interconnection network, multistage network, shuffle-exchange net-work, Omega netnet-work, tag-based routing algorithm.

(5)

Acknowledgement

自認為原本在大學生活中打混的我, 在上交通研究所前。 手足無措、 坐立難安倒是很貼切的形容我當 時的處境。 我自小就不認為自己是個用功的小孩, 也不是個聰明的學生。 而卻能夠很幸運的進入掛著 人人羨慕光環下的學校內。 我不禁思考著, 今後的研究生涯將會是如何的艱澀呢? 同儕之間的競爭 下, 我的能力是否落後人家許多呢? 老師們又是會如何看待我呢? 這些問題像極了該死的蒼蠅環繞 著我, 怎樣揮也揮不去。 在正式進入交通應數所這個家族後, 我才著時發覺當初的杞人憂天。 陳秋媛老師與翁志文老師所 主持的暑期讀書會, 是我接觸這個家族的開端。 兩位老師的親切指導以及熱忱的態度, 剎時間化解了 我的擔憂。 爾後更加有榮幸的能夠進入陳老師門下, 現在回想起來真是擔心我這輩子的幸運就這樣子 通通花在這上面了呢。 陳秋媛老師對於學生該作的研究進度有著審密的計畫, 也會適度的關心學生的近況。 讓我這個平 常不怎麼用功的學生, 可也得慢慢改掉以往吊兒啷當的缺點。 原本對於“老師”都懷著敬畏之心的我 在長期與陳老師的meeting 後, 也有著生平第一次跟老師談心的機會。 在與老師的談話中也可以感 受老師的豐富人生閱歷, 使我理解不少待人處事的道理。 在這裡真的非常感謝陳秋媛老師這些日子以 來的照顧以及在學術上以及心靈上的指導。 而在網路上的研究中, 陳老師是啟蒙老師的話。 那麼我這篇論文的催生者, 就是黃光明老師了。 黃 光明老師在我眼中是位很有威嚴卻很和藹的老師。 我有幸在老師的課程中, 除了對於網路有了更深一 層的理解外。 更加幸運的是藉著這個課程讓這篇論文得以誕生。 在這裡特別感謝黃光明老師的指導。 另外同儕之間的勉勵也是促使我能夠繼續念下書的原動力, 在這裡特別感謝我的朋友們國元, 維 展, 世謙, 亮詮, 明欣以及其他的同學。 感謝他們平日對我的照顧, 也特別感謝維展時常不厭其煩的 當個好聽眾, 聽我講述論文相關的問題。 另外在交通, 我結識了不少學長: 郭俊逸學長, 是一位很好 的生活老師, 他指導我很多很多領域上的知識, 是一位很聰明的學長, 也是一位我期許自己能成為像 他的人物。 最後, 一切的一切還是要感謝家人在我背後的支持。 讓我可以無有後顧之憂的在校園內生活, 享 受如此豐富的資源。 如果沒有家人的支持, 一切皆為空談, 自然也沒有現在的成就。 老爸, 老媽以及 我那憨厚的老弟感謝你們給了我個這麼棒的家。

(6)

Contents

Abstract (in Chinese) I

Abstract (in English) II

Acknowledgement III

Contents i

List of Figures ii

1 Introduction 1

2 The bidirectional GSEN and conventions used in this thesis 4

3 Previous tag-based routing algorithms 4

4 The one-to-one routing 6

5 The routing table and the all-to-all routing 13

A Backward control tags for N0 = 18, 20, . . . , 32 14

(7)

List of Figures

1 (a) The GSEN with N0 = 22 and k = 2; this figure also shows GSEN(2,11,5).

(b) A k × k switch element and its sub ports. . . . 2 2 GSEN(2,11,5) with the switch elements that can get to (a) i = 6 and (b)

(8)

1

Introduction

The purpose of this thesis is to derive tag-based routing algorithms for the backward network of a bidirectional general shuffle-exchange network. Throughout this thesis, N0

denotes the number of inputs and the number of outputs of a network. We assume that all the switch elements in a network are identical and of size k × k.

Shuffle-exchange networks have been proposed as a popular architecture for intercon-nection networks [2, 3, 6, 5, 7, 8]. The perfect shuffle operation on N0 terminals (k | N0)

is the permutation π defined by

π(i) = (ki + ¹ ki N0 º ) mod N0, 0 ≤ i ≤ N0− 1.

In particular, when k = 2, the perfect shuffle operation separates the top N0/2 terminals

from the bottom N0/2 terminals and precisely interleaves them, with the bottom terminal

still remaining at the bottom. A shuffle-exchange network is a network with N0 = kd

inputs and outputs and each stage consists of the perfect shuffle on N0 terminals followed

by N0/k switch elements.

In a multistage interconnection network, a path from an input to an output can be described by a sequence of labels that label the successive edges on this path. Such a sequence is called a control tag [7] (or tag [1] or path descriptor [4]). The control tag may be used as a header for routing a message: each successive node uses the first element of the sequence to route the message, and then discards it. For example, in Figure 1(a), input 2 can get to output 9 by using the control tag 11 (01011), which means input 2 can get to output 9 via sub port 0 at stage 0, sub port 1 at stage 1, sub port 0 at stage 2 and sub port 1 at stage 3 and sub port 1 at stage 4; see Figure 1(b) for an illustration of sub ports.

In a shuffle-exchange network, the number of stages may be equal to or be greater than logkN0. When the number of stages is exactly log

kN0, a shuffle-exchange network

(9)

stage 0

stage 0 stage 1stage 1 stage 2stage 2 stage 3stage 3 stage 4stage 4 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 … … sub port 0 sub port 1 sub port 2 sub port k-1 sub port 0 sub port 1 sub port 2 sub port k-1 (a) (b)

Figure 1: (a) The GSEN with N0 = 22 and k = 2; this figure also shows GSEN(2,11,5).

(b) A k × k switch element and its sub ports.

destination.

In [7], Padmanbhan proposed the general shuffle-exchange network (GSEN), which allows N0 6= kd and contains exactly dlog

kN0e stages. Padmanbhan showed that the

control tags of a GSEN depend on both the source and the destination when N0 is not

a power of k. Padmanbhan also proposed an elegant tag-based routing algorithm for the GSEN.

In [1], Chen, Liu and Qiu enhanced the GSEN with bidirectional links. Their reason for the enhancement is that although unidirectional links are widely used, bidirectional links also have many applications as suggested in [2]. A bidirectional GSEN can be divided into two dependent networks: the forward network and the backward network. The forward network is from the left-hand side of the network to the right-hand side of the network;

(10)

thus a request in it is sent from left to right. On the other hand, the backward network is from the right-hand side of the network to the left-hand side of the network; thus a request in it is sent from right to left. The control tags used in the forward (backward) network are called the forward (backward) control tags.

Since a forward network is a GSEN, Padmanbhan’s tag-based routing algorithm can be used in it. As for the backward network, Chen et al. [1] implemented a tag-based routing algorithm by using the forward tag inversely. More precisely, their algorithm first runs Padmanbhan’s tag-based routing algorithm to derive the forward control tag; then, their algorithm runs another procedure to convert the forward control tag to the backward control tag. If the number of stages is n + 1, then the algorithm in [1] takes O(n) time to derive the tag for a source j to get to a destination i and it takes O(N02n) to construct

the routing table (a table that contains the backward control tags for routing the N0× N0

pairs of nodes in the backward network).

In this thesis, we show that the backward network has a wonderful property: for each destination i, there are two backward control tags associated with it such that every source j can get to i by using one of the two tags. We show that the two tags can be derived in O(n) time. Therefore, it is possible to derive in O(n) time not only a tag for a j to get to i but also the tags for every j to get to i. So, constructing the routing table can be done in O(N0n) time. We now summarize results of the backward network of a

bidirectional GSEN below.

time required to use the algorithm in [1] use our algorithm find a tag for a j to get to i O(n) O(n)

find the tags for every j to get to i O(N0n) O(n)

construct the routing table O(N02n) O(N0n)

This thesis is organized as follows. In Section 2, we formally define the bidirectional GSEN and give conventions used in this thesis. In Section 3, we describe the tag-based

(11)

routing algorithms in [7] and [1]. In Section 4, we describe our algorithm.

2

The bidirectional GSEN and conventions used in

this thesis

The following definition was given in [1].

Definition. A bidirectional general shuffle-exchange network GSEN(k, r, n + 1) is a GSEN with bidirectional links. The switch elements are aligned in n + 1 stages, la-belled 0, 1, 2, . . . , n. Each stage consists of r switch elements, lala-belled 0, 1, 2, . . . , r − 1. And each switch element is a k × k bidirectional crossbar.

For example, if each link is a bidirectional link, then the network in Figure 1(a) is GSEN(2,11,5). Note that in GSEN(k, r, n + 1), there are a total of

N0 = k × r

ports on each side of a stage, labelled 0, 1, 2, . . . , N0−1. The parameters k, r and n satisfy

the following equation:

dlogk(k · r)e = dlogkN0e = n + 1.

Throughout this thesis, let

N0 = N + M, with N = kn and k ≤ M ≤ (k − 1)N. (2.1)

The switch elements in the same stage are considered cyclic; that is, switch element labelled 0 is the next switch element of the switch element labelled r−1. Also, throughout this thesis, node i is assumed on the left-hand side of the network and node j, the right-hand side. Thus when we say a request is from i to j (j to i), we mean the request is sent through the forward (backward) network.

3

Previous tag-based routing algorithms

A tag-based control routing algorithm is one that sets up a path from an input to an output by using a control tag T . Each digit t` of the k-ary representation (t0t1. . . tn) of

(12)

T controls the switch element at stage ` in the path. We now briefly describe previous

tag-based routing algorithms of GSEN(k, r, n + 1). Recall that GSEN(k, r, n + 1) can be divided into the forward network and the backward network. Also recall that the forward network is a GSEN and Padmanbhan’s tag-based routing algorithm can be applied on it. The following two theorems were given in [1].

Theorem 1. [1] In the forward network of GSEN(k, r, n + 1), a path from i to j can be

set up by using the forward control tag T given by

T1 = (j + kM i) (mod N0). (3.2) In addition, other forward control tags (and paths) may be available, specified by

Tp = T1+ (p − 1)N0 if Tp < kN, 1 < p ≤ k. (3.3)

The backward network is not a GSEN. Thus Padmanbhan’s algorithm can not be applied on it. In [1], Chen et al. proposed a tag-based routing algorithm for it by using the forward control tag inversely.

Theorem 2. [1] In the backward network of GSEN(k, r, n + 1), a path from j to i can be

set up by using the backward control tag (s0s1. . . sn) computed by the following procedure:

Procedure GetBackwardControlTag.

1. Use (3.2) and (3.3) to get the forward control tag T . Derive the k-ary representation (t0t1. . . tn) of T .

2. Get the port sequence R0, R1, . . . , Rn based on (t0t1. . . tn) as follows:

R` =    k · i (mod N0) + t 0 if ` = 0, k · R`−1 (mod N0) + t` if 1 ≤ ` ≤ n.

3. Use R0, R1, . . . , Rn to get the backward control tag (s0s1. . . sn) as follows:

s` =    ¥k·i N0 ¦ if ` = 0, j k·R`−1 N0 k if 1 ≤ ` ≤ n.

(13)

Consider Figure 1(a) as an example. Suppose j = 9 wants to get to i = 2. In Step 1, we derive T = 11 = (01011). In Step 2, we derive R0 = 4, R1 = 9, R2 = 18, R3 = 15 and R4 = 9. In Step 3, we have (s0s1s2s3s4) = (00011), which means j = 9 can get to i = 2

via sub port 1 at stage 4, sub port 1 at stage 3, sub port 0 at stage 2, sub port 0 at stage 1 and sub port 0 at stage 0.

Procedure GetBackwardControlTag takes O(n) time to derive the backward control tag for j to get to i. It takes O(n) time to route a one-to-one request and O(N02· n) time

to construct the routing table.

4

The one-to-one routing

Recall that i is on the left-hand side of a bidirectional GSEN. Also recall that the switch elements in each stage are labelled 0, 1, 2, . . ., r − 1 and the next switch element of the switch element labelled r − 1 is the switch element labelled 0.

The following observations are crucial to our algorithm: At stage 0, only one switch element can get to i. At stage 1, exactly k switch elements can get to i and these switch elements are consecutive. At stage 2, exactly k2 switch elements can get to i and these

switch elements are consecutive. In general, at stage `, 0 ≤ ` ≤ n − 1, exactly k` switch

elements can get to i and these switch elements are consecutive. Clearly, at stage n, all the r switch elements can get to i.

(14)

Since the switch elements at stage ` that can get to i are consecutive, we only need to remember the label of the first one of them. Let C` denote this label. Clearly, we have

C` = i × k` (mod r).

A critical value v(i) associated with i is defined to be

v(i) = Cn× k.

For example, in Figure 2(a), the switch elements that can get to i = 6 are highlighted; moreover, C0 = 6, C1 = 1, C2 = 2, C3 = 4, C4 = 8 and v(i) = 16. In Figure 2(b), the

switch elements that can get to i = 5 are highlighted; moreover, C0 = 5, C1 = 10, C2 = 9, C3 = 7, C4 = 3 and v(i) = 6. We now propose an algorithm to compute the backward

(15)

BACKWARD-CONTROL-TAGS.

Input: i on the left-hand side of a bidirectional GSEN(k, r, n + 1).

Output: The critical value v(i) and two control tags (s0s1. . . sn) and (s00s01. . . s0n).

1. /* Compute C0, C1, . . . , Cn. */

for ` = 0 to n do

C` ← i × k` (mod r);

2. /* Compute the critical value v(i). */

v(i) ← Cn× k; 3. /* Compute s0 0, s01, . . . , s0n. */ s0 0 ¹ i r º ; for ` = 1 to n do s0 `← ¹ k × C`−1 r º ; 4. /* Compute F0, F1, . . . , Fn. */ if (r − Cn−1) × k ≥ r then begin for ` = 0 to n − 1 do F` ← 0; Fn ← 1; end else for ` = 0 to n do if C`+ k`> r then F` ← 1 else F` ← 0; 5. /* Compute s0, s1, . . . , sn. */ for ` = 0 to n do s`← s0`+ F` (mod k);

(16)

0 1 0 0 0 stage 0

stage 0 stage 1stage 1 stage 2stage 2 stage 3stage 3 stage 4stage 4 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 (a) 0 0 1 1 1 stage 0

stage 0 stage 1stage 1 stage 2stage 2 stage 3stage 3 stage 4stage 4 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 (b)

Figure 2: GSEN(2,11,5) with the switch elements that can get to (a) i = 6 and (b) i = 5 being highlighted.

Again, consider Figure 2 (a) as an example. Then k = 2, r = 11 and n = 4. Suppose

i = 6. Then after Step 1, C0 = 6, C1 = 1, C2 = 2, C3 = 4 and C4 = 8. After Step 2, v(i) = 16. After Step 3, (s0

0s01s02s03s04) = (01000). After Step 4, F0 = 0, F1 = 0, F2 = 0, F3 = 0 and F4 = 1. After Step 5, (s0s1s2s3s4) = (01001). It is easy to verify that: if j < 16, then j can get to 6 by using the tag (01001); if j ≥ 16, then j can get to 6 by

(17)

destination i (s0s1s2s3s4) (s00s01s02s03s04) v(i)

i = 6 01001 01000 16

Recall that there are a total of N0 ports on each side of a stage, labelled 0, 1, 2, . . . , N0

1. A port R consists of two parts: the number y of the switch element where R is located, and the sub port number z in the switch element where R is located; see [1]. R and y and z satisfy R = ky + z. The following result was proved in [1].

Lemma 3. [1] Suppose port u of stage ` − 1 and port v of stage ` are connected by a link,

where u = ky1+ z1 and v = ky2+ z2. Then z2 =

¥k·u

N0

¦

.

Thus we have

Lemma 4. Let u, v, y1, z1, y2, z2 be defined as in Lemma 3 and consider the switch elements labelled y1 and y2. Then the backward control tag for y2 to get to y1 (or to get to u) is z2; moreover, z2 =

¥u

r

¦

.

Proof. Clearly, the tag is z2. Since N0 = k × r, by Lemma 3, z2 =

¥u

r

¦ .

We now prove that

Lemma 5. If j = v(i), then j can get to i by using the tag (s0

0s01. . . s0n).

Proof. Suppose j = v(i). Then j can get to i via switch elements labelled Cn, Cn−1, . . . , C0.

For each `, 1 ≤ ` ≤ n, C` is linked to C`−1 via sub port 0 of C`−1. Sub port 0 of C`−1 is

port u of C`−1, where u = k × C`−1. Thus by Lemma 4, the tag for C` to get to C`−1 is

j

k×C`−1

r

k

. Also by Lemma 4, the tag for C0 to get to i is

¥i r ¦ . In Step 3 of BACKWARD-CONTROL-TAGS, we set s0 0 = ¥i r ¦ and s0 ` = j k×C`−1 r k

, for ` = 1, 2, . . . , n. Thus we have this lemma.

Lemma 6. If j > v(i), then j can get to i by using the tag (s0

(18)

Proof. By (2.1), kn< N0 ≤ kn+1. Set d = j −v(i) for easy writing. Then 0 < d ≤ N0−1. Thus 0 < d kn−`+1 N 0−1 kn+1 k` N0−1 N0 k` < k` and therefore 0 ≤ ¥ d kn−`+1 ¦ < k`. Recall that

at stage n, all of the r switch elements can get to i; at stage `, 0 ≤ ` ≤ n − 1, there are exactly k` consecutive switch elements that can get to i and the first one is labelled

C`. Thus j can get to i via switch elements labelled Cn+

¥d k ¦ , Cn−1+ ¥ d k2 ¦ , Cn−2+ ¥ d k3 ¦ , · · · , C`+ ¥ d kn−`+1 ¦ , · · · , C1+ ¥ d kn ¦ , C0+ ¥ d kn+1 ¦

. The connection of a GSEN ensures that if C`, 1 ≤ ` ≤ n, is connected to C`−1 via sub port z2, then C`+

¥ d kn−`+1 ¦ is connected to C`−1 + ¥ d kn−`+2 ¦

via sub port z2. By Lemma 4, the tag for C` +

¥ d kn−`+1 ¦ to get to C`−1 + ¥ d kn−`+2 ¦

is z2; by Lemma 5, z2 = s0`. Note that 0 < kn+1d N 0−1 N0 < 1. Thus C0 + ¥ d kn+1 ¦

= C0. By Lemma 5, the tag for C0 to get to i is s00. From the above, if j > v(i), then j can get to i by using the tag (s0

0s01. . . s0n).

Lemma 7. If j < v(i) and (r − Cn−1) × k ≥ r, then j can get to i by using the tag

(s0s1. . . sn).

Proof. Set d = j − v(i) + N0 for easy writing. Then j can get to i via switch elements

labelled Cn + ¥d k ¦ − r, Cn−1 + ¥d k2 ¦ , Cn−2 + ¥ d k3 ¦ , · · · , C` + ¥ d kn−`+1 ¦ , · · · , C1 + ¥ d kn ¦ , C0+ ¥ d kn+1 ¦

. The connection of a GSEN ensures that if Cn is connected to Cn−1 via sub

port z2, then Cn+ ¥d k ¦ − r is connected to Cn−1+ ¥ d k2 ¦

via sub port z2+ 1 (mod k). By

Lemma 4, the tag for Cn+

¥d k ¦ − r to get to Cn−1+ ¥ d k2 ¦ is z2+ 1 (mod k). By Lemma 5, z2 = s0n. In our algorithm, we set Fn = 1 and set sn= s0n+ Fn (mod k). Thus sn= z2+ 1

(mod k). Again, the connection of a GSEN ensures that if C`, 1 ≤ ` ≤ n − 1, is connected

to C`−1 via sub port z2, then C`+

¥ d kn−`+1 ¦ is connected to C`−1+ ¥ d kn−`+2 ¦

via sub port

z2. By Lemma 4, the tag for C`+

¥ d kn−`+1 ¦ to get to C`−1 + ¥ d kn−`+2 ¦ is z2. By Lemma 5, z2 = s0`. In our algorithm, we set F` = 0 and set s` = s0`+ F` (mod k). Thus s` = z2.

Note that 0 < d kn+1 N 0−1 N0 < 1. Thus C0+ ¥ d kn+1 ¦

= C0. By Lemma 5, the tag for C0

to get to i is s0

0. In our algorithm, we set F` = 0 and set s0 = s00+ F0 (mod k). Thus s0 = s00. We now have this lemma.

(19)

Lemma 8. If j < v(i) and (r − Cn−1) × k < r, then j can get to i by using the tag

(s0s1. . . sn).

Proof. Set d = j − v(i) + N0 for easy writing. Then j can get to i via switch elements

labelled Ln, Ln−1, · · · , L`, · · · , L1, L0, where Ln = Cn+ ¹ d k º − r and for ` = n − 1, n − 2, . . . , 0, L` =    C`+ ¥ d kn−`+1 ¦ if C`+ k` ≤ r, C`+ ¥ d kn−`+1 ¦ − r if C`+ k` > r.

The connection of a GSEN ensures that if Cn is connected to Cn−1 via sub port z2, then Lnis connected to Ln−1via sub port z2+1 (mod k). By Lemma 4, the tag for Lnto get to

Ln−1is z2+1 (mod k). By Lemma 5, z2 = s0n. Note that Cn+kn> r. Thus our algorithm

sets Fn= 1. Since our algorithm sets sn= s0n+ Fn (mod k), clearly sn= z2+ 1 (mod k).

Again, the connection of a GSEN ensures that if C`, 1 ≤ ` ≤ n − 1, is connected to C`−1

via sub port z2, then L` is connected to L`−1 via sub port z2 if L` = C`+

¥ d

kn−`+1

¦

and via sub port z2+1 (mod k) if L` = C`+

¥ d

kn−`+1

¦

−r. Thus by Lemma 4, the tag for L`to get to

L`−1 is z2 if L` = C`+ ¥ d kn−`+1 ¦ and is z2+ 1 (mod k) if L` = C`+ ¥ d kn−`+1 ¦ − r. By Lemma

5, z2 = s0n. In our algorithm, we set F` = 0 if C`+ k` ≤ r (i.e., if L` = C`+

¥ d kn−`+1 ¦ ), set F` = 1 if C`+ k`> r (i.e., if L` = C`+ ¥ d kn−`+1 ¦

− r) and set s`= s0`+ F` (mod k). Thus

s` = z2 if L` = C`+ ¥ d kn−`+1 ¦ and s` = z2+ 1 (mod k) if L` = C` + ¥ d kn−`+1 ¦ − r. Note that 0 < d kn+1 N 0−1

N0 < 1. Thus L0 = C0. By Lemma 5, the tag for L0 to get to i is s00.

Note that C0 + k0 ≤ r. Thus our algorithm sets F0 = 0 and set s0 = s00 + F0 (mod k).

Thus s0 = s00. We now have this lemma.

Theorem 9. If j < v(i), then j can get to i by using the backward control tag (s0s1. . . sn);

if j ≥ v(i), then j can get to i by using the backward control tag (s0

0s01. . . s0n). Moreover,

(20)

Proof. It is obvious that it takes O(n) time to compute v(i), (s0s1. . . sn) and (s00s01. . . s0n).

This theorem now follows from Lemma 5, Lemma 6, Lemma 7 and Lemma 8.

The following is a one-to-one routing algorithm for the backward network of a bidi-rectional GSEN.

ONE-TO-ONE.

Input: i on the left-hand side and j on the right-hand side of a bidirectional GSEN (k, r, n + 1).

Output: The backward control tag for j to get to i.

1. Use BACKWARD-CONTROL-TAGS to derive v(i), (s0s1. . . sn) and (s00s01. . . s0n);

2. if j < v(i) then return (s0s1. . . sn) else return (s00s01. . . s0n);

It is obvious that algorithm ONE-TO-ONE takes O(n) time.

5

The routing table and the all-to-all routing

In this section, we will propose an algorithm to construct the routing table of the back-ward network of a bidirectional GSEN. This algorithm is based on the one-to-one routing algorithm proposed in the previous section and can be used for the all-to-all routing. ROUTING-TABLE.

Input: A bidirectional GSEN(k, r, n + 1). Output: Its routing table.

1. /* Recall the function all to one */ for i = 0 to N0− 1 do

run algorithm BACKWARD-CONTROL-TAGS for i and GSEN(k, r, n + 1); endfor;

(21)

It is obvious that algorithm ROUTING-TABLE takes O(N0n) time. In the appendix,

we list the computer output of the routing tables derived by algorithm ROUTING-TABLE for N0 = 18, 20, 22, . . . , 32. Note that in the table of N0 = 32, each v(i) is zero, which

means we can get to every i by using only one tag. This result reflects the known result that when the number of stages is exactly logkN0, a shuffle-exchange network is identical

to the Omega network defined in [5] and its control tags depend only on the destination.

A

Backward control tags for N

0

= 18, 20, . . . , 32

GSEN(2, 9, 5) i s0s1s2s3s4s5 s00s01s02s03s04s05 v(i) 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 1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, and Z. Qiu, “Bidirectional shuffle-exchange network and tag-based routing algorithm,” IEEE Communication Letters, vol. 7, no. 3, Mar. 2003.

[2] M. Gerla, E. Leonardi, F. Neri, and P. Palnati, “Routing in the bidirectional shuf-flenet,” IEEE/ACM Trans. Networking, vol. 9, no. 1, pp. 91-103, Feb. 2001.

[3] F. K. Hwang, “The Mathmatical Theory of Nonblocking Switching Networks,” Series

on Applied Mathmatics, vol. 15, ch. 1, pp. 12-22, 2004.

[4] C. P. Kuruskal. “A unified theory of interconnection network structure,”Theoretical

Computer Science, vol. 48, pp. 75-94 , Jun. 1986.

[5] D. H. Lawrie, “Access and alignment of data in an array processor,” IEEE Trans.

Comput., vol. C-24, no. 12, Dec. 1975.

[6] S. C. Liew, “On the stability of shuffle-exchange and bidirectional shuffle-exchange deflection network,” IEEE/ACM Trans. Networking, vol. 5, no. 1, pp. 87-94, Feb. 1997.

[7] K. Padmanabham, “Design and analysis of even-sized binary shuffle-exchange net-works for multiprocessors,” IEEE Trans. Parallel and Distributed Systems, vol. 2, no. 4, pp. 385-397, Jan. 1991.

[8] R. Ramaswami, “Multi-wavelength lightwave networks for computer communica-tion,” IEEE Commun. Mag., vol. 31, no. 2, pp. 78-88, Feb. 1993.

數據

Figure 2: GSEN(2,11,5) with the switch elements that can get to (a) i = 6 and (b) i = 5 being highlighted.

參考文獻

相關文件

○ Propose a method to check the connectivity of the graph based on the Warshall algorithm and introduce an improved approach, then apply it to increase the accuracy of the

 Sender Report: used by active session participants to relay transmission and reception statistics.  Receiver Report: used to send reception statistics from those

a single instruction.. Thus, the operand can be modified before it can be modified before it is used. Useful for fast multipliation and dealing p g with lists, table and other

With the proposed model equations, accurate results can be obtained on a mapped grid using a standard method, such as the high-resolution wave- propagation algorithm for a

If x or F is a vector, then the condition number is defined in a similar way using norms and it measures the maximum relative change, which is attained for some, but not all

Now, nearly all of the current flows through wire S since it has a much lower resistance than the light bulb. The light bulb does not glow because the current flowing through it

(A)憑證被廣播到所有廣域網路的路由器中(B)未採用 Frame Relay 將無法建立 WAN

• Suppose, instead, we run the algorithm for the same running time mkT (n) once and rejects the input if it does not stop within the time bound.. • By Markov’s inequality, this