An Efficient Task Scheduling of Multiprocessor using Genetic Algorithm based on Task Height

Static task scheduling in multiprocessor frameworks is one of the well-defined NP Hard Problem. Due to optimal utilization of processors and in addition investing less time, the Scheduling of tasks in multiprocessor frameworks is of extraordinary significance. To Solve NP Hard Problem using traditional strategies takes reasonable measures of time. Over the time, various heuristic procedures were presented for comprehending it. Therefore, heuristic methods such as Genetic Algorithms are appropriate methods for task scheduling in multiprocessor system. In this paper, a new GA for static task scheduling in multiprocessor systems has been presented whose priority of tasks’ execution is based on the height of task in graph and other mentioned parameters and then scheduling is performed. This proposed method is simulated and then compared with Basic Genetic algorithm.


Introduction
It is difficult to execute a single big problem on a single processor in a reasonable time.Because of this, it is divided into number of tasks and the length of each schedule must be so that it results in appropriate scheduling in a multiprocessor system.The task scheduling [6,7] problem in multiprocessors is to allocate the set of tasks to processors such that optimal or sub optimal utilization of processors and minimum scheduling time are achieved.
For mathematical modeling if task assignment problem, Direct Acyclic Graph (DAG) is used as each task is represented by its adjacent node in the graph [2].The edge between task ti to task tj represents that task ti is not finished, task tj cannot start execution.The task assignment objective is to schedule the n tasks to m processors, while the priority of tasks is being taken care and the utilization is maximized.The communication delay between processors and the data volume transmitted between two tasks is also observed.Scheduling of tasks in a multiprocessor system is an NP Hard Problem [1].It is expensive and time consuming to schedule tasks using traditional and dynamic approaches.However using heuristic methods we can have the optimal solution or nearly optimal solution for these problems.There are many heuristic methods which can be used such as: min-min, max min, duplex, MCT (Minimum Completion Time), MET (Minimum Execution Time) [8], SA (Simulated Annealing) [9], tabu search [10].One of the heuristic method which is best for scheduling in multiprocessors system is genetic algorithm (GA).heuristics to get optimum or near to optimum solution.People use a single heuristic or a combination of heuristics and meta-heuristics.It is called the hybrid meta-heuristics.
SaimaGulzar Ahmad, EhsanUllahMunir, WasifNisar [13] have proposed meta Performance Effective Genetic Algorithm (PEGA).The PEGA efficiently finds the best solution from the search space; The reason why PEGA is performance effective is because of the effective utilization of genetic operators (crossover and mutation).
AnuragAgarwal, SelcukColak [14], proposed a metaheuristic approach -called NeuroGenetic -which is a combination of an augmented neural network and a genetic algorithm.The results showed that the NeuroGenetic approach performs better than either the augmented neural network or the genetic algorithms alone.
HosseinParvan, EbrahimBehrouzianNejad, SeyedEnayatolahAlavi [15], proposed a hybrid scheduling algorithm for solving the independent task scheduling problem in grid which comprises of GA with Firefly algorithm.It was indicated from the results that as compared to the best processed method, the proposed algorithm can decrease Makespan of 10%.
Mehrabi A., Mehrabi S., Ali Mehrabi D. [16] , solved the task assignment problem by considering load balancing with the use of a new method, based on the genetic (GAs) algorithms.GA uses a repair function to ensure valid assignments during the process of algorithm.
M.Rathna Devi, A.Anju [17], In this study emphasizes on development of a multi objective scheduling algorithm using Evolutionary techniques for scheduling a set of dependent tasks in a multiprocessor environment which minimizes the ma kespan and reliability cost.NSGA-II is Elitist Evolutionary algorithm that takes the initial parental solution without any changes, in all iteration to remove the problem of loss of some pareto-optimal solutions.S Diana, L Ganapathy, Ashok K Pundir [18], proposed improved Genetic Algorithm (IGA) based approach for the single mode resource constrained project scheduling problem (RCPSP) with makespan minimization as objective.The suggested way uses binary string based representations and operators for chromosomes.
MedhatAwadall, Afaq Ahmad, Samir Al-Busaidi [19], This paper highlights two new approaches, Modified List Scheduling Heuristic (MLSH) and enhanced genetic algorithm by constructing promising chromosomes.The result after comparison shows that the proposed approaches works to enhance processor efficiency and decrease task makespan.
SunitaDhingra, SatinderBal Gupta, RanjitBiswas [21], have proposed that Optimizing different parameters such as crossover, mutation, crossover probability, selection function etc., can lead to efficient and effective genetic algorithm.

