J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

51
Genetic algorithms for task scheduling problem J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa 111/06/19 1 Shang-Chi Wu

description

Genetic algorithms for task scheduling problem. J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa. Shang-Chi Wu. Outline. Introduction The Standard Genetic Algorithm (SGA) The Critical Path Genetic Algorithm (CPGA) The Task Duplication Genetic Algorithm (TDGA) - PowerPoint PPT Presentation

Transcript of J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Page 1: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Genetic algorithms for task scheduling problem

J. Parallel Distrib. Comput. (2010)Fatma A. Omara, Mona M. Arafa

112/04/24 1

Shang-Chi Wu

Page 2: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Outline

• Introduction• The Standard Genetic Algorithm (SGA)• The Critical Path Genetic Algorithm

(CPGA)• The Task Duplication Genetic Algorithm

(TDGA)• Performance evaluation• Conclusions112/04/24 2

Page 3: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Introduction

• The goal of a task scheduler– Assign tasks to available processors – The overall execution length is minimized

• Algorithms with duplication– Duplication Scheduling Heuristic (DSH)

algorithm• Algorithms without duplication

– Modified Critical Path (MCP) algorithm

112/04/24 3

Page 4: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Introduction

• Recently, several GAs have been developed for solving the task scheduling problem

• Two genetic algorithms– Critical Path Genetic Algorithm (CPGA)– Task Duplication Genetic Algorithm (TDGA)

112/04/24 4

Page 5: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Introduction

• Critical Path Genetic Algorithm(CPGA)– use the idle time of the processors efficiently– reschedule the critical path nodes to reduce

their start time– concerned with satisfying the load balance

• Task Duplication Genetic Algorithm (TDGA)– Minimize the communication overheads

112/04/24 5

Page 6: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

The model for task scheduling problem

112/04/24 6

• Directed Acyclic Graph (DAG)Entry node

Exit node

Communication cost

Computation cost

Critical Path(CP)

Page 7: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

The model for task scheduling problem

112/04/24 7

• Communication cost– Ex : c ( t1, t5 ) = 1– Ex : c ( t1, t5 ) = 0 if t1 and t5 are scheduled

on the same processor• A node ti is scheduled to processor P

– start time : ST(ti , P)– finish time : FT(ti , P )

• Schedule length – max{FT(ti , P )} across all processors

Communication cost

Page 8: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

The Standard Genetic Algorithm (SGA)

112/04/24 8

• The parent task that maximizes the above expression is called the favorite predecessors of ti – favpred(ti, Pj)

• The Data Arrival Time (DAT) of ti at processor Px is defined as :

DAT = max { FT(tk, Pj) + c(tk, ti) } , k=1…No_parent

Page 9: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

• Example

The Standard Genetic Algorithm (SGA)

112/04/24 9

DAT = max { FT(tk, Pj) + c(ti, tk) } ,k=1…No_parent

Page 10: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

The SGA implementation

112/04/24 10

• The chromosome is divided into two sections– mapping sections– scheduling sections

Page 11: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

• The initial population is constructed randomly.– The first part of the chromosome (i.e.

mapping) is chosen randomly from 1 to No_Processor

– The second part (i.e. the schedule) is generated randomly

Genetic formulation of SGA

112/04/24 11

Page 12: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

• Fitness function– The main objective of the scheduling

problem is to minimize the schedule length of a schedule

Genetic formulation of SGA

112/04/24 12

Fitness function = ( a / S_Length )

Page 13: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

The pseudo code of The Task Schedule using SGA

112/04/24 13

Page 14: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

The pseudo code of The Task Schedule using SGA

112/04/24 14

DAGchromosome

3 processors

Page 15: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Genetic formulation of SGA

112/04/24 15

RT[P1] =0RT[P2] =0RT[P3] =0

LT={t1, t2, t3, t4, t6, t5, t7, t8, t9 }

Page 16: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Genetic formulation of SGA

112/04/24 16

LT={t1, t2, t3, t4, t6, t5, t7, t8, t9 }

16

ST[t1] = 0FT[t1] = 0+2 =2RT[P3] = 2

Page 17: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Genetic formulation of SGA

112/04/24

LT={ t2, t3, t4, t6, t5, t7, t8, t9 }

ST[t2] = 2FT[t2] = 2+3 =5RT[P3] = 5

Page 18: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Genetic formulation of SGA

112/04/24 18

S_Length = 26

Page 19: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Crossover operator

112/04/24 19

Page 20: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Crossover operator

112/04/24 20

Page 21: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

• It is applied to the first part of the chromosome mapping sections

