05460728

download 05460728

of 5

Transcript of 05460728

  • 7/28/2019 05460728

    1/5

    Task Scheduling in Multiprocessor System Using Genetic Algorithm

    Sachi Gupta, Gaurav Agarwal

    Computer Science and Information Technology Deptt.

    Krishna Institute of Management and Technology

    Moradabad, India

    [email protected],

    [email protected]

    Vikas Kumar

    Computer Science Deptt.

    Moradabad Institute of Technology

    Moradabad, India

    [email protected]

    AbstractThe general problem of multiprocessor schedulingcan be stated as scheduling a task graph onto a multiprocessor

    system so that schedule length can be optimized. Task

    scheduling in multiprocessor system is a NP-complete problem.

    In literature, several heuristic methods have been developed

    that obtain suboptimal solutions in less than the polynomial

    time. Recently, Genetic algorithms have received much

    awareness as they are robust and guarantee for a good

    solution. In this paper, we have developed a genetic algorithm

    based on the principles of evolution found in nature for findingan optimal solution. Genetic algorithm is based on three

    operators: Natural Selection, Crossover and Mutation. To

    compare the performance of our algorithm, we have also

    implemented another scheduling algorithm HEFT which is a

    heuristic algorithm. Simulation results comprises of three

    parts: Quality of solutions, robustness of genetic algorithm,

    and effect of mutation probability on performance of genetic

    algorithm.

    Keywords- Genetic Algorithm; Fitness Function; Multi-processor System; NP-Complete etc.

    I. INTRODUCTIONTask scheduling in multiprocessor systems also known asmultiprocessor scheduling has been a source of challenging

    problems for researchers in the area of computerengineering. The general problem of multiprocessorscheduling can be stated as scheduling a set of partiallyordered computational tasks onto a multiprocessor system sothat a set of performance criteria will be optimized.

    Unfortunately, Task scheduling in multi processor systemis NP-complete [10]. Here we only considered static taskscheduling algorithms [4]. These algorithms can be broadlyclassified into two main groups: heuristic based [5] andguided random search based algorithm [5]. Heuristic basedalgorithm searches a path in the solution space based on theheuristic used while ignoring other possible paths. Due to

    this reason, they give good results for some inputs while badfor others. List scheduling algorithms [5], clustering [5] andduplication based algorithms [2] fall under this category.Guided random search techniques use random choices toguide them selves through the problem space. Geneticalgorithms [1, 3 and 8] are the most popular random searchtechniques for different kind of task scheduling problems.

    In general genetic algorithm, works on three operatorsnatural selection, crossover and mutation [3, 6]. A geneticalgorithm continuously tries to improve the average fitnessof a population by construction of new populations. Quality

    of solution depends heavily on the selection of some keyparameters like fitness function, population size, crossoverprobability and mutation probability.

    In this paper, we first introduce task scheduling problemhaving some specified characteristics, after that geneticapproach is discussed in detail and the last section presentsexperiments and results.

    II. MULTIPROCESSORSCHEDULINGMany parallel applications consist of multiple functional

    units. While the execution of some of the tasks depends onthe output of the other tasks, others can be executedindependently at the same time, which increases parallelismof the problem. The task scheduling problem is the problemof assigning the tasks in the multiprocessor system in amanner that will optimize the overall performance of theapplication, while guarantee the correctness of the result.Multiprocessor scheduling problems can be classified intomany different categories based on characteristics of theprogram and tasks to be scheduled, the multiprocessorsystem, and the availability of information Multiprocessorscheduling problems may be divided in two categories:Static and dynamic task scheduling. A static or deterministic

    task scheduling is one in which precedence constraints andthe relationships among the task are known well in advancewhile non-deterministic or dynamic scheduling is one inwhich these information is not known in advance or notknown till run time.

    III. PROBLEMDESCRIPTIONA static scheduling problem consists of three main

    components: A multiprocessor system, an application and anobjective for scheduling.

    The multiprocessor system consists of a limited numberof fully connected processors (P1, P2... Pm).All theprocessors are heterogeneous meaning thereby a task maytake different execution time on each processor. Anapplication comprises tasks and their dependencies on eachother. It can be represented as a directed acyclic graph(DAG) [7, 9], G= (V, E, W), where the vertices set Vconsists of v non preemptive tasks, and vi denotes the i

    th task.The edge set E represents the precedence relationshipsamong tasks. A directed edge eij in E indicated that vj can notbegin its execution before receiving data from vi. W is amatrix of vxm, and wij in W represents the estimatedexecution time of vi on j

    th processor. Here we assume thatcommunication costs do not exist.

    2010 Second International Conference on Machine Learning and Computing

    978-0-7695-3977-5/10 $26.00 2010 IEEE

    DOI 10.1109/ICMLC.2010.50

    267

  • 7/28/2019 05460728

    2/5

    The main objective of the task scheduling is to determinethe assignment of tasks of a given application to a givenparallel system such that the execution time (or schedulelength) of this application is minimized satisfying allprecedence constraints.

    IV. GENETIC APPROACHGenetic Algorithms or evolutionary algorithms are

    developed by John Holland in 60s. They are random searchbased algorithm premised on the evolutionary ideas ofnatural selection and genetic. The basic concept of GA isdesigned to simulate processes in natural system necessaryfor evolution. They use three operators known as naturalselection, crossover and mutation.

    Natural Selection [3] process forms a new population ofstrings by selecting strings in the old population based ontheir fitness values. Crossover [3] produces newchromosomes that have some parts of both parent's geneticmaterial. Mutation [3] is a genetic operator that alters one oremore gene values in a chromosome from its initial state toproduce new chromosomes.

    A. Genetic Algorthtm StructrureTypically, a genetic algorithm consists of the followingsteps:

    x GA1: Initialization initialize the population.x GA2: Evaluation evaluate each chromosome using

    fitness function.

    x GA3: Genetic operations Select the parent andapply genetic operators on them to produce newchromosomes.

    x GA4: Repeat steps GA2 and GA3 until terminationcondition reached.

    From the above steps, we can see that genetic algorithmsutilize the concept of survival of the fittest; passing good

    chromosomes to the next generation, and combiningdifferent strings to explore new search points.

    B. Initial population (Structure of the chromosome)Designing of chromosome structure is crucial for

    devising GA. We define our chromosome structure as acombination of two strings SQ and SP, whose length equal tothe number of tasks. SQ (scheduling queue) maintainsprecedence constraints between tasks, and an entry in SQrepresents a task to be scheduled. An entry in SP (schedulingprocessor) represents the processor the corresponding task isscheduled onto.

    The details to generate a chromosome can be seen infollowing steps:

    x IP1: Select randomly a task from the entire entrytasks. Set this task as the first task in SQ.

    x IP2: Repeat step IP3 for (v-1) times.x IP3: Randomly select a task who is not in SQ and

    whose predecessors all have been in SQ, and addthis task to SQ.

    x IP4: For SP part, randomly generate an integernumber between 1 and m for each task in SQ andadd it to SP.

    C. Evaluation and Selection: Roulette Wheel MechanismIn order to select good chromosomes, we define the

    fitness function as:

    F (i) = (maxFT-FT (i) +1/ (maxFT-minFT+1) (1)

    Where: maxFT and minFT is the maximum and

    minimum finishing time of chromosomes in currentgeneration, respectively. FT (i) is the finishing time of the i thchromosome.

    Once the fitness values of all the chromosomes have beenevaluated, we can select the higher fitness valuechromosomes using the roulette wheel mechanism.

    D. Reproduction: Crossover and MutationCrossoverAs our chromosome comprises two separate parts SP and

    SQ having different characteristics, for each part we employdifferent crossover policies. We randomly select one or thesecond part and apply two different crossover operators forthese two parts.

    Details about crossover are given in following steps:x CR1: Input the Crossover probability Pc.x CR2: Randomly select pairs of chromosomes and

    generate a float number (FLC) between 0 and 1 foreach pair.

    x CR3: If FLC

  • 7/28/2019 05460728

    3/5

    V. EXPERIMENTS AND RESULTSIn our work, we implemented two algorithms for solution

    of multiprocessor task scheduling problem. One is based onlist scheduling heuristic HEFT (Heterogeneous EarliestFinish Time) [5] and other is our proposed GeneticAlgorithm. For performance evaluation of our algorithm wegenerated some problems of varying sizes and solved themby both the algorithms. We assume that size of problemranges from 25 to 65 with an interval of 5, there is no limiton the number of successors of each task except the exit taskwhich does not have any successor, the execution time foreach task is a random number between 5 and 25 and numberof processors varies from 4 to 8 according to the size ofproblems. As we did not put any restriction over the numberof successor a task may have, task graph may be muchcomplicated. So, the problems we have chosen may beconsidered difficult in comparison to the kind of problemswe normally see in literature, where a restriction onmaximum number of successor tasks has been put.

    A. Results of HEFTWe run HEFT procedure on ten different problems with

    Problem Identification Numbers (PIN) 0 to 9 for eachproblem size to note the length of the schedules obtained (seeTable I). We then computed average schedule length foreach problem size for comparison with corresponding resultsobtained from GA.

    B. Results of GAThe proposed genetic algorithm discussed in previous

    sections was implemented and evaluated on the same set ofproblems we used to evaluate HEFT. Results obtained areshown in Table II. We set parameters for our GeneticAlgorithm as: Population Size=25, Maximum Generations=5000, Crossover Probability= .6 and Mutation Probability

    =.2.

    C. Comparison of HEFT and GAResults obtained from our experiments are analyzed for

    following factors:

    1) Quality of solution: Comparison of average schedulelength of the GA and HEFT is given in Table III and in Fig.

    1. Results demonstrate that our proposed Genetic Algorithm

    is able to compete with heuristic based algorithms as far as

    quality of solution is concerned. As heuristics are biased

    towards certain characteristics of solution so they tend to

    search solution only in a small part of whole search space. It

    is also possible that they never explore a particular region of

    search space. Thus for some problems heuristics may givebad results also if they are not chosen carefully. On the

    other hand GA is a more powerful method as it searches

    simultaneously in many parts of search space. Because of

    mutation operator, change in region being searched, gives

    potential to GA to search in any part of the search space.

    Thus it is more likely to find a better or best solution.2) Rohbustness and gurantee for good solution: Duringour experiments on GA we noted Average schedule lengths

    Figure 1. HEFT Vs GA

    Figure 2. Problem Size vs Avg. Schedule Length for Problem Size 45

    of populations emerging generations after generation (seeFig. 2).Though we have shown results only for problem size45 in Fig. 2, for each problem irrespective of its size weobserve that average schedule length is continuouslydecreasing as more and more generations are evolving. Thisshows that Genetic Algorithm is robust and ultimately itwill give us a good quality solution as quality of solution setis continuously improved. It also reveals that moregenerations we evolve; it is likely to have better quality insolution.

    3) Effect of mutation probability on the performance ofGA: As mutation is the key to change the region of search

    space, mutation probability may have dominating role infinding solutions of good quality. Thus, we repeated ourexperiments by fixing crossover probability and changingmutation probabilities from 0.05 to .40 and noted averageschedule lengths. We done our experiments on the problemhaving size 65. we can observe the similar trend in theproblems of all sizes. Fig. 3 shows the further average ofresults, mixing the effect of all crossover probabilities whichclearly shows that up till mutation probability is .20,increase in mutation probability leading to better results.After .20 results are fluctuating in a small range butnormally are not better than that we obtained for .20. So, wehave found best mutation probability for our set of problemsas .20.So, we have found best mutation probability for our

    set of problems as .20.During the experiments, we have seen that for 28.8%

    problems GA gives lower schedule length, for 4.44%problems GA gives slightly higher schedule length while for66.67% problems GA gives equal schedule length incomparison with HEFT. On an average, we analyzed thatGA gives better results than the heuristic based algorithmand it is robust also as the average schedule length is

    HEFT vs GA

    133.8

    162.7

    170

    186.1

    204.8

    216.2

    231.2

    252.3

    269.4

    133.6

    162.2

    169.8

    184.9

    204.1

    231.1

    252.2

    268.7

    216.1

    0 50 100 150 200 250 300

    25

    30

    35

    40

    45

    50

    55

    60

    65

    Problemsize

    Avg. Schedule LengthHEFT results GA results

    Generations vs Avg. schedule length for

    problem size 45

    0

    100

    200

    300

    400

    500

    0 19 71 237 3 87 5 64 1537

    Generation

    Avg.schedulelength

    Problem no. 1

    269

  • 7/28/2019 05460728

    4/5

    continuously decreases as more and more generationsevolve.

    Figure 3. Effect of Mutation Probability on Avg. Schedule Length

    ACKNOWLEDGMENT

    We would like to thank the anonymous referees for theirhelpful comments and suggestions that have improved thequality of this manuscript. I would also like to expresssincere gratitude to Krishna Group for the sponsorship.

    REFERENCES

    [1] A. Chipperfield and P. Flemming. Parallel Genetic Algorithms.Parallel and Distributed Computing Handbook, first ed., A.Y.Zomaya, ed., pp. 1,118-1,143. McGraw-Hill, New York, 1996.

    [2] B. Kruatrachue and T.G. Lewis. Duplication Scheduling Heuristic, aNew Precedence Task Scheduler for Parallel Systems. TechnicalReport 87-60-3, Oregon State Univ., 1987.

    [3] D.C. Goldberg. Genetic Algorithms in Search, Optimization andMachine Learning. Add. Wesley publishing,1989.[4] H. EL-Rewini, T.G. Lewis, and H.H. Ali. Task Scheduling in Parallel

    and Distributed Systems. Prentice Hall.1994.

    [5] H. Topcuoglu, M.Y. Wu. Performance-effective and low-complexitytask scheduling for heterogeneous computing. IEEE Transactions on

    parallel and distributed System, Vol. 13, pp.260-274, 3, 2002.

    [6] J.H. Holland. Adaptation in Natural and Artificial Systems. MITPress, 1975.

    [7] Jonathan l. Gross, Jay Yellen. Handbook of Graph Theory. CRCPress.

    [8] M. Srinivas and L.M. Patnaik. Genetic Algorithms: A Survey.Computer vol. 27, pp. 17-26, 1994.

    [9] Martin Charles Golumbic. Algorithmic Graph Theory and PerfectGraphs. Second Edition, Elsevier, 2004.

    [10]

    M. R. Garey and D. S. Johnson. Computers and Intractability: AGuide to the Theory of NPCompleteness, San Francisco, CA, W. H.Freeman, 1979.

    TABLE I. RESUTS OF HEFT

    PIN (0-9)Size

    of

    Problem 0 1 2 3 4 5 6 7 8 9

    Average

    Schedule

    Length

    25 116 108 145 105 107 144 141 154 148 170 133.8

    30 158 165 170 140 170 167 176 147 161 173 162.7

    35 161 163 162 193 139 176 140 177 192 197 170

    40 203 183 154 180 202 208 174 184 162 211 186.145 217 184 193 186 229 179 171 216 256 217 204.8

    50 192 220 186 241 236 201 203 249 218 216 216.2

    55 233 220 216 240 229 243 240 235 219 237 231.2

    60 252 260 259 266 244 219 264 260 247 252 252.3

    65 277 294 250 255 275 260 282 284 272 245 269.4

    TABLE II. RESULTS OF GA

    PIN (0-9)Size

    of

    Problem 0 1 2 3 4 5 6 7 8 9

    Average

    Schedule

    Length

    25 116 108 145 104 107 143 141 154 148 170 133.6

    30 158 165 170 140 170 164 176 147 159 173 162.2

    35 160 163 162 193 139 176 140 177 191 197 169.840 202 180 154 177 202 208 174 183 159 210 184.9

    45 217 180 191 186 229 179 171 216 256 216 204.1

    50 192 220 186 241 236 201 203 249 217 216 216.1

    55 233 220 215 239 230 243 240 235 219 237 231.1

    60 252 259 256 266 246 220 264 260 247 252 252.2

    65 277 294 249 253 273 261 281 284 271 244 268.7

    Effect of mutation probability on Avg.s chedule

    length

    265

    270

    275

    280

    285

    0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4

    mutation proba bilities (pm)

    Avg.sche

    dulelength

    Avg. schedule length

    270

  • 7/28/2019 05460728

    5/5

    TABLE III. COMPARISON OF HEFT AND GA

    No. of tasks No. of processors Avg. schedule length (HEFT)Avg. schedule length

    (GA)

    25 4 133.8 133.6

    30 4 162.7 162.2

    35 5 170 169.8

    40 5 186.1 184.945 6 204.8 204.1

    50 6 216.2 216.1

    55 7 231.2 231.1

    60 7 252.3 252.2

    65 8 269.4 268.7

    271