Optimal Tasks Assignment for Multiple Heterogeneous Processors with Dynamic Re-assignment

: Distributed Computing System [DCS] has attracted several researchers by posing several challenging problems. In this paper we have developed a mathematical model for allocating “M” tasks of distributed program to “N” multiple processors (M>N) that minimizes the total cost of the program. Relocating the tasks from one processor to another at certain points during the course of execution of the program that contributes to the total cost of the running program has been taken into account. Most of the researchers have considered the cost for relocating the task from one processor to another processor at the end of the phase as a constant. But in real life situations the reallocating cost of the tasks may very processor to processor this is due to the execution efficiency of the processors. Phase-wise execution cost [EC], inter task communication cost [ITCT], residence cost [RC] of each task on different processors and relocation cost [REC] for each task have been considered while preparing a dynamic tasks allocation model.


1.
Introduction: Although computer speed has been increased by several orders of magnitude in recent decades the demand for computing capacity increase at an even faster pace. DCS provide faster computation by facilitating parallel execution of tasks of a job. DCS is used to describe a system whenever there are several computers interconnected in some fashion so that a program or procedure runs on the system with multiple processors. In a heterogeneous computing system, the tasks of an application program must be assigned to the heterogeneous processors to utilize the computational capabilities and resources of the system efficiently. However, it is a difficult problem to compute an assignment of tasks to processors for which the total cost of running the program is minimized. Static and dynamic algorithms can be extremely efficient in homogeneous systems. If all processors are identical then the choice "to which node should we assign the next task?" falls on the processor with the fewest outstanding jobs [3]. However in heterogeneous distributed environments, where not all nodes have the same parameters, selecting the optimal target processor requires more elaborate algorithms.
Stone [2] has suggested an efficient optimal algorithm for the problem of assigning tasks to two processors by making use of the well-known network flow algorithm in the related two-terminal network graphs. If the structure of a distributed program is constrained in certain ways, it is possible to find the optimal assignment over a system made up of any number of processors in polynomial time. When the structure is constrained to be a tree, the shortest tree algorithm developed by Bokhari [4] yields the optimal assignment. Towslcy [8] generalized the results of Bokhari to the case of series-parallel structures. A further generalized program structure is a partial K-tree in which trees are partial l-tree and series-parallel structures are partial 2-tree [6] assuming distributed system as fully interconnected, i.e., there exists a communication link between any two machines. However, the general n-processors problem (N > 3) in a fully interconnected system is known to be NP-complete [7,10]. C.H. Lee [1] and S.Y. Cho [11] have suggested an optimal algorithm for the general structure problem in a linear array network with any number of processors.
In a general case each task may have multiple computational characteristics due to the dynamic control behavior of the task. Such tightly and medium-coupled portions of code task will be more difficult to break up and assign to different processors. When the characteristics of the computation change, a new assignment must be computed. By "characteristics of the computation" we mean the ratios of the times that the program spends in different parts of the program. Dynamic algorithms are employed more frequently because they offer a better efficiency, having the flexibility of tasks migration. We use phase as the unit of the time slot for gathering more detailed information of program activity. During this period, the executing task may communicate with any number of the remaining task. A task may not be moved from one processor to another during a phase; it may be moved only between them. A task may complete its execution in more than two phases. Bokhari [5] analyzed the problem of dynamic assignment in a two-processor system, which permits relocation of tasks from one processor to the other at certain points during the execution of the program. This relocation incurs a predefined relocation cost that contributes to the total cost of running the program and code-conversion overheads. Kumar et al. [12] developed a model for allocating m tasks to n processors divided it into any number of phases. In this model the effect of migration cost for reassigning each task from one processor to other at the end of phase have been not considered. Yadav et al. [13] have developed a mathematical model for arbitrary number of phases and processors with random program structure considering execution, residence, inter-task communication and relocation costs. Recently in 2012 [15] developed a dynamic task allocation model based on artificial neural network [ANN] scheduling approach to arrange the tasks to the processors. Relocating the tasks from one processor to another at certain points during the course of execution of the program that contributes to the total cost of the running program has been taken into account. In the above paper authors have considered that the cost for relocating the task from one processor to another processor at the end of the phase is constant which is not true in real life situation.
The rest of the paper is organized as follows. Notations and assumptions are defined in section 2. In section 3, tasks allocation problem has been discussed. The proposed method and algorithm have been explained in section 4, and section 5 concludes this paper.

Notations and Assumptions
The following notations and assumptions are used through the paper.
ti : i-th task of the program.
Pj : j-th processor of the system. t*i: The restricted task to be executed first.
ekij: The execution cost for the executing task ti on the processor pj during the k-th phase.. ckij: Inter task communication cost between task ti and task tj during k-th phase.
rkij: Residence cost for the task ti to reside on Pj during k-th phase.
mki:The relocation cost for the task ti at the end of the k-th phase.
TCOST (A): Cost of an assignment A.
RES_LIST {}k : Tasks priority list for the k-th phase.