Proposed Algorithm
We propose a genetic algorithm for scheduling tasks in multiprocessor environment.We have used the randomized height based approach.Below we have listed the steps of our proposed GA for tasks scheduling.

Encoding Chromosomes
Chromosome shows the possible state of scheduling.Each chromosome is represented by the tuple (T,P), where T is set of tasks and P is set processors in the framework.pi є P is shown a processor that allocated to task ti є T. Each chromosome represents the execution of tasks in the processor and also the sequence of tasks to processor [4].In below table there are three processors and 7 tasks that are shown.

Adjust Height
Tasks are queued in priority queue on the basis of their priorities.As it is mentioned above, task must be ready to execute and must have the higher priority and stand on priority queue.Adjust height function arranges tasks in all the possible ways.Using this method we updates the task height which are dependent on the selected task.This change is just limited to this population only as it is the local height concept.In further populations global height parameter is considered.T1 is root and if selected first then suppose its height is updated to 0 then height of all children must be updated accordingly.

Table 3. Adjusted Task Height
After selecting each task for execution we update this table so that we can find the dependencies and arrange them in respective order.Scheduling is done based on tasks priority and in GA execution time, the sequence of tasks priority is not changed but the sequence of allocation of processors to the tasks is variant.

Fitness Function
The aim of the proposed scheduling algorithm is to minimize the schedule time of the parallel program.It is the measure which decides the fitness of function.It is calculated in terms of minimum schedule time so that utilization and speed up can be achieved [11].We consider the computation cost [5], Communication delay between processors and data volume transmitted between two tasks as well.We have calculated the starting time and finish time of tasks.
We derive a formula to calculate starting time (ST) of a task which is show below.

ST(task) =max( max[task at Processor [id] [levelOrder[task]]], max time on machine)
The finish time(FT) of that task is summation of starting time and its execution time(ET).Its completion time is the available time for a machine on which it is executed.FT(task) = ST (task) + ET( on particular machine) Fitness = max(FT(Pj) for j = 1,2,...,n Where n is the number of processors and FT(Pj) is the finish time of the final task in the processor Pj.

Reproduction
For reproduction, the pair of available solution is selected and then the reproduction operators like crossover and mutation are applied.All operators are discussed below:

Selection:
The selection phase has two steps: 1) Applying a roulette wheel to select two chromosomes: After chromosomes are ascend on the basis of their fitness, a roulette wheel series is constructed based on their fitness [11].Hence, the chromosomes with low fitness, occupy more slots i n the roulette wheel.In this way the possibility of selecting chromosomes with best fitness is higher.Then two chromosomes will be selected.
2) Applying a roulette wheel for selecting a task: A roulette wheel is constructed for tasks based on their number of children.A task with more sub tasks has more probability to be selected compared to a task with fewer ones.The genetic operators like crossover, mutation will be applied on the current generation to produce the next generation.

Crossover:
Crossover operator is used to differ the analogy of chromosomes from one generation to another.Single Point crossover is used in proposed algorithm.Crossover is applied on the chromosomes so as to produce the best fit chromosome which has the best fitness than its parent.The crossover starts with two parent chromosomes to exchange subparts of them to create two new children chromosomes.Following conditions must be satisfied for the reproduction of legal chromosome: 1) The height of the tasks next to the crossover points should be different.
2) The height of all the tasks immediately in front of the crossover points should be equal.