• A random integer number called the crossover point is generated from 1 to No_Tasks

Crossover map

112/04/24 21

Page 22: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

• The chromosome is divided into two sections– mapping sections– scheduling sections

Crossover map

112/04/24 22

Page 23: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

• It is applied to the second part of the chromosome– a random point is chosen– Pass the left segment from the chrom1 to

the offspring– Construct the right fragment of the offspring

according to the order of the right segment of chrom2

Order crossover

112/04/24 23

Page 24: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Order crossover

112/04/24 24

Pass the left segment

Page 25: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Mutation operator

112/04/24 25

Page 26: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

• The same principles and operators which are used in the SGA algorithm have been used in the CPGA algorithm

• In the initial population the second part(schedule) of the chromosome can be constructed– The schedule part is constructed randomly as

in SGA– The schedule part is constructed using ALAP

The Critical Path Genetic Algorithm (CPGA)

112/04/24 26

Page 27: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

ALAP(As Late as Possible)

112/04/24 27

node n1 n2 n3 n4 n5 n6 n7 n8 n9ALAP 0 8 9 8 18 13 12 13 22

Page 28: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

• Example

Reuse idle time modification

112/04/24 28

Page 29: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Priority of CPNs modification

112/04/24 29

Page 30: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Load balance modification

112/04/24 30

• Obtain the minimum schedule length and, in the same time, the load balance is satisfied

• The execution time of processor Pj is denoted by E_time[Pj] – –

Page 31: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

• Example

Load balance modification

112/04/24 31

Page 32: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

112/04/24 32

maximum fitness value

the average fitness value

the fitness value of the best chromosome for the crossover

the fitness value of the chromosome to be mutated

positive real constants less than 1

Page 33: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

• If the idle time slots of a waiting processor could be effectively used by identifying some tasks and redundantly allocating them in these slots, the execution time of the parallel program could be further reduced

The Task Duplication Genetic Algorithm (TDGA)

112/04/24 33

Page 34: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

• A vector of order pairs (t, p) which indicates that task t is assigned to processor p

Genetic formulation of the TDGA

112/04/24 34

Page 35: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

• Heuristic Duplication– the initial population is initialized with

randomly generated chromosomes, while each chromosome consists of exactly one copy of each task

– After that, a duplication technique is applied by a function

Initial population

112/04/24 35

Page 36: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Computing a b-level

112/04/24 36

Page 37: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

The pseudo code of the Duplication_Process function

112/04/24 37

Page 38: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

• Two point crossover operator is used• Two points are randomly chosen and

the partitions between the points are exchanged between two chromosomes to form two offspring

Crossover operator

112/04/24 38

Page 39: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Mutation operator

112/04/24 39

Page 40: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Performance evaluation

112/04/24 40

• Considered the task graphs with random communication costs between 1 and a specified maximum communication delay (MCD)

• The population size is considered to be 200, and the number of generations is considered to be 500 generations

Page 41: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

• Normalized Schedule Length (NSL)

• Speedup– T(1) : the time required for executing a

program on a uniprocessor computer– T(P) : the time required for executing the

same program on a parallel computer with P processors

The developed CPGA evaluation

112/04/24 41

Page 42: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

• The MCP algorithm computes at first the ALAPs of all the nodes, then creates a ready list containing ALAP times of the nodes in an ascending

• highest priority node in the list is picked up and assigned to a processor

The MCP algorithm

112/04/24 42

Page 43: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

112/04/24 43

The developed CPGA evaluation

Page 44: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

The developed CPGA evaluation

112/04/24 44

Page 45: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

The DSH Algorithm

112/04/24 45

Page 46: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

The DSH Algorithm

112/04/24 46

Page 47: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

The developed TDGA evaluation

112/04/24 47

Page 48: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

The developed TDGA evaluation

112/04/24 48

Page 49: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

• The Critical Path Genetic algorithm(CPGA)– Based on rescheduling the critical path nodes

(CPNs) in the chromosome through different generations

– two modifications have been added• use the idle time of the processors efficiently• concerned with satisfying the load balance

– The experimental studies show that the CPGA always outperforms the MCP algorithm in most cases

Conclusions

112/04/24 49

Page 50: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

• The Task Duplication Genetic Algorithm (TDGA)– Based on task duplication techniques to

overcome the communication overhead – The experimental studies show that the TDGA

algorithm outperforms the DSH algorithm in most cases

Conclusions

112/04/24 50

Page 51: J. Parallel Distrib. Comput. (2010) Fatma A. Omara, Mona M. Arafa

Thank you for your listening 

112/04/24 51