Stochastic Scheduling with two Processors and Arbitrary Precedence Relations
Carlos Camino
August 4, 2015
1 / 49
Overview
I. Introduction
II. Theoretical Foundations III. Methods
IV. Results and Discussion V. Conclusion
2 / 49
Overview
I. Introduction
II. Theoretical Foundations III. Methods
IV. Results and Discussion V. Conclusion
3 / 49
What is scheduling?
4 / 49
What is scheduling?
5 / 49
What is scheduling?
6 / 49
What is scheduling?
7 / 49
8 / 49
9 / 49
10 / 49
11 / 49
12 / 49
13 / 49
14 / 49
15 / 49
16 / 49
Literature Review
Problem Reference
P 2 | prec | C max Solved by Coffman and Graham in 1972.
P 2 | intree , exp | E [C max ] Solved by Chandy and Reynolds in 1975.
P 2 | prec , exp | E[C max ] Subject of this thesis.
17 / 49
Overview
I. Introduction
II. Theoretical Foundations III. Methods
IV. Results and Discussion V. Conclusion
18 / 49
Probability Theory
Why consider exponentially distributed random variables X i ∼ Exp(λ i )?
I Expected value:
E [X i ] = 1 λ i
.
I Minimum:
min{X 1 , . . . , X n } ∼ Exp(λ 1 + . . . + λ n ).
I Memorylessness:
Pr[X i > x + y |X i > y] = Pr[X i > x ] (x, y > 0).
19 / 49
Snapshots
Let m be the number of available machines. A snapshot S = (T , P, A) consists of
I a finite set T ,
I a binary relation P ⊆ T × T and
I a subset A ⊆ T ,
such that (T , P ) is a DAG, |A| ≤ m and every t ∈ A is a source in (T , P).
T (S ), P (S ) and A(S) can be defined as T , P and A, respectively.
20 / 49
Example
Let m = 2. The snapshot S with
I T (S) = {1, 2, 3, 4, 5},
I P (S ) = {(1, 3), (1, 4), (2, 4)} and
I A(S) = {1}
can be represented as
S
1 2
3 4 5
21 / 49
Strategies and Direct Snapshots
I A strategy σ is a function that maps a snapshot S = (T , P, A) to a snapshot σ(S) = (T , P , A 0 ) with A ⊆ A 0 .
I The resulting snapshot S 0 after removing a task t ∈ A from a snapshot S = (T , P , A) is called direct subsnapshot of S.
22 / 49
Example
Snapshots S, S 0 , S 00 with
I σ(S) = S 0 for some strategy σ and
I S 00 direct subsnapshot of S 0 :
S
1 2
3 4 5
S 0
1 2
3 4 5
S 00
2
3 4 5
23 / 49
A formula for the expected makespan E [T S σ ]
Assuming independent finishing times X 1 , . . . , X n ∼ Exp(1) we can derive for a given strategy σ:
E [T S σ ] = E
h T σ(S) σ i
= E
h T σ(S) σ 0 + T σ(S) σ 00 i
= E
h T σ(S) σ 0 i + E
h T σ(S) σ 00 i
= E [min{X t | t ∈ A(σ(S))}] + X
S
0∈D(σ(S))
E [T S σ
0] · 1
|D(σ(S ))|
= 1
|D(σ(S ))|
1 + X
S
0∈D(σ(S))
E [T S σ
0]
,
where D(S) is the set of all direct subsnapshots of a snapshot S .
24 / 49
For m = 2 machines we obtain:
E[T S σ ] =
0 if D(σ(S )) = ∅
1 + E[T S σ
0] if D(σ(S )) = {S 0 }
1
2 + 1 2 E [T S σ
0] + 1 2 E [T S σ
00] if D(σ(S )) = {S 0 , S 00 } for S 0 6= S 00 .
25 / 49
Overview
I. Introduction
II. Theoretical Foundations III. Methods
IV. Results and Discussion V. Conclusion
26 / 49
Schedule Visualization
PROSIT (Probabilistic Scheduling Interactive Tool) allows to
I draw a snapshot and
I visualize its schedule.
It can be downloaded from
www.carlos-camino.de/prosit
27 / 49
Demo: Schedule example 1
28 / 49
Computing Expectancies
layer L i
intermediate layer L 0 i
layer L i+1
E [T S σ ] = E h
T σ(S) σ i
= 1 + E [T S σ
0] E [T S σ ] = E h
T σ(S) σ i
= 1 2 + 1 2 E [T S σ
0] + 1 2 E [T S σ
00] S
σ(S)
S 0 S 00 S
σ(S)
S 0
E [T S σ ]
E h
T σ(S) σ i
E [T S σ
0] E [T S σ
00] E [T S σ ]
E h
T σ(S) σ i
E [T S σ
0]
29 / 49
The Coffman-Graham Algorithm
1 2
3
4 5
6 7
8 9
10 11 12 13 14
15 16
17 18 19
30 / 49
The Coffman-Graham Algorithm
χ 0 χ 1
χ 2 χ 3
1 2
3
4 5
6 7
8 9
10 11 12 13 14
15 16
17 18 19
31 / 49
Demo: Schedule example 2
32 / 49
Overview
I. Introduction
II. Theoretical Foundations III. Methods
IV. Results and Discussion V. Conclusion
33 / 49
Case Studies on the HLF Policy The snapshot
n .. .
has optimal makespan n in the deterministic setting and optimal expected makespan n in the probabilistic setting.
34 / 49
The snapshot
n . . .
has optimal makespan n 2 in the deterministic setting and optimal expected makespan
n+1
2 in the probabilistic setting.
35 / 49
Demos: Two parallel chains and a small counterexample for HLF
36 / 49
Low Level Tasks with High Priority
n
m .. .
. . .
u v
For which values of m, n would an optimal strategy . . . . . . assign u ?
. . . assign v ?
37 / 49
The following snapshot L m,n
n
m .. .
. . .
with optimal expected makespan l m,n satisfies l m,0 = m 2 + 1, l 0,n = n + 1 and
l m,n = 1
2 l m−1,n + 1
2 l m,n−1 + 1 2 for m, n ≥ 1.
38 / 49
The following snapshot H m,n
n
m .. .
. . .
with optimal expected makespan h m,n satisfies h m,0 = m 2 + 2 and
h m,n = 1
2 h m,n−1 + 1
2 l m,n + 1 2 for m, n ≥ 1.
39 / 49
The following snapshots A u m,n and A v m,n
n
m .. .
. . .
u v
n
m .. .
. . .
u v
with optimal expected makespans a u m,n and a v m,n satisfy
a u m,n = 1
2 l m,n+1 + 1
2 h m,n+1 + 3
4 and a v m,n = h m,n+1 + 1 2 .
40 / 49
For which m, n it holds a m,n u < a m,n v ? For which a u m,n > a v m,n ?
n
m
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100
0 5 10 15 20 25 30
41 / 49
For which m, n it holds a m,n u < a m,n v ? For which a u m,n > a v m,n ?
n
m a u m,n > a v m,n
a u m,n < a v m,n
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100
0 5 10 15 20 25 30
42 / 49
How big is the difference a u m,n − a v m,n ?
n
m
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100
0 5 10 15 20 25 30
0.5
0
−0.5
43 / 49
How big is the difference a u m,n − a v m,n ?
n
m
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100
0 5 10 15 20 25 30
0.5
0
−0.5
44 / 49
A formula for l m,n The recurrence relation
l m,n = 1
2 l m−1,n + 1
2 l m,n−1 + 1 2 can be visualized as
1 2 1 2
1 2 1 2
1 2 1 2
1 2 1 2
1 2 1 2
1 2 1 2
1 2 1 2 1 2
1 2 1 2 1 2
1 2 1 2 1 2
1 2 1 2 1 2
1 2 1 2 1 2