• 沒有找到結果。

Heuristic task assignment for distributed computing systems

N/A
N/A
Protected

Academic year: 2021

Share "Heuristic task assignment for distributed computing systems"

Copied!
22
0
0

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

全文

(1)

Heuristic Task Assignment for Distributed Computing Systems CHIUN-CHIEH HSU

SHENG-DE WANG

apartment of Electrical Engineering, ~ai~nai Taiwan UniL)~rsj~, Taipei, Taiwan, 10764, R0.C.

-

ABSTRACT

This paper addresses the problem of assigning a task with precedence constraint to a dist~buted computing system. The task turnaround time incIuding communication overhead and idle time is adopted to measure the performance of task assignment. The task assign- ment in this paper requires one to determine not only the assignment of modules, but also the sequence of message transmission to balance processor loads and diminish communica- tion overhead. The search for the optimal task assignment with precedence constraint is known to be NP-complete in the strong sense. A heuristic algorithm with polynomial time complexity is then proposed in order to effectively solve the task assignment problem. The experimental results reveal that the proposed approach is able to obtain a near-optimal or even the optimal task assignment.

-

I. INTRODUCTION

The rapid progress of VLSI and computer ne~orking technologies has made distributed computing systems economicaIly attractive for many com- puter applications. Although distributed computing systems are capable of enhancing system throughput and resource utilization, they raise some prob- lems that prevent their widespread use. One of the major problems is the throughput degradation caused by imbalance of processor loads and the large amount of inter-processor communication overhead.

Therefore, the aim of task assignment in this paper is to attain the minimum response (task turnaround) time to maximize system throughput. There are two conflicting strategies to diminish the task turnaround time, namely, assigning all modules to a single processor to save communication overhead, and distributing them evenly to all processors to balance the load. A

OElsevier Science Publishing Co., Inc. 1992 655 Avenue of the Americas, New York, NY 10010

(2)

compromise between the two strategies should be made to achieve the minimum task turnaround time. However, obtaining the minimum turnaround time for a partitioned task with precedence constraint is extremely difficult and generally intractable. If we cannot achieve the minimum task turnaround time within reasonable time, we hope to make use of some heuristics to attain a near-minimum one with much less effort.

