Presentation is loading. Please wait.

Presentation is loading. Please wait.

Online Scheduling of Precedence Constrained Tasks Yumei Huo Department of Computer Science New Jersey Institute.

Similar presentations


Presentation on theme: "Online Scheduling of Precedence Constrained Tasks Yumei Huo Department of Computer Science New Jersey Institute."— Presentation transcript:

1 Online Scheduling of Precedence Constrained Tasks Yumei Huo http://web.njit.edu/~yh23 yh23@njit.edu Department of Computer Science New Jersey Institute of Technology

2 2 Outline Introduction: –Three basic scheduling algorithms Online Scheduling of Precedence Constrained Tasks –Four nonpreemptive scheduling problems –Three preemptive scheduling problems Future Work

3 3 Outline Introduction: –Three basic scheduling algorithms Online Scheduling of Precedence Constrained Tasks –Four nonpreemptive scheduling problems –Three preemptive scheduling problems Future Work

4 4 Coffman-Graham algorithm (P2|p j =1, prec|Cmax and P2|p j =1, prec|  C i ) Step 1. Labeling Step 2. Scheduling

5 5 Coffman-Graham algorithm (cont.) Comparing two decreasing sequences of positive integers: by lexicographical order Example: (8, 6, 4, 3) < (8, 6, 5) and (9, 8, 6) < (9, 8, 6, 4, 3).

6 6 Example of Coffman-Graham algorithm 12 3 45 76 89 (9)(8) (7) (6) (5) (4) (3) (1)(2) 84 62 97531 76543210 (1) (2,1)

7 7 Hu’s algorithm (P|p j =1, intree|Cmax and P|p j =1, outtree|Cmax ) Step 1. Labeling Step 2. Scheduling

8 8 Hu’s algorithm---Level Definition: The level of a job i with no immediate successor is its processing time p i. The level of a job with immediate successor(s) is its processing time plus the maximum level of its immediate successor(s).

9 9 Example for Hu’s algorithm (1) (2) (3) (5) (6) (4) (7) (1) (2) (3) (5) (6) (4) (7) (1) (2) (3) (5) (6) (4) (7) (8) (9) (10) (11) (1) (2) (3) (5) (6) (4) (7) (8) (9) (10) (11) (12) (13) (1) (2) (3) (5) (6) (4) (7) (8) (9) (10) (11) (12) (13) (14) (15) (8) (9) (10) (11) (12) (13) (14) (15) (16)

10 10 Muntz-Coffman algorithm (P2|pmtn, prec |Cmax, P|pmtn, intree|Cmax and P|pmtn, outtree|Cmax ) Assign one processor each to the jobs at the highest level. If there is a tie among y jobs (because they are at the same level) for the last x (x < y) processors, then assign x/y processor to each of these y jobs. Whenever either of the two events below occurs, reassign the processors to the unexecuted portion of the unfinished tasks according to the above rule. Event 1: A task is completed. Event 2: We reach a point where, if we were to continue the present assignment, we would be executing some tasks at a lower level at a faster rate than other tasks at a higher level.

11 11 Example for Muntz-Coffman algorithm Preemptive schedule Processor-sharing schedule

12 12 Outline Introduction: –Three basic scheduling algorithms Online Scheduling of Precedence Constrained Tasks –Four nonpreemptive scheduling problems –Three preemptive scheduling problems Future Work

13 13 Online Scheduling Tasks are released, along with their constraints, at various different times.The scheduler schedules tasks with no future information. We say that an online scheduling algorithm is optimal if it always produces a schedule with the minimum C max, i.e., a schedule as good as any schedule produced by any scheduling algorithm with full knowledge of future releases of tasks.

14 14 Classical Scheduling Problems with polynomial optimal algorithms P|p j =1, intree|Cmax and P|p j =1, outtree|Cmax --- Hu’s algorithm P2|p j =1, prec|Cmax and P2|p j =1, prec|  C i --- Coffman- Graham algorithm P2|pmtn, prec |Cmax, P|pmtn, intree|Cmax and P|pmtn, outtree|Cmax --- Muntz-Coffman algorithm P|pmtn|Cmax --- McNaughton’s Rule

15 15 Online version of these problems Nonpreemptive scheduling problems: –P2|p j =p, chains i are released at r i |Cmax –P|p j =1, intree i is released at r i |Cmax –P|p j =1, outtree i is released at r i |Cmax –P2|p j =1, prec i is released at r i |Cmax Preemptive scheduling problems: –P2|pmtn, prec i is released at r i |Cmax –P|pmtn, intree i is released at r i |Cmax –P|pmtn, outtree i is released at r i |Cmax –P|pmtn, r j |Cmax (K.S.Hong and J.Y-T.Leung, 1988)

