Scheduling Tasks with Exponential Service Times on Non-Identical ...

6 downloads 59 Views 1MB Size Report
MICHAEL PINEDO,** Instituto Venezolano de Investigaciones Cientificas. Abstract. We consider preemptive scheduling of N tasks on m processors; processors.
Scheduling Tasks with Exponential Service Times on Non-Identical Processors to Minimize Various Cost Functions Author(s): Gideon Weiss and Michael Pinedo Source: Journal of Applied Probability, Vol. 17, No. 1 (Mar., 1980), pp. 187-202 Published by: Applied Probability Trust Stable URL: http://www.jstor.org/stable/3212936 . Accessed: 24/10/2011 10:45 Your use of the JSTOR archive indicates your acceptance of the Terms & Conditions of Use, available at . http://www.jstor.org/page/info/about/policies/terms.jsp JSTOR is a not-for-profit service that helps scholars, researchers, and students discover, use, and build upon a wide range of content in a trusted digital archive. We use information technology and tools to increase productivity and facilitate new forms of scholarship. For more information about JSTOR, please contact [email protected].

Applied Probability Trust is collaborating with JSTOR to digitize, preserve and extend access to Journal of Applied Probability.

http://www.jstor.org

J. Appl. Prob. 17, 187-202 (1980) Printed in Israel 0021-9002/80/010187-16 $01.85 @ Applied Probability Trust 1980

SCHEDULING TASKS WITH EXPONENTIAL SERVICE TIMES ON NON-IDENTICAL PROCESSORS TO MINIMIZE VARIOUS COST FUNCTIONS

GIDEON WEISS,* Tel-Aviv University MICHAEL PINEDO,** Instituto Venezolano de Investigaciones Cientificas

Abstract We consider preemptive scheduling of N tasks on m processors; processors have different speeds, tasks require amounts of work which are exponentially distributed, with different parameters. The policies of assigning at every moment the task with shortest (longest) expected processing time among those not yet completed to the fastest processor available, second shortest (longest) to the second fastest etc., are examined, and shown to minimize expected values of various cost functions. As special cases we obtain policies which minimize expected flowtime, expected makespan and expected lifetime of a series system with m component locations and N spares. EXPONENTIAL STOCHASTIC

DYNAMIC DISTRIBUTION; PROGRAMMING; MULTIPROCESSORS; PREEMPTIVE SCHEDULING; RELIABILITY OF SERIES SYSTEM WITH

SPARES

1. Introduction m are available to process tasks 1, , N. Each processor can Processors 1, ? ., process one task at a time, each task can be processed by one processor at a time, any processor can process any task and interruptions in processing as well as switches of a task from one processor to another are allowed. Task j requires an amount of processing, where we assume that X1, - - -, XN are exponentially X, distributed random variables, with parameters A,1,* , AN.We assume X,'s to be independent of each other and to be independent of the manner in which tasks are assigned to processors. Processor i can provide an amount si of processing per unit time. Thus if only processor i is used to process task j, the processing Received 6 June 1978; revision received 23 January 1979. *Postal address: Department of Statistics, Tel-Aviv University, Ramat-Aviv, Tel-Aviv, Israel. **Postal address: Instituto Venezolano de Investigaciones Cientificas (IVIC), Apartado 1827, Caracas 101, Venezuela. This work was done while the authors were at the University of California, Berkeley, in the Department of Statistics and the Department of Industrial Engineering and Operations Research, respectively.

187

188

GIDEON WEISS AND MICHAEL PINEDO