Mutation [11]:
The mutation selects a chromosome and then randomly exchanges the two tasks with the same height.The mutation is applied with a certain mutation rate (Mr) which is used to prevent the search process from converging to the local optima prematurely.

Scheduling Algorithm
The code of proposed scheduling algorithm is shown below.1. Generate the population according Section 3.2 2. While (finish time of each machine in chromosome are equal or generations number is no more than given number) do forevery chromosome in this population do calculate fitness of every chromosome as shown in Section 3.4 End for whilenext population is generated and complete do choose chromosomes with best fitness values by roulette -selection use single point crossover operator to create next generation children as shown in 3.5.2use mutation operator according Section 3.5.3

End while End while
The exit condition in proposed algorithm determines the equal processing time for all processors and also the number of generations.By using it the optimal parallelism can be achieved, as all processors can have the equal or nearly equal processing time.

Implementation Environment
A set of simulation is performed using Java on Eclipse platform on a computer Pentium IV, having AMD processor 2.8 GHz, and 512 MB memory of RAM to evaluate our suggested algorithm.
To load tasks and processors we used imput file in which the number of t asks and number of machines are described.The communication delay between processors, computation cost(Execution time of tasks) and data volume between two tasks is also mentioned in input file.createPopulation() method is used to create population of 10 00 chromosomes.heightOfNode(int)method is used to determine the height of each task and also adjusts the height.fitNess(intid) checks the fitness(makespan) [12] of each task.scheduleTask class is used to define and manage tasks, processors, starting time and finish time of each task.procAvT[]defines the processor available time.The task group is J30 and all communication delays and costs are defined in this group.

Results and Discussion
Following Figures shows the results achieved.The speedup and utilization and schedule time using this technique are better than basic GA.In Figure 2 it is evident that there was an initial speed up increment till 200 GA generations, later on there was a decrement in the speed up, which was observed for another 300 generation of computation, a further rise in speed up was noticed after that for the rest of the 500 generation of calculations and the final speed up was noted around 4.1.
Figure 3 shows the schedule time using our proposed algorithm and schedule time using Basic Genetic Algorithm.It is clear that our algorithm is better than Basic GA.
It was observed that scheduled time period and number of GA generations considered was directly proportional throughout the calculations till 1000 generation of computation.Our observation suggest that allotment of number of tasks and speed up showed diverse result and did not follow any proper assumption, although obtained values of speed up was ranged between 2.5 and 4.5 (Figure 4).Initial state of the task allotment reduced the speed up and later on increment was observed.Subsequent decrease and increment with allotted tasks suggest no proper relation between speed up and number of task.Similar results were observed for when efficiency of the program was measures with respect to the task numbers (Figure 5).No particular relation, i.e., directly or inversely proportional relation was observed in such situation.

Conclusion
We proposed a height base GA to solve task scheduling problem of dependent tasks in multiprocessor architecture.In this algorithm priority of tasks is based on their height, children number and execution time.The experimental simulations applied on our algorithm using various task graphs and number of generations and by comparing it with Basic GA shows that proposed algorithm has less schedule time than basic GA.Under the same the schedule length, finish time are also less.Therefore proposed algorithm can show effective behaviour and can be used as an efficient and better scheduling system in many applications.

Find
Find height for each task in DAG Height of each task can be calculated using DAG, if task is parent of other task then its height is 1-height of its child or height of child is 1+ height of its parent.Below is the equation that calculates the height of task.Height [task] = 0 (if task is root) Otherwise Height [task] = max (height (parents)) +1 Calculation of height starts from entry node and ends at exit node.

Figure 2 .Figure 4
Figure 2. Speedup Vs.Number of Figure 3. Schedule Time Vs. Number Generations of Generations