16 16 Our results Nonpreemptive scheduling problems: –P2|p j =p, chains i are released at r i |Cmax-----no optimal algorithm can possibly exist –P|p j =1, intree i is released at r i |Cmax-----no optimal algorithm can possibly exist –P2|p j =1, prec i is released at r i |Cmax ---- there is optimal algorithm –P|p j =1, outtree i is released at r i |Cmax----- there is optimal algorithm Preemptive scheduling problems: –P|pmtn, intree i is released at r i |Cmax---- no optimal algorithm can possibly exist –P2| pmtn, prec i is released at r i |Cmax ---- there is optimal algorithm –P|pmtn, outtree i is released at r i |Cmax---- there is optimal algorithm

17 17 Our results Nonpreemptive scheduling problems: –P2|p j =p, chains i are released at r i |Cmax-----no optimal algorithm can possibly exist –P|p j =1, intree i is released at r i |Cmax-----no optimal algorithm can possibly exist –P2|p j =1, prec i is released at r i |Cmax ---- there is optimal algorithm –P|p j =1, outtree i is released at r i |Cmax----- there is optimal algorithm Preemptive scheduling problems: –P|pmtn, intree i is released at r i |Cmax---- no optimal algorithm can possibly exist –P2| pmtn, prec i is released at r i |Cmax ---- there is optimal algorithm –P|pmtn, outtree i is released at r i |Cmax---- there is optimal algorithm

18 18 P2|p j =p, chains i are released at r i |Cmax (Counterexample) M=2 p j =2 654 1110987321 2468 121416182022240 S1 654 321 246810121416182022240 S1 4 5 6 1 2 3 4 5 6 4 5 6 1 2 3 1 2 3 Chains released at r 1 =0 Chains released at r 2 =5 7 8 9 10 11 7 8 9 10 11

19 19 Our results Nonpreemptive scheduling problems: –P2|p j =p, chains i are released at r i |Cmax-----no optimal algorithm can possibly exist –P|p j =1, intree i is released at r i |Cmax-----no optimal algorithm can possibly exist –P2|p j =1, prec i is released at r i |Cmax ---- there is optimal algorithm –P|p j =1, outtree i is released at r i |Cmax----- there is optimal algorithm Preemptive scheduling problems: –P|pmtn, intree i is released at r i |Cmax---- no optimal algorithm can possibly exist –P2| pmtn, prec i is released at r i |Cmax ---- there is optimal algorithm –P|pmtn, outtree i is released at r i |Cmax---- there is optimal algorithm

20 20 P|p j =1, intree i is released at r i |Cmax (Counterexample) 4 56 7 89 10 1112 1413 1615 1817 2019 2221 23 Tree 1 released at r 1 =0 M=3 24 25 2627 2829 3031 32 Tree 2 released at r 2 =4 S1 1296 22201816141185 2321191715131074 123456789 11120 22192017151296 323129271816141185 23213028262524131074 123456789 11120 312129192712171513 32302826162411975 23222018251410864 123456789 11120 S2

21 21 Our results Nonpreemptive scheduling problems: –P2|p j =p, chains i are released at r i |Cmax-----no optimal algorithm can possibly exist –P|p j =1, intree i is released at r i |Cmax-----no optimal algorithm can possibly exist –P2|p j =1, prec i is released at r i |Cmax ---- there is optimal algorithm –P|p j =1, outtree i is released at r i |Cmax----- there is optimal algorithm Preemptive scheduling problems: –P|pmtn, intree i is released at r i |Cmax---- no optimal algorithm can possibly exist –P2| pmtn, prec i is released at r i |Cmax ---- there is optimal algorithm –P|pmtn, outtree i is released at r i |Cmax---- there is optimal algorithm

22 22 P2|p j =1, prec i is released at r i |Cmax Algorithm A: Whenever new tasks arrive, do { t =the current time; U= the set of tasks active (i.e., not finished) at time t; Call the Coffman-Graham algorithm to reschedule the tasks in U; }

23 23 Example 12 3 45 76 89 (9)(8) (7) (6) (5) (4) (3) (1)(2) 84 62 97531 76543210 (9) (8) (5) (1)(2) Tasks not finished at t=2 (3) (4) (6) (7) (10) 10 (11) Tasks released at t=2 11 1213 14 15 4 7 5 8 9 62 31 102 9 9 1245 8147131110 86543 7

24 24 Our result Theorem 2.1.4 Algorithm A is optimal for P2|p j =1, prec i is released at r i |Cmax. Moreover, the schedule produced by Algorithm A has the largest number of tasks completed at any time instant t. ( Note: Algorithm A is optimal for P2|p j =1, prec i is released at r i |  C j )

25 25 Our results Nonpreemptive scheduling problems: –P2|p j =p, chains i are released at r i |Cmax-----no optimal algorithm can possibly exist –P|p j =1, intree i is released at r i |Cmax-----no optimal algorithm can possibly exist –P2|p j =1, prec i is released at r i |Cmax ---- there is optimal algorithm –P|p j =1, outtree i is released at r i |Cmax----- there is optimal algorithm Preemptive scheduling problems: –P|pmtn, intree i is released at r i |Cmax---- no optimal algorithm can possibly exist –P2| pmtn, prec i is released at r i |Cmax ---- there is optimal algorithm –P|pmtn, outtree i is released at r i |Cmax---- there is optimal algorithm

