Presentation is loading. Please wait.

Presentation is loading. Please wait.

Optimal Algorithms for Task Scheduling Implemented by Ala Al-Nawaiseh Khaled Mahmud.

Similar presentations


Presentation on theme: "Optimal Algorithms for Task Scheduling Implemented by Ala Al-Nawaiseh Khaled Mahmud."— Presentation transcript:

1 Optimal Algorithms for Task Scheduling Implemented by Ala Al-Nawaiseh Khaled Mahmud

2 Outline Introduction. Introduction. Algorithms. Algorithms. In-Forest/Out-Forest by Hu In-Forest/Out-Forest by Hu Interval Order by Papadimitriou & Yannakakis Interval Order by Papadimitriou & Yannakakis Two Processor by Coffman & Graham. Two Processor by Coffman & Graham. Program Design. Program Design. Results Results

3 Introduction Scheduling Scheduling Set of resources (Processors) and set of consumers (Tasks) Set of resources (Processors) and set of consumers (Tasks) Gantt Chart. Gantt Chart.

4 Introduction Tasks are represented using Graph, hence the concept Task Graph is used. Tasks are represented using Graph, hence the concept Task Graph is used. Graph G=(T,E), Graph G=(T,E), Where T=Task, and E= Directed edges. Where T=Task, and E= Directed edges. The Graph should be a DAG The Graph should be a DAG D: Directed D: Directed A: Acyclic A: Acyclic G: Graph G: Graph

5 Allowed DAG Types In-Forest : for the Hu and Coffman algorithms In-Forest : for the Hu and Coffman algorithms Out-Forest: for the Hu and Coffman algorithms Out-Forest: for the Hu and Coffman algorithms Interval Order: for Papadimitriou and Coffman algorithms Interval Order: for Papadimitriou and Coffman algorithms

6 Scheduling DAGs without Considering Communication Scheduling In-Forests/Out-Forests Task Graphs. Scheduling In-Forests/Out-Forests Task Graphs. Introduced by Hu. Introduced by Hu. Algorithm 1 Algorithm 1 In-Forest Level=Longest path from a node to a Terminal node. In-Forest Level=Longest path from a node to a Terminal node. Out_Forest Level= Longest path from a node to a start node. Out_Forest Level= Longest path from a node to a start node. Assign the highest ready task to any available processor. Assign the highest ready task to any available processor.

7 Scheduling In-Forests/Out-Forests Task Graphs P1P2P3 141311 12109 875 642 3 1 141 121 131 1111019181 716151 312141 11 Task Level 5 4 3 2 1

8 Scheduling DAGs without Considering Communication Scheduling Interval Ordered Tasks Scheduling Interval Ordered Tasks Introduced by Papadimitriou & Yannakakis. Introduced by Papadimitriou & Yannakakis. Algorithm 2 Algorithm 2 Level=The number of all successors. Level=The number of all successors. Assign the highest ready task to any available processor. Assign the highest ready task to any available processor.

9 Scheduling Interval-Ordered Tasks P1P2P3 653 42 1 413151 11 21 61

10 Scheduling DAGs without Considering Communication Two processor Scheduling Two processor Scheduling Introduced by Coffman & Graham. Introduced by Coffman & Graham. 1. Assign 1 to one of the terminal tasks. 2. Let labels 1,2,...,j-1 have been assigned. Let S be the set of unassigned tasks with no unlabeled successors. We next select an element of S to be assigned label j. For each node x in S define l(x) as follows: Let y1, y2,...,yk be the immediate successors of x. Then l(x) is the decreasing sequence of integers formed by ordering the set {L(y1), L(y2),..., L(yk)}. Let x be an element of S such that for all x' in S, l(x) ≤ l(x') (lexicographically). Define L(x) to be j.

11 Scheduling DAGs without Considering Communication 3. Use L(v) as the priority of task v and ties are broken arbitrary. 4. Whenever a processor becomes available, assign it the unexecuted ready task with the highest priority. Ties are broken arbitrarily.

12 Scheduling Trees on Two processors 211131 61 81 4151 71 1 1 1 1 1 1 1 P1P2 12 34 65 7 8

13 Program Design We represented the DAG Graphs using Adjacency Matrix. We represented the DAG Graphs using Adjacency Matrix. A representation of a directed graph with n vertices using an n × n matrix, where the entry at (i,j) is 1 if there is an edge from vertex i to vertex j; otherwise the entry is 0. A representation of a directed graph with n vertices using an n × n matrix, where the entry at (i,j) is 1 if there is an edge from vertex i to vertex j; otherwise the entry is 0.directed graphverticesmatrixedgedirected graphverticesmatrixedge

14 Program Flow Chart Read Input File Build Node Informationm No Error MEssage Main Alg = "Hu" || Alg ="IntervalOrder" || Alg="Coffman" End Alg = ? Hu Interval Order Coffman Graph =In/Out forest Graph =Interval Order Graph =DAG Error MEssage No Assign Level Sort By Level Schedu It Output Assign Level Sort By Level Schedu It Output Assign Level Sort By Level Schedu It Output End

15 Results abc def hij kl m g 4 Processors P4P3P2P1 ecba hgfd lji k m In-Forest Scheduling on four processors using Hu algorithm In-Forest Scheduling on four processors using Hu algorithm

16 Results Out-Forest Scheduling on four processors using Hu algorithm Out-Forest Scheduling on four processors using Hu algorithm abc def hij kl m g 4 Processors P4P3P2P1 m lk jih gfed cba

17 Interval Order using Papadimitriou s algorithm Results

18 Results ab cd efg hi jk 2 Processors P2P1 ba dc ef hg ji k DAG using Coffman Algorithm

19 Sample input file and output Input File ====== 11 14 11 14 a b c d e f g h i j k 0 2 0 2 1 3 1 3 2 4 2 4 2 5 2 5 3 5 3 5 3 6 3 6 4 7 4 7 4 9 4 9 5 7 5 7 5 8 5 8 6 8 6 8 7 9 7 9 7 10 7 10 8 10 8 10

20 Reference Advanced Computer Architecture and Parallel Processing Advanced Computer Architecture and Parallel Processing By By Hesham El-Rewini Hesham El-Rewini Mostafa Abd-El-Bar Mostafa Abd-El-Bar

21 Thank You


Download ppt "Optimal Algorithms for Task Scheduling Implemented by Ala Al-Nawaiseh Khaled Mahmud."

Similar presentations


Ads by Google