18 October 1993
Information Processing Letters 47 (1993) 295-299 Elsevier
Static behavior analysis of a mesh system * Zhizhang Department
Shen of Computer
Science, Plymouth
State College (USNH), Plymouth,
NH 03264, USA
Communicated by D. Gries Received 30 March 1993 Revised 21 June 1993 Keywords: Combinatorial problems; distributed systems; performance evaluation
1. Introduction
2. Problem and its modeling
Arrays architecture computer computer of a mesh
When a packet is sent from one processor to another, a routing algorithm is used to find a neighboring processor as its immediate receiver. This process is repeated until the immediate receiver turns out to be the destination [ll. To send the packet to its destination as quickly as possible, it is natural to require that such routing minimize the packet traveling distance.
of processors with a bounded mesh have found many applications in science and engineering, particularly in communication. The essential structure system can be represented as
Pl,l
PI,2
...
Pl,n
P2,1
P2,2 .
‘.’ .
P2.n
P’m,l
P,,2
. .:
P,,n
where pi,j represents a processor. In order to increase the efficiency of interprocessor communication in a mesh system, it is desirable to send a packet along the shortest path between source and destination. However, this is not always possible, especially when traffic in the system is heavy. Therefore, it is more reasonable to consider the average time, which is closely related to the average length of the paths between the involved processors. We define, analyze and compute the average time it takes to send a packet from one processor to another along some preferred paths.
Correspondence too: Professor Z. Shen, Department of Computer Science, Plymouth State College (USNH), Plymouth, NH 03264, USA. Email:
[email protected]. * A preliminary version of this paper is contained in “Packet delay prediction in datagram mesh systems” in Proc. 1993 ACM Symp. on Applied
0020-0190/93/$06.00
Computing.
Definition 2.1. An effective routing algorithm minimizes the traveling distance between the current location of the packet and its destination. Therefore, we want to solve the following problem: Given an m x n mesh, locations of two processors inside the mesh, and an effective routing algon’thm, if a packet moves exactly one position, i.e. moues to one of its neighbors, within one time unit, how many time units on average does it take for the packet to move from the first processor to the second ? A mesh system consisting of m x n processors is modelled by an m X n array. We use the index of an entry of the array, denoted by (i, j), to represent the “geometric” location of a processor in that entry, edge to represent the immediate connection of two adjacent processors and path between two entries to represent hereditary connection between two processors. The definitions of those terms are the same as in general graph theory.
0 1993 - Elsevier Science Publishers B.V. All rights reserved
295
Volume
47, Number
6
INFORMATION
PROCESSING
1 2 3 4 5 Fig. 1. An example
of a path in an array.
For example, the array in Fig. 1 represents a 5 X 5 mesh. The sequence (1, 11, (1, 21, (2, 21, (2, 3), (3, 31, (4, 3), (4, 4) is a path of length 6 from (1, 1) to (4, 4). Not every path from c to d should be used to send packets. For example, given the array in Fig. 1, we will not use the path (1, l), (2, 21, (1, 2) to send a packet from (1, 1) to (1, 2). This is the reason why effective routing algorithm is suggested. Definition 2.2. Let A be an m X II array and let c and d be two entries of A. An effective path from c to d is a path obtained by applying an
effective routing algorithm, as defined in Definition 2.1. Another factor affecting the communication time is the number of ports associated with each processor. It is assumed here that each processor is associated with eight ports ‘, which is a structure used in various applications in hypercube and connection machines with SIMD structures [3]. With this structure in mind, when a packet is sent from the top-left corner to the bottom-right corner of an array, an effective routing algorithm uses only a path that leads either to the east, to the south, or to the southeast. Definition 2.3. Let c and d be two entries of an m x n array. By the adjusted average distance from c to d, we mean the average length of all
effective paths. 1 In the model studied
in [l], four ports are associated with each processor. In that case, the time it takes to send a packet from (1, 1) to (m, n) is in proportional to m + n -2 in best, worst and average cases.
296
LETTERS
18 October
1993
Although cell d could be located to either the southeast, southwest, northeast or northwest of cell c, the adjusted average distance from c to d will always be the same because of the symmetry. Therefore, we can always assume that cell d is located to the southeast of cell c. Finally, the length of a path connecting two processors depends only on how far those two processors are apart, but not on where they are actually located. Therefore, in order to calculate the average time it takes to send a packet from cell c to any other cell d inside a mesh, we need only calculate the adjusted average distance from (1, 1) to Cm, n) * in an m X n array. 3. Combinatorial
solution
3.1. Given is an m X n array. N,(m, n) denotes the total number of effective paths from (1, 1) to Cm, n>. Z’,
denotes the sum of the lengths of all the effective paths from (1, 1) to (m, n). Finally, Avg(m, n> denotes the adjusted average distance from (1, 1) to (m, n). Definition
Starting from (1, 11, one can go either east to (1, 2), south to (2, 11, or southeast to (2, 2). Every effective path leading from any one of those three cells to (m, n), prefixed with the first edge which connects (1, 1) to either (1, 2), (2, 1) or (2, 21, constitutes a unique effective path from (1, 1) to (m, n). When one tries to look for all the effective paths leading from any one of those three cells to (m, n), the situation will be exactly the same as the original one. Finally, the value of N,(m, n) only depends on the number of the cells, but not on the indices. Therefore, we have the following recurrence equation for N,(m, n): &(m, &(O,
0) = 0 n) = 0
for m > 0, for IZ> 0,
N,(m,l)=l
formal,
NJl,
for II 2 1,
?z) = 1
n - 1) n) =&( m - 1, n) +N,(m, +N,(m - 1, n - 1) for m,n > 1.
&(m,
’ m
and n depend and d.
only on the relative
distance
between
(1) c
INFORMATION PROCESSING LETTERS
Volume 47, Number 6
Similarly, one can obtain the recurrence equation for P&m, n). The only difference in this case is that we-have to take into account the length of the first edge as well. The following are the equations for P[(m, n>: P,(m,O)=O
formaO,
P/(0, n) = 0
for n>O,
Pl(m, P,(l,
1) =m - 1 n) =n
P/(m,
=
- 1, n) +Pr(m,
jFIKj-l)
- 1, n - 1) +N,(m,
u=o
n)
i+j-u-2
u
j
i
4(m, n)
relation
for m,n > 1.
n)
Xi.
i-v-l
for
The coefficient of the term x”y”’ in the previous equation provides the solution for P&m, n). For m,n 2 2,
(3)
Pr(m,
n) = (m - 1) Tr: (
By applying the technique of generating function [4], the solutions of these recurrence relations can be obtained as follows: C
N_(m,
1
1
j(i+j-v-2)
(2)
&(m7
x) =
j-1
X
Finally, we have the recurrence the adjusted average distance:
N(y,
x+pia*(x)]Yi7
i-2 +c Ii
n - 1)
for m,n > 1.
n) =
i>l,j>l
for nal,
+Pl(m
Aug(m,
C Pl(m, n)x’y’
x) =
formal,
- 1
n) =Pl(m
P(Y,
18 October 1993
+ni2
1 m+n;u-2)
(m;l
u=o [
)( X
n)x’yj
m(m+n-u-2) n-u-l
i>l,j>l
1. (5)
Based on N,(m, n> and P,(m, n>, we can get the value of Aug(m, n), according to (3). For m = 2, we have the following concrete results: Np(2, n) =2*nP,(2, j+i-u-2
X i
j-l
X’Y’. 1)
1) = 1,
P/(2, 2) = 5, P,(2, n) = [n* + (n - l)*]
The coefficient of the term xnym in the above equation provides the general solution for N,(m, n). For m,n > 2,
~(-,n)=~~~(m~1)(m+~~~-2).
1,
(4)
Aug(2
7n) =
b’
+ (n 2*n-1
The above shows that (2* n - 1) time units on from (1, 1) to (2, n) in a 2 rows and 1 column of
for na3,
1)'l for n > 1. it takes [n* + (n - l)*l/ average to send a packet mesh system with at least processors. 297
Volume
47, Number
6
INFORMATION
PROCESSING
18 October
LETTERS
1993
pends not only on the actual traffic but also depends on the road structure. The latter is also not time dependent. As a more formal example, consider the well-known Hanoi Tower problem. Let a, be the number of transfers of rings from one peg to another, we have the following recursive equations: Fig. 2. Data plot.
4. Computer
solution
Recurrence relations directly lead to recursive programs. However, since the recurrence relations are involved with several levels of recursive invocations, it is imaginable that the resultant recursive programs will be quite time consuming. It turns out that dynamic programming works quite well in this case. We actually have a polynomial-time algorithm (O(m x n)) to calculate the above functions. Figure 2 shows the plot of the computercalculated adjusted average distance between (1,l) and (m, n) (m,n = 1.. . 10).
5. Discussion
In this paper, we have analyzed the average distance between any two cells in a mesh system based on the following two assumptions: (i) An effective routing algorithm is used. (ii) It takes precisely one time unit to send a packet to its neighboring processor. The .first assumption is reasonable, but the second is not: often, it will take more than one time unit to do so. Particularly, the result does not hold when traffic gets heavy. It merely provides a low bound. Nevertheless, we observe that there are two factors in deciding the behaviors of a mesh system: one is .the actual traffic flow, which is dynamic and difficult to specify. The other is the system structure, which is static and can sometimes be precisely specified. This is similar to some other problems. For example, the time it takes to drive to work de298
a, = 1,
a, = 2u,_i + 1.
Its homogeneous solution is A *2”, which is decided purely by the structure of the equation, while its particular solution is - 1, which is decided purely by the constant term in the equation. Its solution is a combination of both parts: 2” - 1. The homogeneous solution is quite general in the sense that it stays the same for the same structure while the particular term varies with the constant terms. More examples can be found in solving differential equations, systems of linear equations, etc. Generally, the solution of certain class of problems consists of two parts: one corresponds to the static behavior, the other to the dynamic behavior. Neither the static nor the dynamic behavior alone reflects the whole picture. But various practices, in both theory and application, remind us that static behavior is easier to specify and usually plays a more general role in solutions. Our results show the static behavior of a mesh system. This technique should be applicable elsewhere to analyze the performance of other kinds of systems with regular architecture, such as the hypercube structure.
Acknowledgment
The author is grateful valuable discussions.
to Peter
Drexel
for
References [l] P. Drexel, Z. Shen and L. Urbach, Characterization and implementation of a mathematical model for a mesh systern with dynamic routine, in: Proc.1993 SCS .%ukzfion
Volume
47, Number
6
INFORMATION
PROCESSING
MultiConference on the High Performance Computing Symp., pp. 176-181. [2] L.R. Graham, D.E. Knuth and 0. Patashnik, Concrete Mathematics (Addison-Wesley, Reading, MA, 1989). [3] T.G. Lewis and H. El-Rewini, Introduction to Parallel Computing (Prentice Hall, Englewood Cliffs, NJ, 1992).
LETTERS
18 October
1993
[4] CL. Liu, Introduction to Combinatorial Mathematics (McGraw-Hill, New York, 1968). [5] Z. Shen, P. Drexel and L. Urbach, Packet delay prediction in datagram mesh systems, in: Proc. 1993 ACM Symp. on Applied Computing (ACM Press, New York, 1993) 539-545.
299