Assumptions:
The program to be executed is assumed to be collection of tasks that are free, in general, to reside on either of the processors. A task may be a module of executable program. The given program runs in various phases with one of its task executing on a processor in each phase and each of the other tasks residing on any of the processors. In each phase, EC, RC of non-executing tasks, ITCC of executing task with non-executing tasks and REC for reassigning each task from one processor to the others at the end of phases are known. Some of the tasks have restrictions for being allocated on some particular processor because of the non-availability of desired facilities which may include access to particular peripheral device, access to a particular task, and high speed arithmetic capability of the processor. The execution costs of such tasks are taken to be infinity on those processors where these tasks cannot be executed.

Problem Statement
Consider a distributed program consisting of a set T= {t1.t2, t3,……tM} of M tasks to be allocated to a set P={p1,p2,p3,…….pN} of N processors divided into K phases. The problem for allocating a program dynamically that has been divided into K number of phases.  N x N) where relkixy is the relocation cost for reassigning the i-th task from px processor to py processor at the end of k-th phase. In this paper we have consider that the relocation cost relkixy is not constant when i-th task relocates from one processor to another at the end of the k-th phase.
In general, the objective of task assignment is to minimize the completion cost of a distributed program by properly mapping the tasks to the processors. The cost of an assignment A, TCOST (A) is the sum of execution, inter-task communication, residence and relocation costs i.e.

TCOST (A) =EC (A) +RC (A) +ITCC (A) +REC (A)
In order to make the best use of the resources in a DCS we would like to find an assignment having minimum cost.

Proposed Method and Algorithm:
The model starts from the first phase for allocating the tasks and moves to the next phase. Let ts is the s-th executing task and tg (s≠g) be the g-th residing tasks during k-th phase. The executing task ts must be assigned to processor pr during k-th phase for which sum of its execution and relocation costs is minimum. This minimum cost for the task ts is represented by TECk. First for all the residing tasks we compute their priorities. Residing tasks are selected in order of their priorities and selected residing task is assigned on that processor for which the residing cost is minimum. For the k-th phase, the tasks priority list RES_LIST{}k for the residing tasks is generated by shorting the residing tasks in decreasing order of RELC(g). The RELC(g) for the residing tasks are calculated by equation 2 as: Tie-breaking is done randomly. We select the first tasks tg from list RES_LIST{}k. When residing task tg resides on a processor it has three types costs i.e. residing, relocation and communication cost with the executing task ts. Therefore, the residing task tg must be reside to that processor ph where it has minimum costs mentioned above. This minimum cost for the task tg is represented by TRC(g)k. List RES_LIST{}k is modified by deleting the task tg from RES_LIST{}k. This process of executing the residing tasks will be continue until RES_LIST{}k becomes empty.
The total cost TRCk due to the residing tasks in the k-th phase will be: The total cost (TCOST)k for the k-th phase is the sum of TECk and TRCk i.e.: (TCOST)k= TECk+ TRCk (4) The total optimal cost, TCOST for the program will be: Using the arrays representation for the execution, residing, inter task communication and relocation costs a mathematical model has been developed for allocating the distributed program dynamically which has been splitting into any number of tasks partition and completing their execution in any number of phases. The process of allocating the tasks to the processors is given below in the form of algorithm.

Algorithm:
To assign a distributed program consisting of a set T= {t1.t2, t3,……tM} of M tasks which is divided into K phases to a set of n processors P= {p1,p2,p3,…….pN } in order to minimize the total cost .
Step-4: Assign the executing task ts to processor pr for which cost is minimum say TECk.
Step-5: Add the effect of communication cost of executing tasks ts with other residing tasks by adding kth column of ITCCM (, , ) to all the column of NECM (, ,) except the rth column at which this task is assigned.
Step-11: Modify the cost of NECM (, ,) by adding rth row for the task ts of the matrix REC(,,,) for (k-1)th phase to the sth row.
Step-12: Modify the cost of NECM (, ,) by adding hth row for the task tg of the matrix REC(,,,) for (k-1)th phase to the gth row.
Step-16: Calculate: Step-17: End. The above result shows that the assignments of the tasks are changing phase wise i.e. result depend on the characteristic of the computation. The optimal cost for given tasks program is 185.

Conclusion:
In this paper we have presented an efficient solution technique for allocating the tasks of a program, divided into k-phases to N>2 processors. The present model is compared with Kumar et al. [9] ,Bokhari [5], Yadav et al. [13] and Singh et al [15]. Kumar et al. [9] have developed a mathematical model for allocating "M" tasks of a program to "N" processors (M>N) divided into any number of phases. In this paper authors have considered only execution, residence and inter-task communication costs. It is also observed the model [9] does not work for the system program having relocation cost for reassigning each task from one processor to the others at the end of phases. Bokhari [5] have developed a graph theoretical approach for finding out the optimal dynamic assignment of a modular program only for the two-processor system considering execution, residence, inter-task communication and relocation costs. The models presented by Yadav et al. [13] and Singh et al [15] have considered that the cost for relocating the task from one processor to another processor at the end of each phase is same for all the processors while in the present paper we have developed a mathematical model for arbitrary number of phases and processors with random program structure considering varying relocation costs processor to processor.