1 / 21

Optimal Algorithms for Task Scheduling

Optimal Algorithms for Task Scheduling. Implemented by Ala Al-Nawaiseh Khaled Mahmud. Outline. Introduction. Algorithms. In-Forest/Out-Forest by Hu Interval Order by Papadimitriou & Yannakakis Two Processor by Coffman & Graham. Program Design. Results. Introduction. Scheduling

pete
Download Presentation

Optimal Algorithms for Task Scheduling

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

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

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

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

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

  7. 14 1 12 1 13 1 11 1 10 1 9 1 8 1 7 1 6 1 5 1 3 1 2 1 4 1 1 1 Scheduling In-Forests/Out-Forests Task Graphs

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

  9. 4 1 3 1 5 1 1 1 2 1 6 1 Scheduling Interval-Ordered Tasks

  10. Scheduling DAGs without Considering Communication • Two processor Scheduling • Introduced by Coffman & Graham. • Assign 1 to one of the terminal tasks. • 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 • Use L(v) as the priority of task v and ties are broken arbitrary. • Whenever a processor becomes available, assign it the unexecuted ready task with the highest priority. Ties are broken arbitrarily.

  12. 2 1 1 1 3 1 6 1 8 1 4 1 5 1 7 1 • 1 1 1 1 • 1 1 Scheduling Trees on Two processors

  13. Program Design • 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.

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

  15. a b c d e f g h i j k l m Results • In-Forest Scheduling on four processors using Hu algorithm

  16. a b c d e f g h i j k l m Results • Out-Forest Scheduling on four processors using Hu algorithm

  17. Interval Order using Papadimitriou s algorithm Results

  18. a b c d e f g h i j k Results DAG using Coffman Algorithm

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

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

  21. Thank You

More Related