will be completed in time T = Xj/s, where T is an exponential random variable with parameter Ajsi.More typically task j will be processed by some processor i, for duration t1, followed by processor i2 for duration t2, etc. until ts, + t2S + . . + tkSik reaches the value X,. Starting at time 0, a cost per unit time g(U) is incurred at time t, where U C {1, - - -, N} is the set of uncompleted tasks at t. We look for scheduling rules which minimize the expected cost over [0,00). Two scheduling rules are considered: let > s,, and let U= s?-> s,2 where be jk the set of A>, A_ uncompleted tasks at t. A SEPTrule -, {j, ', } -.- (Shortest Expected Processing Time) assigns task j, to processor i for i= 1, 2, . - , min(k, m); a LEPTrule (Longest.Expected Processing Time) assigns task to processor i for i = 1,2, - - -, min(k, m). jk-i+1 In Section 2 of this paper we formulate the problem of minimizing cost as a semi-Markov decision problem, and derive a criterion for the optimality of a scheduling rule. In Section 3 we find conditions on the cost rate g(U) under which SEPTor LEPT respectively is optimal. In Section 4 we list various cost rates g for which SEPTor LEPTis optimal. Among other things we show that SEPT minimizes the expected sum of task completion times (flowtime), while LEPT minimizes the expected time to the last task completion (makespan). The semi-Markov decision problem considered here can also be interpreted as a reliability problem, assuming a system with m component locations in series, and N spares. Component location i causes a spare to wear out at rate s,. Typically spare j will be used for time t, in location i1, then for time t2 in location i2 etc. until tS,, + - - - + tkSik reaches the value Xj and the spare fails, where X, is an exponentially distributed random variable with parameter A,. We show that the policy which is the analogue of LEPT maximizes the expected system lifetime. This paper generalises results of Bruno and Downey [1], Pinedo and Weiss [3], Van der Heyden [6] and Frederickson [2]. Results on distributions other than exponential appear in Weber [7]. 2. Formulation and an optimality criterion The scheduling problem described above can be formulated as a semi-Markov decision process (see Ross [4], Chapter 7). 1 , N} and processors {1, , m }. We order the At time t = 0 we have tasks {1, ! processors to have s,I s22 s,m ? 0, we assume s, > 0. We shall assume throughout that m N. Most practical situations can be reformulated so as to = processors with speeds s = 0. Tasks {1, - - -, N} are then have m ? N by adding to assigned processors, and processed until a task is completed, and a new assignment of processors is chosen. We consider t = 0 and the times at which tasks are completed as decision moments. The state U at a decision moment is the set of uncompleted tasks, U C {1, -- , N}. The set of actions available in state U, J(U), is defined as:

189

tasksonnon-identical processors Scheduling

J(U) = {f f is a 1-1 function from U into {1, ..., m }}. For state U and action f in J(U), the next decision moment occurs time T later, where T is an exponential random variable with rate Af(U) = IEjvAsfuj). The state at the next decision moment is U' where: k EU. =A(U) A,(U) The cost incurred between the two decision moments is g(U)T where g is a set function, and we assume g(U)2! 0 and g(0) = 0. We wish to find among all possible policies one which minimizes the expected cost over [0, oo). We need mainly to consider stationary policies - we say IT is a stationary policy if it takes action f E J(U) whenever the state is U, irrespective of the previous history and the time. If a stationary policy ir is used from time t when the state is U and onwards, we denote the expected cost over [t,oo) by G,(U). We denote by Gf,,,(U) the expected cost when f' is the action taken at state U, and iT is used from the next decision moment onwards. Because the action space is finite and because state 0 is absorbing for policies with finite expected cost (see Strauch [5], Theorems 9.1 and 6.5), we have the following result. P(U'=

U-{k})

Theorem 1 (Strauch [5]). (i) There exists a stationary optimal policy tr. (ii) Ir is a stationary optimal policy if for all U (1)

G, (U)=

min f'EJ(U)

Gf',(U).

(iii) Let f be the action chosen by 7r at state U. If for every U and every f' Zf, G,(U) < Gfl, (U), then Ir is uniquely optimal. So far we have considered policies which allow decisions at t = 0 and at the task completion times T15 T22= TN; we denote this class of policies by Po. ? We obtain a wider class of policies PA, if we allow decisions at 0 < A < 2A.. - TN. This is again a semi-Markov T2 f'(l). Let Sf'(k) = s', Sf'(r) = s", where s" > s'. Define: f"(j) =

