Static scheduling in HRT-systems Real-Time Systems Lecture 7 Copyright, 2001 © Adam Czajka.

Slides:



Advertisements
Similar presentations
REAL TIME SYSTEM Scheduling.
Advertisements

Minimum Clique Partition Problem with Constrained Weight for Interval Graphs Jianping Li Department of Mathematics Yunnan University Jointed by M.X. Chen.
ECE 667 Synthesis and Verification of Digital Circuits
 Review: The Greedy Method
Scheduling in Distributed Systems Gurmeet Singh CS 599 Lecture.
CPE555A: Real-Time Embedded Systems
Properties of SPT schedules Eric Angel, Evripidis Bampis, Fanny Pascual LaMI, university of Evry, France MISTA 2005.
Courseware Scheduling of Distributed Real-Time Systems Jan Madsen Informatics and Mathematical Modelling Technical University of Denmark Richard Petersens.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Complexity Theory  Complexity theory is a problem can be solved? Given: ◦ Limited resources: processor time and memory space.
From HRT-HOOD to ADA95 Real-Time Systems Lecture 5 Copyright, 2001 © Adam Czajka.
CprE 458/558: Real-Time Systems (G. Manimaran)1 CprE 458/558: Real-Time Systems Dynamic Planning Based Scheduling.
Merge Sort 4/15/2017 6:09 PM The Greedy Method The Greedy Method.
Lecture 23 CSE 331 Oct 24, Temp letter grades assigned See the blog post for more details.
CSE 421 Algorithms Richard Anderson Lecture 6 Greedy Algorithms.
On the Task Assignment Problem : Two New Efficient Heuristic Algorithms.
Lecture 20 CSE 331 Oct 21, Algorithm for Interval Scheduling R: set of requests Set A to be the empty set While R is not empty Choose i in R with.
Embedded System Design Framework for Minimizing Code Size and Guaranteeing Real-Time Requirements Insik Shin, Insup Lee, & Sang Lyul Min CIS, Penn, USACSE,
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 23 Algorithm Efficiency.
1 Chapter 24 Developing Efficient Algorithms. 2 Executing Time Suppose two algorithms perform the same task such as search (linear search vs. binary search)
{ CS203 Lecture 7 John Hurley Cal State LA. 2 Execution Time Suppose two algorithms perform the same task such as search (linear search vs. binary search)
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 6: CPU Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms.
Progress Report 2014/02/12. Previous in IPDPS’14 Energy-efficient task scheduling on per- core DVFS architecture ◦ Batch mode  Tasks with arrival time.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 8.
A Graph Based Algorithm for Data Path Optimization in Custom Processors J. Trajkovic, M. Reshadi, B. Gorjiara, D. Gajski Center for Embedded Computer Systems.
Solving the Maximum Cardinality Bin Packing Problem with a Weight Annealing-Based Algorithm Kok-Hua Loh University of Maryland Bruce Golden University.
The Greedy Method. The Greedy Method Technique The greedy method is a general algorithm design paradigm, built on the following elements: configurations:
Outline Introduction Minimizing the makespan Minimizing total flowtime
Priority Queues Two kinds of priority queues: Min priority queue. Max priority queue. Nov 4,
Common Approaches to Real-Time Scheduling Clock-driven (time-driven) schedulers Priority-driven schedulers Examples of priority driven schedulers Effective.
Greedy Algorithms Interval Scheduling and Fractional Knapsack These slides are based on the Lecture Notes by David Mount for the course CMSC 451 at the.
1 JOB SEQUENCING WITH DEADLINES The problem is stated as below. There are n jobs to be processed on a machine. Each job i has a deadline d i ≥ 0 and profit.
1 Ch18. The Greedy Methods. 2 BIRD’S-EYE VIEW Enter the world of algorithm-design methods In the remainder of this book, we study the methods for the.
PREPARED BY: Qurat Ul Ain SUBMITTED TO: Ma’am Samreen.
From HRT-HOOD to C Real-Time Systems Lecture 6
Chapter 10 NP-Complete Problems.
Priority Queues An abstract data type (ADT) Similar to a queue
Greedy Method 6/22/2018 6:57 PM Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015.
Merge Sort 7/29/ :21 PM The Greedy Method The Greedy Method.
The Greedy Method and Text Compression
Priority Queues Chuan-Ming Liu
Presented by: Suresh Vadlakonda Ramanjaneya Gupta Pasumarthi
Greedy Algorithms Basic idea Connection to dynamic programming
Topological Sort (an application of DFS)
ICS 353: Design and Analysis of Algorithms
Merge Sort 11/28/2018 2:18 AM The Greedy Method The Greedy Method.
Merge Sort 11/28/2018 8:16 AM The Greedy Method The Greedy Method.
Lecture 19 CSE 331 Oct 12, 2016.
Advanced Algorithms Analysis and Design
Merge Sort 1/17/2019 3:11 AM The Greedy Method The Greedy Method.
Lecture 6 Topics Greedy Algorithm
Richard Anderson Lecture 6 Greedy Algorithms
Greedy Algorithms TOPICS Greedy Strategy Activity Selection
Divide and Conquer Algorithms Part I
Lecture 19 CSE 331 Oct 8, 2014.
Lecture 20 CSE 331 Oct 17, 2011.
Process Scheduling B.Ramamurthy 2/23/2019.
Richard Anderson Autumn 2016 Lecture 7
Priority Queues An abstract data type (ADT) Similar to a queue
Lecture 18 CSE 331 Oct 9, 2017.
Richard Anderson Lecture 7 Greedy Algorithms
Topological Sort (an application of DFS)
Operating System , Fall 2000 EA101 W 9:00-10:00 F 9:00-11:00
Lecture 21 CSE 331 Oct 22, 2012.
Richard Anderson Winter 2019 Lecture 7
Merge Sort 5/2/2019 7:53 PM The Greedy Method The Greedy Method.
Lecture 19 CSE 331 Oct 10, 2016.
Richard Anderson Autumn 2015 Lecture 7
Heaps & Multi-way Search Trees
Richard Anderson Autumn 2019 Lecture 7
Presentation transcript:

Static scheduling in HRT-systems Real-Time Systems Lecture 7 Copyright, 2001 © Adam Czajka

Contents Introduction Binarization algorithm Binarization costs Perioding loading problem Flexible loading problem Conclusions

Copyright, 2001 © Adam Czajka Ti3Ti3Ti3Ti3 Ti2Ti2Ti2Ti2 Ti1Ti1Ti1Ti1 Scheduling periodic tasks 1 x n xn xn xn xTask Ta Task 2 sk Task i iiii iiii iiii iiii  HRT HOOD, protected objects

Copyright, 2001 © Adam Czajka Ti1Ti1Ti1Ti1 1 x n x Task Ta Task 2 sk Task i eieieiei iiii Valid schedule is built off-line and stored in a time-table array Valid schedule is built off-line and stored in a time-table array Static scheduling Simple task dispatcher is run on-line. The information from the time-table array is used to assign a processor to the particular task. Simple task dispatcher is run on-line. The information from the time-table array is used to assign a processor to the particular task.

Copyright, 2001 © Adam Czajka Tasks:T 1 T 2 T 3 T 4 Periods: LCM = Question: Can we replace tasks’ periods in such a way that the size of the array will be decreased ? Can we replace tasks’ periods in such a way that the size of the array will be decreased ?Question: 17 * 37 * 131 * 271 = Static scheduling

Copyright, 2001 © Adam Czajka Binary periods Tasks:T 1 T 2 T 3 T 4 Periods: Answer: YES Answer: YES Every task T i can be run with any period p i iff p i   i

Copyright, 2001 © Adam Czajka Tasks:T 1 T 2 T 3 T 4 Periods: Answer: YES Answer: YES Binary periods Every task T i can be run with any period p i iff p i   i

Copyright, 2001 © Adam Czajka Tasks:T 1 T 2 T 3 T 4 Periods: Answer: YES Answer: YES Binary periods Every task T i can be run with any period p i iff p i   i

Copyright, 2001 © Adam Czajka Tasks:T 1 T 2 T 3 T 4 Periods: Answer: YES Answer: YES Binary periods Every task T i can be run with any period p i iff p i   i

Copyright, 2001 © Adam Czajka Tasks:T 1 T 2 T 3 T 4 Periods: Answer: YES Answer: YES Binary periods Every task T i can be run with any period p i iff p i   i

Copyright, 2001 © Adam Czajka Tasks:T 1 T 2 T 3 T 4 Periods: LCM = 256 Answer: YES Answer: YES Binary periods Every task T i can be run with any period p i iff p i   i

Copyright, 2001 © Adam Czajka Binarization algorithm (1) Input: Input: sequence of periods  = (  1,  2,...,  n ), where  1 = min{  i } sequence of periods  = (  1,  2,...,  n ), where  1 = min{  i } Output: Output: Set of estimations, where each estimation has the form: [ p 0 : 2 k 1, 2 k 2,..., 2 k n ] p 1 = 2 k 1 p 0, p 2 = 2 k 2 p 0,... Set of estimations, where each estimation has the form: [ p 0 : 2 k 1, 2 k 2,..., 2 k n ] p 1 = 2 k 1 p 0, p 2 = 2 k 2 p 0,... Input: Input: sequence of periods  = (  1,  2,...,  n ), where  1 = min{  i } sequence of periods  = (  1,  2,...,  n ), where  1 = min{  i } Output: Output: Set of estimations, where each estimation has the form: [ p 0 : 2 k 1, 2 k 2,..., 2 k n ] p 1 = 2 k 1 p 0, p 2 = 2 k 2 p 0,... Set of estimations, where each estimation has the form: [ p 0 : 2 k 1, 2 k 2,..., 2 k n ] p 1 = 2 k 1 p 0, p 2 = 2 k 2 p 0,...

Copyright, 2001 © Adam Czajka Binarization algorithm (2) Step 1: Step 1:  min =  1 /2;  max =  1 ; E =  ;  min =  1 /2;  max =  1 ; E =  ; Step 2: Step 2: For every element  i   do the following: For every element  i   do the following:  find k  N, such that  min <  i /2 k   max, let p 0 =  i /2 k.  find k  N, such that  min <  i /2 k   max, let p 0 =  i /2 k.  add estimation [p 0 : e(  1, p 0 ), e(  2, p 0 )..., e(  n, p 0 )] to the set E, where e(a, b)=max{2 q : b2 q  a} i 2 q  N  add estimation [p 0 : e(  1, p 0 ), e(  2, p 0 )..., e(  n, p 0 )] to the set E, where e(a, b)=max{2 q : b2 q  a} i 2 q  N Step 1: Step 1:  min =  1 /2;  max =  1 ; E =  ;  min =  1 /2;  max =  1 ; E =  ; Step 2: Step 2: For every element  i   do the following: For every element  i   do the following:  find k  N, such that  min <  i /2 k   max, let p 0 =  i /2 k.  find k  N, such that  min <  i /2 k   max, let p 0 =  i /2 k.  add estimation [p 0 : e(  1, p 0 ), e(  2, p 0 )..., e(  n, p 0 )] to the set E, where e(a, b)=max{2 q : b2 q  a} i 2 q  N  add estimation [p 0 : e(  1, p 0 ), e(  2, p 0 )..., e(  n, p 0 )] to the set E, where e(a, b)=max{2 q : b2 q  a} i 2 q  N

Copyright, 2001 © Adam Czajka Binary periods Example:Example:  = (17, 37, 131, 271);  max = 17; p 1 = 17;  min = 8.5; 2 k p 0 e(17, p 0 ) e(37, p 0 ) e(131, p 0 ) e(271, p 0 )

Copyright, 2001 © Adam Czajka Binary periods Example:Example:  = (17, 37, 131, 271);  max = 17; p 1 = 17;  min = 8.5; 2 k p 0 e(17, p 0 ) e(37, p 0 ) e(131, p 0 ) e(271, p 0 ) Basic binarization

Copyright, 2001 © Adam Czajka Binary periods Question:Question: Which estimation is the best one ? We say, that estimation B = [p 0 : 2 k 1, 2 k 2,..., 2 k n ] dominates over the estiamtion B’ = [p 0 ’ : 2 k 1 ’, 2 k 2 ’,..., 2 k n ’ ] iff the following two conditions are met: 1.  schedule(B’) =>  schedule(B) & 1.  schedule(B’) =>  schedule(B) & ~ (  schedule(B) =>  schedule(B’)) ~ (  schedule(B) =>  schedule(B’)) We say, that estimation B = [p 0 : 2 k 1, 2 k 2,..., 2 k n ] dominates over the estiamtion B’ = [p 0 ’ : 2 k 1 ’, 2 k 2 ’,..., 2 k n ’ ] iff the following two conditions are met: 1.  schedule(B’) =>  schedule(B) & 1.  schedule(B’) =>  schedule(B) & ~ (  schedule(B) =>  schedule(B’)) ~ (  schedule(B) =>  schedule(B’))

Copyright, 2001 © Adam Czajka Binary periods Question:Question: Which estimation is the best one ? We say, that estimation B = [p 0 : 2 k 1, 2 k 2,..., 2 k n ] dominates over the estiamtion B’ = [p 0 ’ : 2 k 1 ’, 2 k 2 ’,..., 2 k n ’ ] iff the following two conditions are met: 2.  schedule(B’) =>  schedule(B) & 2.  schedule(B’) =>  schedule(B) &  schedule(B) =>  schedule(B’) & p 0 > p 0 ’  schedule(B) =>  schedule(B’) & p 0 > p 0 ’ We say, that estimation B = [p 0 : 2 k 1, 2 k 2,..., 2 k n ] dominates over the estiamtion B’ = [p 0 ’ : 2 k 1 ’, 2 k 2 ’,..., 2 k n ’ ] iff the following two conditions are met: 2.  schedule(B’) =>  schedule(B) & 2.  schedule(B’) =>  schedule(B) &  schedule(B) =>  schedule(B’) & p 0 > p 0 ’  schedule(B) =>  schedule(B’) & p 0 > p 0 ’

Copyright, 2001 © Adam Czajka Binary periods Question:Question: Which estimation is the best one ? When for the estimation B = [p 0 : 2 k 1, 2 k 2,..., 2 k n ] we are unable to find such an estimation B’ which dominates B, we say that B is non-dominated estimation. When for the estimation B = [p 0 : 2 k 1, 2 k 2,..., 2 k n ] we are unable to find such an estimation B’ which dominates B, we say that B is non-dominated estimation.

Copyright, 2001 © Adam Czajka Binary periods Question:Question: Which estimation is the best one ? Theorem Binarization algorithm finds only the non- dominated estimations. Theorem

Copyright, 2001 © Adam Czajka Binary periods Question:Question: Which estimation is the best one ? Theorem If we cannot find a valid schedule for all non- dominated estimations, then the valid schedule doesn’t exist for any other binary estimation. Theorem

Copyright, 2001 © Adam Czajka Binary periods Question:Question: Which estimation is the best one ? Answer : We have to check ALL non-dominated estimations ! We have to check ALL non-dominated estimations ! None of them is the best one. None of them is the best one.

Copyright, 2001 © Adam Czajka Binarization costs Question:Question: What about tasks’ execution times ? There is a possibility, that: There is a possibility, that: the schedule exist before and doesn’t exist after the binarization process ! the schedule exist before and doesn’t exist after the binarization process ! There is a possibility, that: There is a possibility, that: the schedule exist before and doesn’t exist after the binarization process ! the schedule exist before and doesn’t exist after the binarization process !

Copyright, 2001 © Adam Czajka Binarization costs (1) T i = { T 1, T 2, T 3 }  i = { 10, 20, 30 }  i = { 5, 5, 5 } T i = { T 1, T 2, T 3 } p i = { 10, 20, 20 }  i = { 5, 5, 5 }

Copyright, 2001 © Adam Czajka Binarization costs (2) T i ={T 1, T 2, T 3, T 4 }  i ={10, 20, 30, 60}  i ={5, 5, 5, 5} T i ={T 1, T 2, T 3, T 4 } p i ={10, 20, 20, 40}  i ={5, 5, 5, 5} ?

Copyright, 2001 © Adam Czajka Binarization costs Question:Question: How much we should speed-up the CPU to obtain the valid schedule ?

Copyright, 2001 © Adam Czajka Binarization costs Theorem If exists the valid schedule for tasks {T 1, T 2,..., T n }, then exist the valid schedule for tasks {T 1 ’, T 2 ’,..., T n ’}, where - the periods of the tasks {T 1 ’, T 2 ’,..., T n ’} are the basic binarization of the periods of tasks {T 1, T 2,..., T n } -  i ’ =  i / 2Theorem If exists the valid schedule for tasks {T 1, T 2,..., T n }, then exist the valid schedule for tasks {T 1 ’, T 2 ’,..., T n ’}, where - the periods of the tasks {T 1 ’, T 2 ’,..., T n ’} are the basic binarization of the periods of tasks {T 1, T 2,..., T n } -  i ’ =  i / 2

Copyright, 2001 © Adam Czajka Binarization costs T i ={T 1, T 2, T 3, T 4 }  i ={10, 20, 30, 60}  i ={5, 5, 5, 5} T i ={T 1, T 2, T 3, T 4 } p i = {10, 20, 20, 40}  i = {5, 5, 5, 5}

Copyright, 2001 © Adam Czajka Binarization costs T i ={T 1, T 2, T 3, T 4 }  i ={10, 20, 30, 60}  i ={5, 5, 5, 5} T i ={T 1, T 2, T 3, T 4 } p i = {10, 20, 20, 40}  i ’ = {2.5, 2.5, 2.5, 2.5}

Copyright, 2001 © Adam Czajka Binarization costs T i ={T 1, T 2, T 3, T 4 }  i ={10, 20, 30, 60}  i ={5, 5, 5, 5} T i ={T 1, T 2, T 3, T 4 } p i = {10, 20, 20, 40}  i ’ = {2.5, 2.5, 2.5, 2.5}

Copyright, 2001 © Adam Czajka Binarization costs

Copyright, 2001 © Adam Czajka Scheduling tasks with binary periods Applications MAFT architecture MAFT architecture Implementation of MIL-STD-1553 Implementation of MIL-STD-1553

Copyright, 2001 © Adam Czajka Periodic loading T13T13T13T13 T12T12T12T12 T11T11T11T11  = p 0   T14T14T14T14 Timeframe Period of a task T i : p i = w i p 0, where w i = 2 j T21T21T21T21 w 1 = 1 w 2 = 2

Copyright, 2001 © Adam Czajka  T1T1T1T1 T1T1T1T1  T2T2T2T2  T1T1T1T1 T2T2T2T2  T1T1T1T1 T3T3T3T3 T1T1T1T1  T2T2T2T2  T1T1T1T1 T3T3T3T3  T1T1T1T1  T1T1T1T1 T2T2T2T2 F[0] F[1] F[2] F[3] w 1 = 1 w 2 = 2 w 3 = 4 Periodic loading

Copyright, 2001 © Adam Czajka T1T1T1T1  T2T2T2T2  T1T1T1T1 T3T3T3T3  T1T1T1T1  T1T1T1T1 T2T2T2T2 F[0] F[1] F[2] F[3] Phase f(i) of task T i : T i is executed every frame f i + k w i, k= 0,1, 2,.. f 1 = 0 f 2 = 0 f 3 = 1 Periodic loading w 1 = 1 w 2 = 2 w 3 = 4

Copyright, 2001 © Adam Czajka T1T1T1T1  T2T2T2T2  T1T1T1T1 T3T3T3T3  T1T1T1T1  T1T1T1T1 T2T2T2T2 F[0] F[1] F[2] F[3]  i = duration of task T i y j = load of frame F[j] y 0 =  1 +  2 y 1 =  1 +  3 y 2 =  1 +  2 y 3 =  1 Periodic loading w 1 = 1 w 2 = 2 w 3 = 4 f 1 = 0 f 2 = 0 f 3 = 1

Copyright, 2001 © Adam Czajka T1T1T1T1  T2T2T2T2  T1T1T1T1 T3T3T3T3  T1T1T1T1  T1T1T1T1 T2T2T2T2 F[0] F[1] F[2] F[3] Maximal load z = max {y 0, y 1,.., y P-1 } P = the number of frames = LCM{ w 1,..., w n } z = y 1 Periodic loading y 0 =  1 +  2 y 1 =  1 +  3 y 2 =  1 +  2 y 3 =  1

Copyright, 2001 © Adam Czajka T1T1T1T1  T2T2T2T2  T1T1T1T1 T3T3T3T3  T1T1T1T1  T1T1T1T1 T2T2T2T2 F[0] F[1] F[2] F[3] z = y 1 Periodic loading Given a set of tasks {T 1,.., T i,.., T n }, their periods p i and duration times  i find their phases f i such that minimise the maximum load z. y 0 =  1 +  2 y 1 =  1 +  3 y 2 =  1 +  2 y 3 =  1

Copyright, 2001 © Adam Czajka T1T1T1T1  T2T2T2T2  T1T1T1T1 T3T3T3T3  T1T1T1T1  T1T1T1T1 T2T2T2T2 F[0] F[1] F[2] F[3] z = y 1 For a given a set of tasks {T 1,.., T i,.., T n }, their periods p i and duration times  i are there such phases f i that the maximum load z   ? Periodic loading problem y 0 =  1 +  2 y 1 =  1 +  3 y 2 =  1 +  2 y 3 =  1

Copyright, 2001 © Adam Czajka Complexity The periodic loading problem is strongly NP-hard [Schweitzer et al., 1989] A heuristic strategy Non-decreasing periods Non-decreasing periods Non-decreasing duration Non-decreasing duration

Copyright, 2001 © Adam Czajka The NID heuristic [Schweitzer et al., 1989]  Input: {T i }, {  i }, {w i }; 1. P:= max{ w i }; empty the frames F[0],.., F[P-1]; 2. Sort the tasks according to non-increasing order of duration time  i. 3. Assign T i to first such a frame F[j] (0  j < w i ) that its load y j is minimal, and then to every F[j+k  w i ] frame, where k = 1, 2,..., (P/w i -1)

Copyright, 2001 © Adam Czajka The NDP heuristic [Schweitzer et al., 1989] Input: {T i }, {  i }, {w i }; 1. P:= max{ w i }; empty the frames F[0],.., F[P-1]; 2. Sort the tasks according to non-decreasing order of periods w i. 3. Assign T i to first such a frame F[j] (0  j < w i ) that its load y j is minimal, and then to every F[j+k  w i ] frame, where k = 1, 2,..., (P/w i -1)

Copyright, 2001 © Adam Czajka The NDP/D heuristic [Schweitzer et al., 1989] Input: {T i }, {  i }, {w i }; 1. P:= max{ w i }; empty the frames F[0],.., F[P-1]; 2. Sort the tasks according to non-decreasing order of coefficients r i = w i /  i. 3. Assign T i to first such a frame F[j] (0  j < w i ) that its load y j is minimal, and then to every F[j+k  w i ] frame, where k = 1, 2,..., (P/w i -1)

Copyright, 2001 © Adam Czajka Experiments

Copyright, 2001 © Adam Czajka Flexible loading T13T13T13T13 T12T12T12T12 T11T11T11T11  = p 0   T14T14T14T14 Timeframe T21T21T21T21 w 1 =1 w 2 =2 w 3 =2 Period of a task T i : p i = w i p 0, where w i = 2 j

Copyright, 2001 © Adam Czajka Flexible loading T12T12T12T12 T11T11T11T11  = p 0   T14T14T14T14 Timeframe T21T21T21T21 T31T31T31T31 T13T13T13T13 w 1 =1 w 2 =2 w 3 =2 Period of a task T i : p i = w i p 0, where w i = 2 j

Copyright, 2001 © Adam Czajka Flexible loading T12T12T12T12 T11T11T11T11   T14T14T14T14 Timeframe T21T21T21T21 T31T31T31T31 T13T13T13T13  = p 0 w 1 =1 w 2 =2 w 3 =2 Period of a task T i : p i = w i p 0, where w i = 2 j

Copyright, 2001 © Adam Czajka Flexible loading T13T13T13T13 T12T12T12T12 T11T11T11T11   T14T14T14T14 Timeframe T21T21T21T21 T31T31T31T31  = p 0 w 1 =1 w 2 =2 w 3 =2 Period of a task T i : p i = w i p 0, where w i = 2 j

Copyright, 2001 © Adam Czajka Flexible loading T13T13T13T13 T12T12T12T12 T11T11T11T11   T14T14T14T14 Timeframe T21T21T21T21 T31T31T31T31  = p 0 w 1 =1 w 2 =2 w 3 =2 Period of a task T i : p i = w i p 0, where w i = 2 j

Copyright, 2001 © Adam Czajka Flexible loading T13T13T13T13 T12T12T12T12 T11T11T11T11   T14T14T14T14 Timeframe T21T21T21T21 T31T31T31T31  = p 0 w 1 =1 w 2 =2 w 3 =2 Period of a task T i : p i = w i p 0, where w i = 2 j

Copyright, 2001 © Adam Czajka Flexible loading problem Set of non-preemptable tasks {T i } Set of non-preemptable tasks {T i } Each task is characterized by period p i and execution time  i Each task is characterized by period p i and execution time  i For each task d i = p i For each task d i = p i There is no precedence constraints There is no precedence constraints Given : Given :

Copyright, 2001 © Adam Czajka Flexible loading problem Question : Question : Can every task T i be scheduled within its period p i, i.e. : Every instance of T i starts within its period Every instance of T i finishes before the next period of T i Tasks do not overlap

Copyright, 2001 © Adam Czajka Complexity The flexible loading problem is strongly NP-hard [Inform. Proc. Letters 65, 1998, ] A heuristic strategy VG algorithm VG algorithm

Copyright, 2001 © Adam Czajka VG heuristic Task PeriodExec. Time T 1 p 0 1 T 1 p 0 1 T 2 2p 0 2 T 3 4p 0 2 T 4 4p 0 5 p 0 = 4  = p 0 

Copyright, 2001 © Adam Czajka VG heuristic Task PeriodExec. Time T 1 p 0 1 T 1 p 0 1 T 2 2p 0 2 T 3 4p 0 2 T 4 4p 0 5 p 0 = 4  = p 0 

Copyright, 2001 © Adam Czajka VG heuristic Task PeriodExec. Time T 1 p 0 1 T 1 p 0 1 T 2 2p 0 2 T 4 4p 0 5 T 3 4p 0 2 p 0 = 4  = p 0 

Copyright, 2001 © Adam Czajka VG heuristic Task PeriodExec. Time T 1 p 0 1 T 1 p 0 1 T 2 2p 0 2 T 4 4p 0 5 T 3 4p 0 2 p 0 = 4  = p 0 

Copyright, 2001 © Adam Czajka VG heuristic Task PeriodExec. Time T 1 p 0 1 T 1 p 0 1 T 2 2p 0 2 T 4 4p 0 5 T 3 4p 0 2 p 0 = 4  = p 0 

Copyright, 2001 © Adam Czajka VG heuristic Task PeriodExec. Time T 1 p 0 1 T 1 p 0 1 T 2 2p 0 2 T 4 4p 0 5 T 3 4p 0 2 p 0 = 4  = p 0 

Copyright, 2001 © Adam Czajka VG heuristic Task PeriodExec. Time T 1 p 0 1 T 1 p 0 1 T 2 2p 0 2 T 4 4p 0 5 T 3 4p 0 2 p 0 = 4  = p 0 

Copyright, 2001 © Adam Czajka VG heuristic Task PeriodExec. Time T 1 p 0 1 T 1 p 0 1 T 2 2p 0 2 T 4 4p 0 5 T 3 4p 0 2 p 0 = 4  = p 0 

Copyright, 2001 © Adam Czajka VG heuristic Task PeriodExec. Time T 1 p 0 1 T 1 p 0 1 T 2 2p 0 2 T 4 4p 0 5 T 3 4p 0 2 p 0 = 4  = p 0 

Copyright, 2001 © Adam Czajka VG heuristic Task PeriodExec. Time T 1 p 0 1 T 1 p 0 1 T 2 2p 0 2 T 4 4p 0 5 T 3 4p 0 2 p 0 = 4  = p 0 

Copyright, 2001 © Adam Czajka VG heuristic Task PeriodExec. Time T 1 p 0 1 T 1 p 0 1 T 2 2p 0 2 T 4 4p 0 5 T 3 4p 0 2 p 0 = 4  = p 0 

Copyright, 2001 © Adam Czajka VG heuristic Task PeriodExec. Time T 1 p 0 1 T 1 p 0 1 T 2 2p 0 2 T 4 4p 0 5 T 3 4p 0 2 p 0 = 4  = p 0 

Copyright, 2001 © Adam Czajka VG heuristic Task PeriodExec. Time T 1 p 0 1 T 1 p 0 1 T 2 2p 0 2 T 4 4p 0 5 T 3 4p 0 2 p 0 = 4  = p 0 

Copyright, 2001 © Adam Czajka VG heuristic Task PeriodExec. Time T 1 p 0 1 T 1 p 0 1 T 2 2p 0 2 T 4 4p 0 5 T 3 4p 0 2 p 0 = 4  = p 0 

Copyright, 2001 © Adam Czajka VG heuristic Task PeriodExec. Time T 1 p 0 1 T 1 p 0 1 T 2 2p 0 2 T 4 4p 0 5 T 3 4p 0 2 p 0 = 4  = p 0 

Copyright, 2001 © Adam Czajka Conclusions Binarization allow us to radically decrease the size of the time-table array Problem of scheduling tasks with binary periods is strongly NP-hard There exists some efficient heuristics which can be used to build the feasible schedule