Several approaches to the task assignment in distributed computing systems have been identified. They can be roughly classified into four categories: graph-theoretical [l-3], mathematical-programming 14-61, heuristic [7-12, 17, 191, and simulated-annealing [131. In general, these approaches are not mutu- ally exclusive. The graph-theoretical method models the problem as a proces- sor-module flow graph and partitions it using a max-flow min-cut algorithm. The mathematical-programming approach formulates the problem as a combi- natorial optimization problem and solves it using a mathematical optim~ation technique. The heuristic method utilizes heuristic information to evaluate the assignment cost and speeds up the procedure of finding an assignment. The simulated-annealing approach uses a stochastic search criterion to iteratively improve an initial assignment to a globally optimal task assignment.

Many of these researches ignore the precedence constraint, despite the fact that it is an important characteristic of a real programming environment. Even if the precedence constraint is included, communication overhead and idle time due to control overhead are generally neglected [lo]. In this article, we present an approach which takes the precedence constraint, communication overhead, and idle time into account. In addition, the distributed computing system with non-fully-connected topology and multihop communication are also allowed.

In this paper, the task turnaround time is adopted to evaluate the effective- ness of assignment and is computed by using the concepts of trigger moment, activation moment, and start moment. The task assignment requires determin- ing not only the assignment of modules, but also the sequence of message transmission. For the former it assigns modules to the best-fit processors, which leads to load balance; for the latter it determines the best sequences of parent modules transmitting messages to their children, which leads to dimin- ishing communication overhead. Since pursuing the minimum task turnaround time (optima1 task assignment) is known to be NP-complete in the strong sense [lo, 15, 161, six heuristics are proposed to effectively assign modules and determine the transmission sequence. Although it is a heuristic method, experimental results show that a near-optimal or even the optimal task assignment will be achieved.

The remainder of this paper is organized as follows: Section II presents the problem statement. Trigger moment, activation moment, start moment, and the computation of task turnaround time are also defined in this section. Six heuristics are proposed in Section III. An illustrative example is given and

(3)

experimental results are discussed in Section IV. Finally, conclusions are drawn in Section V.

II. PROBLEM STATEMENT AND DEFINITION OF THE COST FUNCTION

A. PROBLEM STATEMENT

In this paper, a task is assumed to be partitioned into modules with precedence constraints. If module (Y immediately precedes module p, we say that (Y is the parent of p or /3 is the child of (Y. In the partitioned task, there is at least one module without parent and at least one module without child. These are called source and sink modules respectively. Directed cycles in a task are required to be broken or merged into larger modules before treat- ment according to this paper.

In this article, a distributed computing system is composed of homogeneous processors, and its topology is not necessarily fully connected. The approach proposed can still be applied in a heterogeneous system if average execution times and communication times are used in the proposed heuristics. The interprocessor link of a distributed computing system is bidirectional, and the communication times for transmitting a message from either end of a link to the other are the same. Compared to the communication time in an interpro- cessor link, the communication time for transmitting a message inside a processor is negligible. Therefore, if a parent and its child are assigned to the same processor, their communication time is assumed to be zero.

There exist two factors contributing to the cost of task assignment, namely, the assignment of modules and the sequences of parents transmitting mes- sages to their children. They are called module assignment and the transmis- sion sequence respectively. The former is very clear, but the latter requires further explanation. The interprocessor communication in this paper is not based on a common bus structure. Hence, the transmission sequence plays an important role in the process of a parent sending the required messages to its children to wake them up.

B. COMPUTATION OF THE COST FUNCTION

For module (Y and its child /?, the trigger moment of (Y with respect to /3 is the instant after LY has transmitted a message to p. A module /3 is activated if all of its parents have triggered it. Thus, the activation moment of /3 is the instant when the last parent of p finishes transmitting the required message to p. If /3 is activated and its assigned processor is released from any previous execution and communication, the processor starts executing p at that mo-

(4)

ment, which is called the start execution moment (start moment for short) of p. All terms described above imply the phenomenon of time accumulation as a consequence of precedence constraints between modules.

Let us introduce some more terms, which will be used in the remainder of this paper.

(1) The task assignment MT is composed of a module assignment A4 and a transmission sequence T.

(2) MC(Y) denotes the processor to which module CY is assigned by module assignment M.

(3) T,(i), the ith triggered child of LY, is the ith child to which its parent (Y transmits a message.

(4) RL,(MT) denotes the moment when M(a) is released from any previ- ous execution and communication, and is ready to execute CY.

(5) E, denotes the elapsed time required for module (Y to be fully exe- cuted.

(6) G,, denotes the communication time interval required to send a message from (Y to /?, which are assigned to adjacent processors. It is infinite if CY is not the parent of p.

(71 TIME,, denotes the current elapsed time recorded in processor p at any point during the computation of the cost function (task turnaround time). TIMES includes all execution times, communication times, and idle times.

Let us discuss how to compute the turnaround time for a totally assigned task. Initially, the trigger moments, activation moments, and start moments of all source modules are set to zero; likewise the elapsed times of all processors. Based on this initialization, the start moment of an assigned module and then the trigger moment of this module with respect to its children are computed. This procedure is repeated from source modules to sink modules.

Suppose there is a parent (Y which forks to n children. Assuming asyn- chronous IO (input-output), the trigger moments of (Y with respect to its children associated with a task assignment MT are computed with the follow-

ing algorithm.

ALGORITHM 1.

/* The argument MT for the task assignment is dropped in this algorithm. SEND denotes the instant when a processor begins sending a message; ARRIVAL denotes the moment when the message arrives. */

(1) TIMEMCu) = ST, + E,, where STY denotes the start moment of a; (2) FOR i=l To n DO

(3) BEGIN

(5)

(5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16)

THEN =RGa,~rr(i) = TIMEM&

ELSE IF (M(a) and M(T,(i)) are adjacent) THEN TRG,,Taci)) = TIMEMca) + ca, Trr(i$ ELSE BEGIN

/* If the required message of (Y with respect to its ith triggered child

T,(i) is transmitted along processors P,, P2,. . . , P,, where MC(Y) = P,, M(T,(i)) = P,, and of course 4 # Pk for j + k. */

SEND = TIMEpI; FOR j=l TO S-2 DO BEGIN

TIME pi = ARRIVAL = SEND + c,,,ci,

TIMEpcjrl) = SEND = lKlX{ARRIVAL, TIMEpcj+,$; ENDFOR;

TIME(, _ 1) = TRG,,J~(~) = SEND + c,, Taci$ ENDIF;

(17) ENDFOR;

(18) END of Algorithm 1.

If these n children are assigned to the same processor as M(a) or the adjacent processors to M(a), then the trigger moment of (Y with respect to

T,(i) will be simplified to

rno,,r,(i)(MT) = sr,(MT) + Em + Z!k C,,ra,j,. (1)

j=l M(a) # M(TJ j))

The last term is Equation (1) indicates that if the first i triggered children of (Y are assigned to the processors adjacent to (Y’S, their communication times will be added to the trigger moment of (Y with respect to T,(i). While trigger moments are being computed, TIME,,,,(~) requires to be updated.

For module p and the set of its parents Fp, the activation moment and start

moment of p are given by

~m@fT) = 2~ =no,,@T), (2)

P

ST~( MT) = max{ RL,s(MT),Aqs(MT)}. (3)

The processor elapsed time TIME,,,,(~) also requires to be updated while the start moment of /3 is being computed.

Recall that an activated module p cannot be executed immediately if its assigned processor M(P) has not yet been released. As a consequence, p will

(6)

2

8 1

0

3

Fig. 1.

cause a delay between the activation moment and release moment. This

period of time is called the delay time of /I, and is defined as

DELAY@fT)=RL,@fT)-ACT&MT). (4)

On the contrary, if /3’s release moment is earlier than its activation moment,

the processor M(j?) will be idle. The corresponding period of time is called

the idle time of M(P), and is defined as

(5)

Let us use a simple example to show how to compute these terms. A

distributed computing system and a task are modeled as an undirected graph

and a directed acyclic graph as shown in Figures 1 and 2, respectively. There

exist a module assignment

M = ((A,

11, (B, 21, (C, 11, (D, 3)} and a transmission

sequence

TA = {B, Cl, TB = ID}, Tc = {D),

and

TD = { 1.

All execution times are

30 time units (e.g. milliseconds), and all communication times are 5 time units.

The steps required to compute these terms are as follows:

1. Initially,

-LIMED = TIMES = TIMES =

0,

emu = sTA =

0.

2. First of all, source module A is executed in processor 1. Thus,

TIME,=sQ+ EA=

30.

A

0

B C

D

(7)

3. Then, A transmits messages to B first and then to C:

TIME,=TRGA B=30+5=35,

4. Two modules B and C are activated concurrently: ACTB = ACTC = 35.

Module B transmits a message to D from processor 2 to 3: TIME 2 = STB = max{ RL B) ACTR) = maX{ TIME *, ACTs) = 35, TIME z = STB + E, = 65,

TlME2=TRGsD=65+5=7&

Module C transmits a message to D from processor 1 through 2 to 3: TIME, = STC = maX(RLC,ACTC) = maX(TIMEI,ACJTc} = 35,

SEND=TIME,=STC+EC=65,

TIME,=ARRIVAL =~~~~=C~~=65+5=70, TIME 2 = SEND = IKlX(ARRIVAL , TIME *) = 70, TRG C-,=TIMEZ=SEND+CC-D=75.

5. Finally,

ACTD = maX{TRGg,D,TRGC-D} = 75,

TIME 3 = STD = mti(RLD,ACTD} = IllaX{TIME3,ACTD} = 75; TIME1=STD+ E,=105.

Note that MT has been dropped for clarity.

After all terms of the modules for a totally assigned task have been computed, the task turnaround time associated with a task assignment MT is then defined as

TA( MT) = psUpTIMEp( MT), (6)

(8)

III. HEURISTIC TASK ASSIGNMENT

It is known that the search for an optimal task assignment with precedence constraint is NP-complete in the strong sense [lo, 15, 161. Heuristic methods have been considered as the most powerful approaches to circumvent this difficulty. Therefore, in this section, we will propose six heuristics combining a scheme of reassignment to minimize interprocessor communication overhead and balance processor loads, so we can achieve a suboptimal assignment with much less effort. Since this method is heuristic, deviation from the optimal solution is inevitable. However, experimental results reveal that the deviation is gratifyingly tolerable and even the optimal solution is often attained.

From Algorithm 1 and Equations (11 to (61 above, we know that transmis- sion sequences affect the computation of trigger moments, activation mo- ments, start moments, and the task turnaround time. Thus, we intend to assign modules to the best-fit processor as well as determine the best transmission sequence in order to obtain the minimum or a near-minimum task turnaround time.

The heuristic assignment presented in this section is divided into four parts:

(1) initial transmission-sequence decision;

(2) coassignment and final transmission-sequence decisions; (3) module assignment;

(41 reassignment.

Part (1) concerns whether execution time or communication time will be adopted as the metric of transmission-sequence decision. Furthermore, an initial sequence will be chosen in some order of execution times or communi- cation times. Part (2) proposes a method to delicately determine whether or not children are assigned to the same processor as their parents’ (the coassign- ment decision), and thus decide the final transmission sequence. Hence, communication overhead can be minimized and processor loads can be bal- anced. In addition, if several modules are activated concurrently, their levels and estimated finish moments are used as a basis on which to construct the priority list in order to make coassignment and transmission-sequence deci- sions. Part (3) presents a heuristic to assign an unassigned module to the processor which leads to minimizing the task turnaround time. A simple but effective reassignment is suggested in part (4) to handle an abnormal condition resulting from bad task partitionings.

Before describing the heuristic task assignment, we define two terms as follows. Given several modules, the processors adjacent to all of their assigned processors are called their one-hop processors. If these modules are assigned to the same processor, we say that this processor is their zero-hop processor.

(9)

A. INITIAL TRANSMISSION-SEQUENCE DECISION

LEMMA 1. If a parent forks to n children, there exist n! different sequences for the parent to transmit messages to its children.

LEMMA 2. If a parent a forks to n children which are assigned to the

zero-hop or one-hop processors of CY, the total communication overhead associ- ated with a task assignment MT is

i:

(n - j +

llca,Tm(j). j=l

M(a)+ MT,(j))

Proof. Equation (11 states that the trigger moment of ith triggered child T,(i) is

TRG,,~,(;,( MT) = ST,( MT) + E, + 2

j=l

(Y with respect to its

C a.r,(I).

M(a) + M(T,( j))

Thus. the total communication overhead is

igl

bR%T&)

(MT)-ST,(MT)- Eu}

=

5

i

'a,T,(j) i=l j=l M(a) + M(Ta(j)) =

k

k

cd&,=

Ii

Cn

- j +

l)ca,Tc,(j). . j=l i-j j=l M(a) + MT,(j)) M(a) Z MT,(j))

THEOREM 1. Let there be a parent (Y forking to n children which are assigned to the one-hop processors of a. If these children are triggered in the nondecreas- ing order of communication time, the minimum total communication ouerhead will be attained among all n! transmission sequences.

Proof. Children are assigned to the one-hop processors of CY, which implies

M(a) # M(T,( j)) for 1 f j < n. Thus the term M(a) f M(T,X j)) in Lemma 2 can be dropped. The total communication overhead turns out to be Cy= , ,(n --

(10)

It is trivial to prove if C,,racj, G C~,T,(j* 1) for 1~ i < n (i.e., children are triggered in the nondecreasing order of communication time), we will obtain

the minimum total communication overhead. n

There are two factors contributing to transmission-sequence decision, namely, the amounts of execution time and communication time. We will propose a heuristic to determine whether execution time or communication time will be adopted to make the transmission-sequence decision.

HEURISTIC 1. Suppose a parent has been assigned and its children have not. If the sum of the children’s execution times is larger than the minimum total communication overhead, execution time will be adopted as the metric for deciding the transmission sequence; otherwise, communication time will be adopted.

If execution time is used to make the decision of transmission sequence, then a child with larger execution time will be triggered earlier. From Equation (l), we know that the earlier a child is triggered, the smaller the trigger moment it has. As a consequence, summing the smaller trigger moment and the larger execution time will lead to even finish moments [s~,h%fT)+ E,] for children. In other words, the load of children’s processors tends to be balanced. Hence, we have Heuristic 2 to rationally determine the initial transmission sequence.

HEURISTIC 2. If the metric for deciding the transmission sequence is execution time, children are initially triggered in the nonincreasing order of execution time.

If communication time is adopted, according to Theorem 1, a child with smaller communication time will be triggered earlier to achieve the minimum total communication overhead. Therefore, we have Heuristic 3.

HEURISTIC 3. If the metric for deciding the transmission sequence is communication time, children are initially triggered in the nondecreasing order of communication time.

In practice, children are first sorted according to Heuristic 3 to facilitate the computation of the minimum total communication overhead in Heuristic 1. Then, if execution time is adopted as the decision metric by using Heuristic 1, children will be re-sorted according to Heuristic 2; otherwise, children need not be re-sorted. The transmission sequence determined by Heuristic 2 or 3 is only an initial transmission sequence. Some subtle modifications will be made in the following heuristic.

(11)

B. COASSIGNMENT AND FINAL TRANSMISSION-SEQUENCE DECISION

Recall that if a child is assigned to the same processor as its parent, the communication time for message transmission can be saved. However, under this condition, the child will be executed on this commonly assigned processor, i.e., the child’s execution time will be included in the elapsed time of the processor. The inclusion of the execution time may result in load imbalance of processors and offset the benefit of saving communication overhead. We now consider the problem whether or not to assign a child to the same processor as its parent. We will refer the child assigned to the same processor as its parent as a coassigned child. A coassigned child must wait for its parent’s processor to send messages to other children and then process them, so that it will be triggered last.

Before describing the following theorem, we define the n/k fork as follows.

DEFINITION 1. Let there be a parent which forks to n children. We define it as an n/k fork if the last k triggered children are coassigned with the parent and others are assigned to the one-hop processors of the parent.

THEOREM 2. Let there be an n/k fork where the parent is a. If the i th triggered child, 1 < i < n - k, is now coassigned and triggered last, the total amount of variation of trigger moments for (Y with respect to its children is

n-k

c

c~,L(A

-(n-i+l)C, 3 cr T(i).

j=i+l

Proof. Let M’T’ denote the modified task assignment. The relationship between T and T’ is T,(j) = T$j> for 1 d j < i, T,(i) = T,‘(n) and T,(j) = T,‘( j - 1) for i + 1~ j < n. Furthermore, M’(T,( j)) = M(T,( j)) for 1 < j < n

and j#i.

The proof is divided into three parts as follows:

(1) Since children TJ j) for 1~ j < i are triggered before T,(i), the retrig- ger and coassignment of T,(i) do not affect its trigger moment. That is, rno,,r,‘(,$M’T’) = rno, , (I r (,) (MT). Thus, the amount of variation of trigger moments for the first i - 1 triggered children is zero.

(2) Since the first n - k triggered children other than T,(i) are assigned to the one-hop (adjacent> processors of LY and the last k triggered children are coassigned with LY, the trigger moment of (Y with respect to T,(i) after

(12)

retrigger and coassignment turns out to be

n-k =

STa(MT)

+ Ea +

C

C,,,_(j).

j=l

j#i

The amount of variation of the trigger moment is

(3) For child T,(j), i + 1 Q j < n, the trigger moment after retrigger and coassignment becomes

TRG,,T;(j- I)( MT’) = TRGa,T,(j)( M’T’)

= ST,{ MT) + E, +

m=l m#i

(13)

Therefore, the total amount of variation of trigger moments is

n .- k

= t: C,,~~cjj-(n-i+1)C*~7Xf;). j=it-1

n

If the ith triggered child is now coassigned and triggered last, it must wait for the k coassigned children to finish their execution on the coassigned processor. Therefore, after it is activated, it will wait for at least the amount of time X7”= _ I n k+ IET,cjj before being executed. Summing this delay and the total amount of variation of trigger moments in Theorem 2, we obtain the total cost variation for retriggering and coassigning T,(i). If this total is negative (cost is

diminished), which implies a reduction in communication overhead and in the balance of processor loads, then we will retrigger and coassign T,(i).

In addition, if C,,raci, 2 Eraci, for parent (Y and its child T,(i), we will coassign T,(i) and trigger it last. Thus, the load of processor M(cu) will become TIMES + E, ci). u On the contrary, if T,(i) is not coassigned with its parent (Y, the load of M(a) turns out to be TIME,,.,(~) + Ca,T,(i). As a consequence, after coassignment, the amount of load reduction for M(cK) is Ca,7,(ij - E, (;,. Moreover, the communication overhead for the last n - i triggered child;en can also be lessened. Henceforth, retrigger and coassignment will be benefi- cial.

Summing up the above discussions, we have Heuristic 4 to delicately modify the initial transmission sequence.

HEURISTIC 4. Let there be an n/k fork where the parent is (Y. If MC(Y) is a zero-hop or one-hop processor of the other parents of T,(i), and Ca,T,ti) 3 ET”(i) or (n - i + I)C,,r=ci, > Cy=;” lCu,T,(j) + CT=,l-k.+ lETm(j),

where 1 G i $

n - k, then the ith triggered child will be coassigned with cu and triggered last. Otherwise, its transmission sequence is not altered, and it will be assigned to a different processor from cy’s.

The criterion that M(ru) is a zero-hop processor or one-hop processor of the other parents of T,(i) is to avoid multihop communication between the coassigned child and its parents. Thus, we will not incur too much communica- tion overhead. The coassignment will be made from the first triggered child to the last one. If a child is coassigned with (Y in an n/k fork, it will become an II /(k + 1) fork.

Before describing Heuristic 5, let us define EF,( MT) = ACT,( MT) + E, to

(14)

ment MT. If there are several modules activated concurrently, we have to decide which one will first determine the transmission sequence and coassign- ment of its children. From the viewpoint of load balance, we require to diminish the load of the processor on which the activated module with the largest EF value resides. However, the larger EF value for a module may be caused by its larger level, where by Ieuel we mean the length of the longest path from source modules to the module. Such a condition may result in the module with smaller EF value triggering and coassigning its children earlier than the one with larger EF value. Therefore, a worse task assignment may be derived.

Modules are levelized from source modules to sink modules. Initially, the levels of all source modules are set to zero. Then, the level I, of module fi is defined as

As mentioned previously, Fp denotes the set of p’s parents.

Considering both level and EF value, we have Heuristic 5 to determine the priority of coassignment and transmission-sequence decisions when several modules are activated concu~ently.

HEURISTIC 5. The activated module with the smallest level and the largest

estimated finish moment first determines the coassignment and transmission sequence of its children. That is, the activated modules in the wait list are sorted in the nondecreasing order of level and the nonincreasing order of estimated finish moment. In addition, the former takes precedence over the latter.

Recall that, in Heuristic 4, some children are coassigned with their parents and others are not. We attempt to assign the uncoassigned child to the one-hop processor of its parents which leads to the minimum start moment of the child and the minimum elapsed time (load) of the processor. The use of the minimum start moment of a module implies that the processors assigned to its children and descendants will have smaller elapsed times. For a module, all of the one-hop processors of its parents are called its mailable processors for short.

From Equations (2) and (31, we conclude that a possible minimum start moment of an unassigned module is its activation moment. The set of a’s available processors whose elapsed times are larger than the activation mo- ment of module (Y is called the L. set of CX, and its complement the S set of CX.

(15)

In order to attain the minimum start moment of (Y, we require to assign u to a member of its S set. Thus both (Y’S start moment and the processor’s elapsed time are just the activation moment of Q. However, from Equation (51, we know that there exists idle time for this processor. If cy is assigned to the processor in the S set whose elapsed time is closest to cy’s activation moment, the idle time of this processor will be the minimum one among all processors in the S set.

If the S set of cx is empty and then we choose the processor with the least load in the L set to be (Y’S assigned processor, the elapsed time of this processor will become (Y’S start moment. Hence, this start moment will be the minimum one for (Y. Furthermore, since (Y is executed on the processor with the least load, load balance can be achieved. Hence, we have Heuristic 6 to sophisticatedly allocate an activated module to the best-fit processor.

HEURISTIC 6. Let there be an activated module which is not coassigned with any parent. If there exist available processors whose elapsed times are not larger than the module’s activation moment, we assign it to the one with the largest elapsed time. If there is no such processor, we assign it to the available processor with the smallest elapsed time.

If, unfortunately, there is no available processor for module (Y, then (Y can only be assigned to a multihop processor of its parents. We adopt static routing to determine the paths of message transmission between its parents’ processors and the multihop processor, since static routing is an effective routing method and one of the most widely used [181. In practice, under this condition, we first select the processor with the least elapsed time to be (Y’S assigned processor. The, for each of (Y’S parents, we apply Algorithm 1 to compute the trigger moments of the parent of (Y for all possible routes provided by the static routing. After doing that, we choose the route resulting in the least trigger moment to be the path for message transmission between the parent’s processor and the multihop processor.

D. REASSIGNMENT

If task partitioning does not successfully exploit parallelism and minimize communication overhead, the minimum task turnaround time will be very close to the sum of execution times of all modules (called the total execution

time). Therefore, the task turnaround time obtained by the aforementioned heuristics may exceed the total execution time. Although this may rarely happen in a reliable task partitioning, we still cannot take the chance of the attained task turnaround time exceeding the total execution time due to a bad task partitioning.

(16)

To handle such an abnormal condition, we check whether or not the attained task turnaround time is larger than the total execution time. If so, we reassign all modules to a single processor. This seems a simple policy, but is an effective one if combined with the proposed six heuristics. Using the approach of iterative improvement, we can also reassign modules and alter transmission sequences to reduce the task turnaround time, but that is time-consuming. In consequence, we do not suggest it in this paper.

IV. ILLUSTRATIVE EXAMPLE AND EXPERIMENTAL RESULTS

The algorithm using the proposed heuristics and reassignment to solve the task assignment problem in distributed computing systems is presented in the appendix. An example is now given to illustrate it. The ilIustrative dist~buted computing system is composed of three processors, and the task is partitioned into seven modules with precedence constraints. They are modeled as an undirected graph and a DAG graph as depicted in Figures 3 and 4 respec- tively. We want to assign the seven modules to the three processors in order to obtain a near-minimum task turnaround time. Tables 1 and 2 show the execution time of each module and the intermodule communication time of each adjacent module respectively. Also, Table 3 lists the route between multihop processors.

1

8 2 0 3

Fig. 3.

(17)

TABLE 1 Execution Time Module Time A 10 B 60 c 80 D 40 E 50 F 45 G 20 TABLE 2

Intermodule Communication Time

Module A B c D E F G A m 30 40 10 m cc B cc cc m cc 7; m CQ c mmmm 10 30 m D m cc m cc cc 60 m E cc cc 00 07 m m 15 F m cc cc m m cc 10 G m co 03 m cc m cc

The task assignment MT obtained by the proposed algorithm for the illustrative example is M(A)=l, TA = (B, D,C), M(B) = 2, T, = {El,

M(C)

=l, T,=(E,F), M(D)=3, To = {W, M(E) = 2, TE={G)y M(F) = 1, TF={G), M(G)=l, TG=( 1,

where the M denotes a module and its assigned processor, and the T denotes the list of transmission sequence of its children. Figure 5 plots the timing

(18)

TABLE 3

Routes between Multihop Processors Processor

From To Route

2 3 2+1-+3

3 2 3+1+2

diagram of the obtained task assignment. We achieve a near-minimum task turnaround time whose value is 225 time units. Comparing it with the minimum one, whose value is 215 time units, we see that we incur only 4.7% turnaround-time deviation.

A heuristic task-assignment simulator has been developed on a VAX 8200 by using the language c. A task-assignment simulator achieving the optimal solution has also been developed. Tens of experiments have been made for each of three EC ratios (average execution time divided by average communi- cation time): 8, 4, and 1. In these experiments, execution times and communi- cation times are generated by a random-number generator with average values statistically yielding some EC ratio. Besides, the topologies of the distributed computing systems and tasks are generated randomly, and every vertex is linked to at least one of the other vertices. Several routes are also provided for every pair of multihop processors.

The percentage of optimal solutions generated by the heuristic algorithm is called the hit ratio, and the percentage deviation of its obtained task turnaround time from the minimum one is called the deviation for short. From

Processor3 I : + : : . . : : : + : : : % CDS t t ACTD m= D.F STARTD Fig. 5.

(19)

TABLE 4 Experimental Results

“(Number of reassignments/number of experiments) x

100%.

b(Number of optimal solutions using reassignment/ number of experiments)X 100%.

the experimental results listed in Table 4, we have the following interesting results:

(11 The average deviations are very small for all EC ratios. Also, the probabilities of the worst cases, whose deviations are about 20%, are below 2% for all EC ratios.

(2) The average hit ratios are as high as 45%, 50% and 74% for EC ratios 8, 4, and 1 respectively.

(3) The reassignment plays a more important role for smaller EC ratios than larger ones. For the large EC ratios 8 and 4, only 4/45 and 8/50 of the optimal solutions are attained by using the reassignment. However, if we only use the proposed six heuristics, we can still obtain a high percentage of optimal solutions: 41%, 42%, and 54% for EC ratios 8, 4, and 1 respectively.

In the proposed algorithm, Heuristic 4 and routing are the dominant parts of the time complexity, but we know that the latter rarely occurs. We have used an O(m2p) algorithm to determine transmission sequences and coassign- ments in Heuristic 4, and an O(m’p0 algorithm to decide the most suitable processor and path for routing between multihop processors, where m denotes the number of modules, p the number of processors, and 1 the maximum number of routes between multihop processors. Therefore, the proposed algorithm provides polynomial time complexity to solve the problem of task assignment in distributed computing systems.

V. CONCLUSION

The task-assignment problem dealt with in this paper takes precedence constraint into consideration. In addition, the cost function to measure the performance of task assignment includes not only the execution time and the communication time, but also the idle time. Based on the module assignment

(20)

and transmission sequence, task turnaround time is successfully defined by using the concepts of trigger moment, activation moment, and start moment.

It is known that the search for an optimal task assignment with precedence constraint is NP-complete in the strong sense [lo, 15, 161. Six heuristics combined with an effective reassignment are proposed to effectively solve the task assignment problem. Though it is a heuristic approach, a near-optimal or even the optimal solution can be attained. If task partitioning successfully exploits parallelism and minimizes communication overhead, we can drop reassignment but still achieve satisfactory solutions. The small deviations and the high hit ratios of experimental results show that the proposed approach can effectively solve the task-assignment approximation problem in distributed computing systems.

APPENDIX

Algorithm 2.

(1) Initialize the elapsed time of all processors to zero;

Initialize the levels, trigger moments, activation moments and start mo- ments of all source modules to zero;

(2) Levelize modules;

(3) Compute the estimated finish moments of source modules and insert them into the wait list according to Heuristic 5;

(4) WHILE (the wait list is not empty) (5) BEGIN

(6)

(7) (8) (9) (10) (11) (12) (13) (14) (15) (16) (17)

Move the first element of the wait list to cu; IF ((u is not coassigned with any parent)

THEN use Heuristic 6 to assign a to the best-fit processor; r~ (M(a) is a multihop processor of its parents)

THEN recompute the trigger moments, activation moments, and start moments of the currently assigned modules;

Compute (Y’S start moment and finish moment, and update the elapsed time of M(cr) with both terms;

Sort n children of a according to Heuristic 3;

Use Heuristic 1 to determine whether execution time or communica- tion time will be the metric of the initial transmission-sequence deci- sion;

IF (the execution time is adopted as the metric) THEN re-sort children according to Heuristic 2; FOR i=lTO fI DO

(21)

(18) THEN use Heuristic 4 to determine whether T,(i) is coassigned with

(Y and triggered last;

(19) ELSE IF (M(T,(I')) is the same as M(a))

(20) THEN trigger T,(i) last;

/* The transmission sequence of (Y to its children is already changed. */ (211 FOR i=l TO n DO

(22) BEGIN

(23) IF (T,(i) is coassigned with a>

(24) THEN TRG,,T,cij = TIME,,,(,);

(251 ELSE TIME,,,M(,j= TRG, Tc;j= TIMEMcaj+C, Tc;j;

3 n (26) IF (T,(i) is activated) ’ LI

(271 THEN compute its activation moment and estimated finish moment,

and insert it into the wait list according to Heuristic 5; (28) ENDFOR;

(29) ENDWHILE;

(30) Use Equation (6) to compute the task turnaround time;

(311 IF (the task turnaround time is larger than the total execution time)

(32) THEN do reassignment;

(33) END of Algorithm 2.

REFERENCES

1. S. H. Bokhari, Dual processor scheduling with dynamic reassignment, IEEE Trans.

Software Engrg. SE-5:341-349 (July 1979).

2. H. S. Stone, Multiprocessor scheduling with the aid of network flow algorithms, IEEE Trans. Software Engrg. SE-3(6):85-93 (Jan. 1977).

3. H. S. Stone and S. H. Bokhari, Control of distributed processes, Computer 11:97-106

(July 1978).

4. W. W. Chu, L. J. Holloway, M. T. Lan, and K. Efe, Task allocation in distributed data processing, Computer 1357-69 (Nov. 1980).

5. V. M. Lo, Task assignment to minimize completion time, in Proceedings of the 5th

International Conference on Distributed Computing Systems, IEEE, Denver, May 1985.

pp. 329-336.

6. P. Y. R. Ma, E. Y. S. Lee, and M. Tsuchiya, A task allocation model for distributed computing systems, IEEE Trans. Cmput. C-31(1):41-47 (Jan. 1982).

7. K. Efe, Heuristic models of task assignment scheduling in distributed systems, Computer 15:50-56 (June 1982).

8. V. Lo and J. W. S. Liu, Task assignment in distributed multiprocessor system, in

Proceedings of 1981 International Conference on Parallel Processing, Columbus, Ohio, Aug. 1981, pp. 358-360.

9. C. C. Shen and W. H. Tsai, A graph matching approach to optimal task assignment in distributed computing systems using a minimax criterion, IEEE Trans. Comput. C-

34(3):197-203 (Mar. 1985).

10. H. Kasahara and S. Narita, Practical multiprocessor scheduling algorithms for efficient parallel processing, IEEE Trans. Comput. C-33(11):1023-1029 (Nov. 1984).

(22)

11. A. K. Ezzat, R. D. Bergeron, and J. L. Pokoski, Task allocation heuristics for distributed computing systems, in Proceedings of the 6th International Conference on Distributed Computing Systems, IEEE, Cambridge, Mass., 1986, pp. 337-346.

12. J. B. Sinclair, Efficient computation of optimal assignments for distributed tasks, J. Parallel and Distributed Cornput. 4:342-362 (1987).

13. J. Sheild, Partitioning concurrent VLSI simulation programs onto a multiprocessor by simulated annealing, IEE Proc. 134(Pt. E, No. 1):24-30 (Jan. 1987).

14. S. H. Bokhari, A. shortest tree algorithm for optimal assignments across space and time in a distributed processor system, I&!% Trans. Software Engrg. SE-7(6):583-589 (Nov. 1981).

15. S. Sahni and T. Gonzalez, P-complete approximation problems, J. Assoc. Comput. Mach. 23(7):555--565 (1976).

16. M. R. Garey and D. S. Johnson, Computers and Intractability: A Guide to the Theory of NP-Completeness, Freeman, San Francisco, 1979.

17. W. T. Chen and J. P. Sheu, Task assignment in i~~ly-~upied distributed computing systems, .I. Chinese Inst. Engrs. 1@6):‘721-726 (1987).

18. A. S. Tanenbaum, Computer Networks, Prentice-Hall, Englewood Cliffs, N.J., 1981. 19. W. W. Chu and L. M. Lan, Task allocation and precedence relations for distributed

real-time system, IEEE Trans. Comput. C-36(6):667-679 (June 1987). Received 4 October 1989; revised II November 1989, 21 December 1989

數據

TABLE  1  Execution  Time  Module  Time  A  10  B  60  c  80  D  40  E  50  F  45  G  20  TABLE  2
diagram  of  the  obtained  task  assignment.  We  achieve  a  near-minimum  task  turnaround  time  whose  value  is  225  time  units
TABLE  4  Experimental  Results

參考文獻

相關文件

Understanding and inferring information, ideas, feelings and opinions in a range of texts with some degree of complexity, using and integrating a small range of reading

Writing texts to convey information, ideas, personal experiences and opinions on familiar topics with elaboration. Writing texts to convey information, ideas, personal

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

Writing texts to convey simple information, ideas, personal experiences and opinions on familiar topics with some elaboration. Writing texts to convey information, ideas,

To this end, we introduce a new discrepancy measure for assessing the dimensionality assumptions applicable to multidimensional (as well as unidimensional) models in the context of

If the best number of degrees of freedom for pure error can be specified, we might use some standard optimality criterion to obtain an optimal design for the given model, and

This kind of algorithm has also been a powerful tool for solving many other optimization problems, including symmetric cone complementarity problems [15, 16, 20–22], symmetric

In order to solve the problems mentioned above, the following chapters intend to make a study of the structure and system of The Significance of Kuangyin Sūtra, then to have