f'(j) f '(k ) f'(1)

j/7k,l1 j=1 k. ]=

We use (4) to obtain, in Case 1 Gr,, - Gf,a, = AA,(Sh- sr)(G - G,)+ o(A)

(5) and in Case 2 (6)

G,f, -

= A(s"- s')(Ak(G - Gk)- A,(G - G,))+ o(A). G,"1-

191

Schedulingtaskson non-identicalprocessors

By (2) and (3) and by sh > S, s"> s', we then have: G,fl, - Gf,l, = AK + o(A),

K > 0.

By repeating this argument for f" and obtaining f"' etc., we get in a finite number of steps the actionf, for whichf(j) = j, j = 1, ... , n. Hence for anyf' Z f we find G,f,j - G, = AKI + o (A)

K, >O0,

and by taking A small enough (taking into account all the finitely many f' E J(U) and U C {1, - - N}) we get Gf,I,(U) > G,(U) for all U and f' Zf. ., (ii) Assume now, in contradiction to the weak inequalities (2), (3) that: Case 1. G - Gk ,1G; k+

Ak

The following lemma deals with Condition (2) for any priority policy. Lemma 1. Let g satisfy g (0) = 0, and if U priority policy, for any arbitrary fixed U:

V, g (U)> g(V). Then for any

WEISS AND

GIDEON

192

PINEDO

k =1,---,n.

G-Gk>0

(9)

MICHAEL

Proof. By induction on n, the size of U. Induction base, n = 2. For n = 2, we have

A + {1, 2}+ As,G,

G

Ass + A2S2

A2s2G2

G1

G= g{2}

g{1} A2S G2Als"

So G-G

s, g{2} +

(g{1,2} -

+ A2s2)

g{1}/(s,

>0 (g{1,2}- g{2})/(As,+ A2s2)

and

G -G2=(g{1,2} +i g{2}-g{1})/(As A2S (g{1, 2} - g{}l)/(A ss,+ A2s2) > 0 _ General n. We shall assume that (9) holds for sets of size G

(10)

Ak

A

So (noting Ask + Ak G-G -

-

8k+A

G

(11)

A

A=

Gk +

k =k+I

klA.

j=,A

+ Gk

As YA

G•

.

Aj(s S-)): A

1jdk A

n - 1. Write

G

+ AsG+

=

-

j~~l )

s

A

(Gk - Gk)>

0,

si and G, > Gjk, Gk > Gjk by the induction assumption. sj-_ = We now prove in Theorem 3 that under certain assumptions on the cost rate g, SEPTpolicies are optimal. We note that if tasks are ordered so that A,I> A2 - AN,then the resulting priority policy is a SEPTpolicy. Unless A, > - - > AN, ?.. s, > ... > s, it may not be unique; however, all SEPTpolicies have the same expected cost.

since g > gk,

Theorem 3. Let tasks be ordered so that A ? A2 A~N. The priority policy defined by that ordering is optimal if the cost rate g--satisfies the following conditions for every U C {1, -- , N}:

Schedulingtaskson non-identicalprocessors

g(0) = 0, g(U)

(12) (13) (14)

193

k < 1, k, 1E U.

g(U-{k})

g(U-{l})?g(U)-g(U-{k})-

O.

O

l})

g(U-{l})+g(U-{k,

k, 1E U.

Proof. We assume first that A > A2> s. > N, >s2*... > Sm> 0, m > N, and that (12)-(14) hold as strong inequalities. We note that (14) implies g(U)> g(V) whenever U D V, and so, by Lemma 1, for any fixed U, Condition (2) of Theorem 2 holds: k = 1, - - -, n.

G- Gk >0

(15)

By Theorem 2 it remains to show that Condition (3) holds, for any fixed U, and any k, 1 E U. It is clearly enough to show for any fixed U that (16)

Ahk-(G- Gk-1)- Ak(G - Gk)>0

k = 2,.. ",- UI

and we do that by induction on n, the size of U. The details of the induction proof appear in the appendix. -We now assume only that ...AN,s, ... > sm 0, and that (12)-(14) _ can add processors with speed s = 0 to hold as weak inequalities. If Am - N we > m N. get By what we already proved the priority policy is optimal if the parameters of the jobs are A' > ... > Ah > 0, the speeds of the processors are s'> ... > s > 0, and the cost rate is g' which satisfies (12)-(14) as strict inequalities. In other words, if we denote the expected cost with these values when an arbitrary policy nris used by G' and when the priority policy is used by G', then G'< G$. If we let A)-*Ah, s'-* si, g'(U)-* g(U) for all j = we get i = 1, , m and U C {1,..., N}, while keeping the above inequalities, 1,..,N G'-* G, G'-* G7 or G'-- oo (if 7r has infinite expected cost, e.g. when sm = 0 and 7r always assigns tasks to processor m ); and so G G,. _ Theorem 4 shows that under certain assumptions on the cost rate g, LEPT AN, policies are optimal. We note that if tasks are ordered so that A, 5 A2 ... _ ? the resulting priority policy is a LEPTpolicy. Theorem 4. Let tasks be ordered so that A, 5 A2: ... < AN. The priority policy defined by that ordering is optimal if the cost rate g is of the form g(U) = h1u, for every U C{1,

.

, N}, where JUI is the size of U, and 0=

(17) (18)

hl-

ho> h2S2 Sl

(where we define 0/0 as 0).

ho_h,>

hI

h2... :- 5hN

h3-h2> S3

>

hN - hN, SN

GIDEON WEISS AND MICHAEL PINEDO

194

Proof. We shall again assume initially that m > N, s, > . > sm, A, < - < AN and (17) and (18) hold as strict inequalities, and prove the theorem in that case. The argument in the proof of Theorem 3 will then enable us to dispense with the strict inequalities. We again need to check Conditions (2) and (3) of Theorem (1), Condition (2) holds by Lemma 1 because of Condition (17). To check (3) we need to show, for fixed U of size n, (19)

Ak -(G

k = 2, - , n.

Ak(G - Gk )> 0

- Gk-)-

and we prove (19) by induction on n. In the proof we have to show that As,(G - G )> h, - h, ,. We prove (20) here and leave the details of the rest of the induction proof for the (20)

appendix. To show (20) we proceed to calculate G - G,. While G is the cost of -processing tasks 1, -, n, Gn is the cost of processing tasks 1,- , n - 1. Let be the random completion times of tasks 1, - - -, n - 1, when the Cl, . -., C-_,, priority policy is used. We note that these are the same random variables whether we start with tasks 1.---,n or with tasks 1, - - -, n - 1. Let V(t), tE [0, oo) denote the set of uncompleted tasks among {1, - -., n - 1}, at time t, where we start with {1, -, n - 1} or {f1,- , n }, and use the priority policy. Then ?-

G - G= E

(21)

f

[g(V(t)+ {n})- g(V(t))]dt

where Cn is the completion time of task n. We now condition on the completion times of tasks 1, - - -, n - 1 being C, = ti, C2= t2, ... Cin, = t1-l, where 0 5 t, t2... tn-I t = 0, and use the condiobtain tional density of C, to E

fc [g(V(t)+ {n})- g(V(t))ldtI C,=,= Z' g{ik+l, ", i

k=o

=

t...C

, n}- g{ik+1, ", " in_1} AnSn- k

(22) X (1-

e -Ans

j=0 k(k+1-tk))(H-

k es--

,

--

tn

,

195

Scheduling tasks on non-identical processors

Here the k th summand is the conditional expected difference in processing costs between {1, - - , n} and {1, - - -, n- 1}, over the time interval from the kth to the (k + 1)th task completion. In our case, for all V C {1,- -, n}, g(V)=hlv= , and so (18), By g{ik+b, , in-, n} - g{ik+1, ' il} = h,-k - hn-k-1. " '", . , n - 1, so by substituting < = for k 1, I (h, h,_)/s, (hn, hn-k-1)/s,-k (h, - hn,_)/s, the expression would decrease. The terms multiplying (h,_k k = 0, ... , n - 1 add up to 1, and so we have that the expression in h,_k_)I/Asn-k, is (independently of the values of t.... t,_1) bounded from below by (22) So we have (h, h,_)/Ahs,. G-G, > h, -h,_ and we have shown (20). 4. Applications In this section we list some problems with cost rates satisfying the conditions of Theorems 3 or 4, so that SEPTor LEPTare optimal scheduling rules for them. We note that whenever we have m ... > sm SEPTand LEPTrequire preemptions, and we do not know what policies are optimal among the non-preemptive policies. We also note that the addition of processors with speed s = 0 does not change the SEPTor LEPTpolicies, hence allowing the insertion of idle time does not change the optimal policy. 1. SEPTminimizes expected flow time. We denote by C1, C2, CN the ... T completion times of tasks 1, -..., N, and by -- TN the completion 0_- flow _ time of a policy is times in their order of occurrence. The expected F,~= E(

= E C,

T,

.

The cost rate that yields this is

g(U)=JUI, and it is easily seen that g satisfies the conditions of Theorem 3. 2. SEPTminimizes the expected sum of the first k completions. We define

The cost rate which yields this is

196

GIDEON WEISS AND MICHAEL PINEDO

for IUj>(n-k)

fUl-(n-k)

0 for IUI?(n-k),

g(U)_

which satisfies the conditions of Theorem 3. 3. SEPTminimizes the expected weighted sum of completion times (agreeable 0 per unit time be associated with task j, that is weights). Let a cost of w, =

G=E(I We call the costs 'agreeable' if Ak

> Al -

w ). Wk

--

w. The appropriate cost rate is

g(U)= 1w;. j EU

The priority ordering to be used is 1, - , N, such that Ak A> k+,, and if Ak= Ak+,, k = 1, , N - 1. g () = 0, Obviously wk wk+,, g(U)?-O, k < l, and 0 for g(U {l})- g(U -{k })= wk - w > g(U)- g(U - {k })- g(U - {l})+ g(U - {k, l}) = 0, so Theorem 3 applies. Case 1 above is a special case of this problem with all wj = 1; Case 2 is not a special case of this problem. A different special case is the sum of completion times of = wk = 1, the k tasks with largest parameters A,, , Ak, obtained by w, = Wk+1=

- ...

=

WN = 0.

If the weights w, are not 'agreeable', one can easily construct examples for which SEPTfails to be optimal. For general weights wj one can define a priority 2 N. The priority ordering of the tasks 1, , N so that Aw, Ah2w2 2WhNW ... policy defined by this ordering is called the 'cgt' rule. When the weights are agreeable it coincides with SEPT.When the weights are not agreeable one can easily construct an example for which the 'cg ' rule is not optimal. 4. LEPTminimizes expected makespan. The makespan is the time from 0 until all tasks are completed. The expected makespan is M = E(TN)

=

E(max(C,

,

, C,)).

This is obtained by

{= 1 for U7 0 0

for

U = 0,

which satisfies the conditions of Theorem 4. One is tempted to conjecture that SEPTwould maximize the expected makespan. This is false, as some easy counterexamples show.

Schedulingtaskson non-identicalprocessors

197

5. Minimization and maximization of amounts of work by LEPT.We examine the expected cost W1= E(

sTN-1?l)

for 1 5 r : N. This is obtained from a cost rate

g(U) =

s+ 51 +

g(U) =

UIr

+Us, +s

U I

Suggest Documents