26 26 P|p j =1, outtree i is released at r i |Cmax Algorithm B: Whenever new tasks arrive, do { t =the current time; U= the set of tasks active (i.e., not finished) at time t; Call Hu's algorithm to reschedule the tasks in U; }

27 27 Example

28 28 Example

29 29 Our result Theorem 2.1.5 Algorithm B is optimal for P|p j =1, outtree i is released at r i |Cmax. Moreover, the schedule produced by Algorithm B has the largest number of tasks completed at any time instant t. ( Note: Algorithm B is optimal for P|p j =1, outtree i is released at r i |  C j )

30 30 Our results Nonpreemptive scheduling problems: –P2|p j =p, chains i are released at r i |Cmax-----no optimal algorithm can possibly exist –P|p j =1, intree i is released at r i |Cmax-----no optimal algorithm can possibly exist –P2|p j =1, prec i is released at r i |Cmax ---- there is optimal algorithm –P|p j =1, outtree i is released at r i |Cmax----- there is optimal algorithm Preemptive scheduling problems: –P|pmtn, intree i is released at r i |Cmax---- no optimal algorithm can possibly exist –P2| pmtn, prec i is released at r i |Cmax ---- there is optimal algorithm –P|pmtn, outtree i is released at r i |Cmax---- there is optimal algorithm

31 31 P|p j =1, pmtn, intree i is released at r i |Cmax (Counterexample) 4 56 7 89 10 1112 1413 1615 1817 2019 2221 23 Tree 1 released at r 1 =0 M=3 24 25 2627 2829 3031 32 Tree 2 released at r 2 =4 S1 1296 22201816141185 2321191715131074 123456789 11120 171513 211911975 23222018161410864 123456789 11120 S2 22192017151296 323129271816141185 23213028262524131074 123456789 11120 312129192712171513 32302826162411975 23222018251410864 123456789 11120

32 32 Our results Nonpreemptive scheduling problems: –P2|p j =p, chains i are released at r i |Cmax-----no optimal algorithm can possibly exist –P|p j =1, intree i is released at r i |Cmax-----no optimal algorithm can possibly exist –P2|p j =1, prec i is released at r i |Cmax ---- there is optimal algorithm –P|p j =1, outtree i is released at r i |Cmax----- there is optimal algorithm Preemptive scheduling problems: –P|pmtn, p j =1, intree i is released at r i |Cmax---- no optimal algorithm can possibly exist –P2| pmtn, prec i is released at r i |Cmax ---- there is optimal algorithm –P|pmtn, outtree i is released at r i |Cmax---- there is optimal algorithm

33 33 P2| pmtn,prec i is released at r i |Cmax Algorithm C: Whenever new tasks arrive, do { t =the current time; U= the set of tasks active (i.e., not finished) at time t; Call Muntz-Coffman algorithm to reschedule the tasks in U; }

34 34 Example

35 35 Example

36 36 Our result Theorem 2.2.4 Algorithm C is an optimal online algorithm for P2| pmtn,prec i is released at r i |Cmax.

37 37 Our results Nonpreemptive scheduling problems: –P2|p j =p, chains i are released at r i |Cmax-----no optimal algorithm can possibly exist –P|p j =1, intree i is released at r i |Cmax-----no optimal algorithm can possibly exist –P2|p j =1, prec i is released at r i |Cmax ---- there is optimal algorithm –P|p j =1, outtree i is released at r i |Cmax----- there is optimal algorithm Preemptive scheduling problems: –P|pmtn, intree i is released at r i |Cmax---- no optimal algorithm can possibly exist –P2| pmtn, prec i is released at r i |Cmax ---- there is optimal algorithm –P|pmtn, outtree i is released at r i |Cmax---- there is optimal algorithm

38 38 P|pmtn, outtree i is released at r i |Cmax Theorem 2.2.6 Algorithm C is an optimal online algorithm for P|pmtn, outtree i is released at r i |Cmax.

39 39 Outline Introduction: –Three basic scheduling algorithms Online Scheduling of Precedence Constrained Tasks –Four nonpreemptive scheduling problems –Three preemptive scheduling problems Future Work

40 40 Future Work (Continued Work) Online scheduling problems –Competitive Ratio –Objective function: mean flow time

41 41 Thank you!

42 42 Application of Online Scheduling Industrial Applications Multiuser operating systems such as Unix and Windows Web servers Database servers Load balancers sitting in front of server farms (Pruhs K., Sgall J., and Torng E., 2004 )


Download ppt "Online Scheduling of Precedence Constrained Tasks Yumei Huo Department of Computer Science New Jersey Institute."

Similar presentations


Ads by Google