Scheduling on two Uniform Processors with Resource Constraints to Minimize Mean Flow Time
全文
(2) slower processor P2 in idle. We can find an asymptotically optimal schedule of T by first finding an asymptotically optimal schedule of the tasks in T - L and then scheduling the tasks in L on P1 either before or after all tasks in T - L depending on the value of l. Without loss of generality, we will confine our discussion hereafter to the case where the subset L is empty. We use σo and σa to denote an optimal schedule and an asymptotically optimal schedule, respectively. When it is necessary to distinguish the starting time and completion time of a task Tj in a particular Schedule σ , we denote the starting time and completion time of task Tj by S(Tj,σ ) and. C(Tj,σ ), respectively. For any speed ratio, we can partition the time interval into sufficiently small time slices such that every task starts and ends its execution at the boundaries of some time slices in any schedule. We measure the lengths of all time intervals in terms of numbers of time slices. In terms of the time slices, the starting times and completion times of all tasks are integers. We say that a task Ti is executed later ( or earlier ) than Tj in a schedule σ if S(Ti,σ ) ≥ S(Tj,σ ) ( or S(Ti,σ ) < S (Tj,σ ) ), that is, the starting time of Ti is no earlier than the starting time of Tj. Finally, we denote the number of tasks assigned to the processor Pi according to the schedule σ by N(i,σ ) for i = 1 and 2, and the completion time of the last task on processors P1 or P2 in the schedule σ by f(σ ). To characterize asymptotically optimal schedules, we need the following definitions: Definitions: Given a schedule σn, let T1,T2,...,Tk be the tasks executed on processor P1 and Tk+1,Tk+2,..., Tn be the tasks executed on processors P2.. (1). The schedule σn is said to be normalized if the resource requirements of the tasks are such that R( Ti ). ≥ R( Tj ), here 1 ≤ i ≤ k and k + 1 ≤ j ≤ n.. (2). Suppose that the tasks are indexed so that R(T1) ≥ R(T2) ≥ ... ≥ R(Tk) ≥ R(Tk+1) ≥ ... ≥ R(Tn-1) ≥ R(Tn). A normalized schedule is said to be compact if in it (a) the starting times of the tasks are such that S(T1 ) ≥ S(T2 ) ≥ ... ≥ S(Tk ) and S(Tk+1 ) ≤ S(Tk+2 ) ≤ ... ≤ S(Tn ) and (b) the slower processor P2 is busy during the interval (0, b(n-k)) (i.e., S( Tk+1 ) = 0 and C(Tn ) = b(n-k)), and (c) the faster processor P1 is busy during the interval (S(Tk ), S(Tk ) + k) (i.e., C(T1 ) = S(Tk ) + k). Figure 1 illustrates a compact schedule. Tasks T1 to T12 are scheduled on P1. Tasks T13 to T19 are scheduled on P2. The tasks scheduled on the slow processor P2 start at time 0 and never idle after the processor starts its execution. The fast processor P1 has some initial idle time, and never stops executing. tasks until all tasks assigned to P1 are finished. jemf!ujnf!. dsptt!qpjou!u. 000. Gbtu!Qspdfttps!Q2 000 000 000 U23 U22 U21 U : U9 U 8 U7 U 6 U5 U 4 U3 U 2. 000 000. Tmpx!Qspdfttps!Q3. U24. U25. U26. U27. U28. U29. U2:. Figure 1. An example illustrates a compact schedule and a cross point.. (3). We refer to a time instant t in a schedule σ at which there are a task Ti starting on P1 and a task Tj starting on P2 as a cross point. That is, S(Ti,σ ) = S(Tj,σ ) = t for some Ti on P1 and Tj on P2. For example, in Figure 1 task T9 and T15 start at the same time t. Therefore, t is a cross point.. Our algorithm uses the following strategy to finding asymptotically optimal schedule. We at first find a compact schedule σc. After a compact schedule σc is found, we rearrange the execution order of some tasks to produce an asymptotically optimal schedule. To prove that our strategy can find an asymptotically optimal schedule, we need the following lemmas. Lemma 1: Given an optimal schedule σo with the number of tasks assigned to processor P1 being k, we can find from σo a compact schedule σc in which the number of tasks assigned to P1 is also equal to k, and the length of the idle period from 0 to S(Tk) on P1 is at most equal to the total. length I of time intervals during which P1 is idle in σo. In other words, N(1,σc) = N(1,σo) = k, and S(Tk,σc) ≤ I.. Proof: Given an optimal schedule σo, we sort all tasks assigned to the slow processor P2 in non-increasing order according to their resource requirements; the tasks with larger resources requirements are executed earlier. Moreover, the n-k tasks are assigned to the interval from 0 to b(n-k) on P2. During the sorting, the idle periods on the slow processor P2 will be moved to the end of the schedule. The tasks assigned to the fast processor P1 will be moved to keep the resource constraints satisfied. Tasks on the fast processor P1 may be preempted. In other word, when a task on P2 is moved, the task slices on P1 which are scheduled in the same time interval in σo are moved also. Therefore, the resource constraints remain satisfied after the sorting is finished. Tasks on P1 are split into many task slices and are assigned to uncontiguous time intervals. Figure 2 illustrates how the sorting works. In this figure, the slow processor P2 has three tasks and R(T2) ≥ R(T5) ≥ R(T7). We sort task T2, T5 and T7 according to their resource requirements. During the sorting, task T2 is moved to the interval starting at time 0. To satisfy the resource constraints, task T4 and part of task T6 need to be moved to the same time slot on P1. Tasks T6 is divided into two pieces during the sorting..
(3) Gbtu!Qspdfttps!Q2. U2 U6. Tmpx!Qspdfttps!Q3. Gbtu!Qspdfttps!Q2. U9. U4. U5. U7. U5. U8. 00 00 00 00 00 00 00. U2. U3. Tmpx!Qspdfttps!Q3. U7. U3. U4 U4. U9. U6. U7. U8. ≤ r , we can schedule T8 and T6 at the same time. By using the iterations of sorting and swapping, we eventually will find a compact schedule.. Gjhvsf!3/!!Uif!sftvmu!pg!tpsujoh!ubtlt!po!Q3. In order to put the task slices on P1 back together (i.e., in contiguous time intervals), we sort all task slices on P1 according to their resource requirements; the tasks with smaller resource requirements are executed earlier. Since all tasks on processor P2 are already sorted, sorting task slices on P1 will not violate the resource constraints. The example in Figure 3 illustrates how to put the task slices on P1 together without violating the resource constraints. In. this example, R(T1) ≥ R(T3) ≥ R(T4) ≥ R(T6) ≥ R(T8). Let's look at two tasks--T8 and T6 that violate the sorting order. Task T8 and task T6 need to be swapped. Since R(T2). ≥ R(T7), therefore, r ≥ R(T6) + R(T2) ≥ R(T6) + R(T7). It means that T6 and T7 can be scheduled in the same time. Therefore, moving T6 to the time interval originally assigned to T8 will not violate the resource constraints.. Moreover, since R(T6) ≥ R(T8), we can move T8 to the time interval assigned to T6 without violating the resource constraints. The sorting process of the tasks on the fast processor P1 can be done by applying the same swapping method repeatedly to tasks that violate the sorting order. Gbtu!Qspdfttps!Q2. U7. Tmpx!Qspdfttps!Q3. 000 000 Gbtu!Qspdfttps!Q2 000 000 000 000 000. Tmpx!Qspdfttps!Q3. U5. 000 000 000 000 000 000 000. U2. U3. U9 U3. U4 U4 U6. U7 U7. U5 U6. U7. U9. It is always possible to make the starting time S(Tk , σc) of the first task Tk on P1 sufficiently late so that P1 once becoming busy remains busy until the end of the schedule. The new schedule thus produced is a compact schedule. To find an upper bound of S(Tk , σc) so that the schedule is compact, we note that after the task slices on P1 and P2 are sorted as described above, the total length I of all intervals between 0 and b(n-k) during which P1 is idle is less than or equal to the total length of time intervals during which P1 is idle in σo. Moreover S(Tk , σc) ≤ I. 00 00 Gbtu!Qspdfttps!Q2 00 00 00 00 00. Tmpx!Qspdfttps!Q3. U9. U7 U7. U3. U5 U6. U4 U4. U2. U8. )txbq!U9 boe!U3 *. 00 Gbtu!Qspdfttps!Q2 00 00 00 00 00. Tmpx!Qspdfttps!Q3. U3. U7 U7. U9. U5 U6. U4 U4. U2. U8. Gjhvsf!5/!!Uif!sftvmu!pg!ubtl!txbqqjoh!qspdftt. Theorem 1: Given an optimal schedule σo with mean flow time Fo, we can find an asymptotically optimal schedule σa with mean flow time Fa such that. U8. U4 U4. steps. In the first step, we do the sorting process. In the second step, we swap the task if necessary. The iterations are repeated until no tasks need to be swapped. Figure 4 illustrates the change of the schedule after doing one iteration. In this example, the first task assigned to processor P1 (or P2) is T8 (or T2). Since R(T8) ≤ R(T2), we need to swap these two tasks to make the schedule compact. Since T6 is the task scheduled at the same time with T2, we need to check if the resource constraint is violated after we swap task T8 and T2. Since R(T8) + R(T6) ≤ R(T2) + R(T6). U2. U8. Gjhvsf!4/ !Uif!sftvmu!pg!tpsujoh!ubtlt!po!Q2. After the sorting is finished, we assume that the first tasks assigned on P1 and on P2 are Ta and Tb, respectively. If R(Ta) < R(Tb), we can swap Ta and Tb. The task swapping process will be illustrated in Figure 4. The compact schedule is constructed by iterations. Each iteration has two. Fa ≤ Fo +. c n. for some constant c, that is, lim Fa = Fo. n →∞. Proof: According to Lemma 1, we know that σo can be transformed into a compact schedule σc without changing the number of tasks assigned to P1. Now, we describe a method for constructing an asymptotically optimal schedule σa from a compact schedule. The method works as follows: We delay the starting times of all tasks on P1 in σc so that b is the earliest cross point in the resultant schedule.
(4) schedule σc'. We note that either both processors complete executing their last tasks at the same time, or P2 becomes idle first. Without loss of generality, we assume the latter. Let Tj be the first task on P1 that is executed after processor P2 completes its last task Tn and t1 denotes the starting. time of Tj. In other words, t1 = S(Tj) ≥ C(Tn) . Now, we remove all tasks on both processors in the time interval [0,b] temporarily and move all tasks in the time interval [b, t1] forward to the time interval [0, t1 - b]. After this movement, no task is assigned in the time interval [t1 - b, t1]. We then assign all temporarily removed tasks (they are scheduled in the time interval [0,b] originally) to this interval. However, rather than in their original order as in σc, we reverse the order in which they are assigned. In other words, if Tx is assigned earlier than Ty in the compact schedule σc, Ty is assigned earlier than Tx in the new schedule. The segment of σc' after t1 remains unchanged. This new assignment of tasks on processors is illustrated in Figure 5. jemf!ujnf!. flow time of all tasks on P1 in σa. That is, Wa1 ≤ Wo1. Next, we consider the total flow time of the tasks on P2. In σa, P2 idles at most once. Let c1 denote the number of tasks on P2 scheduled after the idle interval, then c1 is a constant. Furthermore, the length of the idle interval, denoted by c2, is less than 1. We have the following equations.. Wa2 ≤. U24. U25. U26. U27. U28. U29. 00 U2: 0 0 00. sfwfstfe. Gbtu!Qspdfttps!Q2 Tmpx!Qspdfttps!Q3. U28. i =n −k −c1 + c2. i =1. 1. 2. Wa2 - Wo2 ≤ c and Fa - Fo ≤. c n. 3.THE ALGORITHM OF FINDING THE ASYMPTOTICALLY OPTIMAL SCHEDULE According to theorem 1, the asymptotically optimal schedule can be found by the following steps:. (1). Assume that the number of tasks assigned to P1 is k and find a compact schedule σc with k tasks assigned to P1.. (2). Rearrange the assignment of the tasks in σc as described in theorem 1 to produce an asymptotically optimal schedule σa.. 00 00. U27. i =1. Let c = c1× c2, then. U : U 9 U8 U7 U 6 U 5 U 4 U 3 U 2 U21 U22 U2300 00 00 U26. n −k. i =. Therefore, Fa = Fo when the number of tasks approaches ∞.. dsptt!qpjou!u. 00 00. Tmpx!Qspdfttps!Q3. ∑ ∑i + c × c. n − k + c2. i+. but. Gbtu!Qspdfttps!Q2 00 00 00 U23 U22 U21 U: U 9 U 8 U 7 U 6 U 5 U 4 U 3 U 2. 00 00. ∑. n −k −c1. U29. 00 00. U2: 00 U 00 00 25. 00 00. 00. U24. Gjhvsf!6/!!Uif!dpotusvdujpo!pg!uif!btznqupujdbmmz!pqujnbm!tdifevmf. When all tasks are scheduled in this manner, we have a new schedule, denoted by σa. The mean flow time of σa can be computed as follows: Let Wo be the total flow time of σo (e.q., Wo = Fo×n). Let Wo1 and Wo2 be the total flow time of the tasks executed on processor P1 and P2, respectively. The total flow. time Wa of the new schedule σa can also be partitioned into two parts, Wa1 and Wa2, where Wa1 and Wa2 are the total flow time of the tasks assigned to P1 and P2 in σa, respectively. We have the following equations: Wo = Wo1 + Wo2 Wa = Wa1 + Wa2 Let us consider the total flow time of the tasks on processor P1 first. P1 may be idle for some times in the optimal schedule σo. But in schedule σa, the idle times on P1 are late than in σo. Hence Wa1 is less than or equal to the total. To do the step (2), we need to find t1 and t2 first. We then shift some tasks to the proper time intervals. It is easy to show that the run time for step (2) is linear. To find the time complexity of step (1), we note that the number of tasks assigned to P1 in σo is k, the possible values of k are 0,1,...,n. We try each possible value of k exactly once in order to find out what the exact value of k is. Lemma 2: Given a fixed k and n tasks T1,T2,...,Tn with R(T1) ≥ R(T2) ≥ ... ≥ R(Tn). We can find the compact schedule σc with k tasks assigned to P1 in linear time. Proof: We assign T1,...,Tk to P1 and assign Tk+1, ...,Tn to P2. P1 executes Tk, then executes Tk-1, etc.. P2 executes Tk+1, then Tk+2, etc.. In a compact schedule, P2 never idles, but P1 will idle a short period of times at the beginning. We determinate the initial idle time of P1 as follows: At first, we execute all tasks on P1 as early as possible without changing the execution order of tasks. Second, We fix the starting time of T1 and move all idle time intervals.
(5) of P1 as early as possible. The schedule produced by this method is a compact schedule. Because each task is examined at most twice, the total time in finding this schedule is linear. According to lemma 2, it is easy to show that the following theorem is true. Theorem 2: The asymptotically optimal schedule can be found in O(n2) Proof: By applying the algorithm designed in Lemma 2, we can find an asymptotically optimal schedule corresponding to a fixed k in linear time. We set the value of k to be all possible integer between 1 and n. Therefore, we at most need to try n times and the asymptotically optimal schedule will be found. We need to spend linear time in finding an asymptotically optimal schedule corresponding to a fixed k. Therefore, the total time in finding an asymptotically optimal schedule is O(n2). 4.CONCLUSIONS AND FUTURE WORKS In this paper, we study the problem of scheduling non-preemptive, independent tasks on two uniform processors to minimize mean flow time. The schedule must satisfy the resource constraints. We propose an algorithm to find an asymptotically optimal schedule. In the special case where the speed ratio between the fast and the slow processor is integer, our algorithm can be simplified to find the optimal schedules. In this paper, we focus on the case of two uniform processor systems. The algorithm proposed in this paper can be extended to handle the multiprocessor systems with arbitrary number of processors. In a multiprocessor system with arbitrary number of processors, our algorithm cannot guarantee that an asymptotically optimal schedule can be found, but a schedule with good approximation factor can be constructed.. 5.REFERENCES [1] Blazewicz,J., Kubiak,W., Rock,H., Szwarcfiter,J. “Minimizing mean flow-time with parallel processors and resource constraints,” Acta informatica. 24, 513-524(1987). [2] Blazewicz, J., Barcelo, J., Kubiak, W., Rock, H. “Scheduling tasks on two processors with deadlines and additional resources,” Eur. J. Oper. Res. 26, 364-370 (1986). [3] Blazewicz, J., Lenstra, J.K., Rinnooy Kan, A.H.G. “Scheduling subject to resource constraints: classification and complexity,” Discrete Appl. Math. 5, 11-24 (1983). [4] Johnson, D.S. “The NP-completeness column; an ongoing guide.,” J. Algorithm 4, 189-203 (1983). [5] Lenstra, J.K., Rinnooy Kan, A.H.G. “Scheduling theory since 1981: an annotated bibliography,” In M.O.H. Eighertaigh, J.K. Lenstra, A.H.G. Rinnooy Kan (eds.), Combinatorial Optimization: Annotated Bibliographies. Chichester: Wiley 1985. [6] Marco Spuri and John Stankovic. “How to Integrate precedence Constraints and Shared Resources in Real-Time Scheduling,” IEEE Trans. on Computers. vol. 43. No. 12, Dec. 1994. [7] Shlomi Dolev and Alexnder Keizelman.. “Non-preemptive Real-Time Scheduling of Multimedia Tasks,” Real-Time Systems. Vol. 17. No. 1, 1999. [8] Yueh-Min Huang and Ruey-Maw Chen. “Scheduling Multiprocessor Job with Resource and Timing Constraints Using Neural Networks,” IEEE Trans. on Systems, Man, and Cybernetics-Part B: Cybernetics. vol. 29. No. 4, Aug. 1999..
(6)
相關文件
By kinematic constraints, we mean two kinds of constraints imposing on the 4-momenta of the invisible particles: the mass shell constraints and the measured missing transverse
In this paper, motivated by Chares’s thesis (Cones and interior-point algorithms for structured convex optimization involving powers and exponentials, 2009), we consider
If P6=NP, then for any constant ρ ≥ 1, there is no polynomial-time approximation algorithm with approximation ratio ρ for the general traveling-salesman problem...
Although many excellent resource synchronization protocols have been pro- posed, most of them are either for hard real-time task scheduling with the maxi- mum priority inversion
If SAT can be solved in deterministic polynomial time, then so can any NP problems SAT ∈ NP-hard.. If A is an NP-hard problem and B can be reduced from A, then B is an
Preemptive scheduling – CPU scheduling is invoked whenever a process arrives at the ready queue, or the running process relinquishes the CPU.. Non-preemptive scheduling – CPU
Preemptive scheduling – CPU scheduling is invoked whenever a process arrives at the ready queue, or the running process relinquishes the CPU.. Non-preemptive scheduling – CPU
[19] considered a weighted sum of multiple objectives, including minimizing the makespan, mean flow time, and machine idle time as a performance measurement, and proposed