Genetic algorithms for task scheduling problem

libyantawdryΤεχνίτη Νοημοσύνη και Ρομποτική

23 Οκτ 2013 (πριν από 4 χρόνια και 2 μήνες)

93 εμφανίσεις

Genetic algorithms for


task scheduling problem

J. Parallel Distrib. Comput. (2010)

Fatma A. Omara, Mona M. Arafa

2013/10/24

1

Shang
-
Chi Wu

Outline


Introduction


The Standard Genetic Algorithm (SGA)


The Critical Path Genetic Algorithm
(CPGA)


The Task Duplication Genetic Algorithm
(TDGA)


Performance evaluation


Conclusions

2013/10/24

2

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

2013/10/24

3

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)



2013/10/24

4

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


2013/10/24

5

The model for

task scheduling problem


2013/10/24

6


Directed Acyclic Graph (
DAG)

Entry node

Exit node

Communication cost

Computation cost

Critical Path(CP)

The model for

task scheduling problem


2013/10/24

7


Communication cost


Ex : c ( t
1
, t
5

) = 1


Ex : c ( t
1
, t
5

) = 0 if t
1

and t
5

are scheduled
on the same processor


A node t
i

is scheduled to processor P


start time : ST(t
i

, P)


finish time : FT(t
i

, P

)


Schedule length


max{FT(t
i

, P

)} across all processors


Communication cost

The Standard Genetic Algorithm
(SGA)

2013/10/24

8


The parent task that maximizes the
above expression is called the
favorite
predecessors

of t
i



favpred(t
i,

P
j
)


The Data Arrival Time (DAT) of t
i

at
processor P
x

is defined as :



DAT = max { FT(t
k,

P
j
) + c(t
k,
t
i
) } ,


k=1…No_parent


Example

The Standard Genetic Algorithm
(SGA)

2013/10/24

9


DAT = max { FT(t
k,

P
j
) + c(t
i,
t
k
) }



,k=1…No_parent


The SGA implementation

2013/10/24

10


The chromosome is divided into two
sections


mapping sections


scheduling sections


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

2013/10/24

11


Fitness function


The main objective of the scheduling
problem is to minimize the schedule length
of a schedule

Genetic formulation of SGA

2013/10/24

12

Fitness function = ( a / S_Length )

The pseudo code of

The Task Schedule using SGA

2013/10/24

13

The pseudo code of

The Task Schedule using SGA

2013/10/24

14

DAG

chromosome

3 processors

Genetic formulation of SGA

2013/10/24

15

RT[P
1
] =0

RT[P
2
] =0

RT[P
3
] =0

LT={t
1,
t
2,
t
3,
t
4,
t
6,
t
5,
t
7,
t
8,
t
9
}

Genetic formulation of SGA

2013/10/24

16

LT={t
1,
t
2,
t
3,
t
4,
t
6,
t
5,
t
7,
t
8,
t
9
}

16

ST[t
1
] = 0

FT[t
1
] = 0+2 =2

RT[P
3
] = 2

Genetic formulation of SGA

2013/10/24

LT={

t
2,
t
3,
t
4,
t
6,
t
5,
t
7,
t
8,
t
9
}

ST[t
2
] = 2

FT[t
2
] = 2+3 =5

RT[P
3
] = 5

Genetic formulation of SGA

2013/10/24

18

S_Length = 26

Crossover operator

2013/10/24

19

Crossover operator

2013/10/24

20


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

2013/10/24

21


The chromosome is divided into two
sections


mapping sections


scheduling sections

Crossover map

2013/10/24

22


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

2013/10/24

23

Order crossover

2013/10/24

24

Pass the left segment

Mutation operator

2013/10/24

25


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)

2013/10/24

26

ALAP(As Late as Possible)

2013/10/24

27

node

n1

n2

n3

n4

n5

n6

n7

n8

n9

ALAP

0

8

9

8

18

13

12

13

22


Example

Reuse idle time modification

2013/10/24

28

Priority of CPNs modification

2013/10/24

29

Load balance modification

2013/10/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[P
j
]











Example

Load balance modification

2013/10/24

31

2013/10/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



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)

2013/10/24

33


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

Genetic formulation of the TDGA

2013/10/24

34


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

2013/10/24

35

Computing a b
-
level

2013/10/24

36

The pseudo code of

the Duplication_Process function

2013/10/24

37


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

2013/10/24

38

Mutation operator

2013/10/24

39

Performance evaluation

2013/10/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


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

2013/10/24

41


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

2013/10/24

42

2013/10/24

43

The developed CPGA evaluation

The developed CPGA evaluation

2013/10/24

44

The DSH Algorithm

2013/10/24

45

The DSH Algorithm

2013/10/24

46

The developed TDGA evaluation

2013/10/24

47

The developed TDGA evaluation

2013/10/24

48


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

2013/10/24

49


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

2013/10/24

50





Thank you for your listening


2013/10/24

51