Summary of the invention
Technical matters to be solved by this invention is exactly to provide a kind of dynamic task allocation method of heterogeneous computing system for the defective that overcomes above-mentioned prior art existence.
Purpose of the present invention can be achieved through the following technical solutions: a kind of dynamic task allocation method of heterogeneous computing system, heterogeneous computing system is finished application task by the common cooperation of the processor of one group of isomery, it resolves into one group of parallel subtask with task, and be dispatched to each processor by execution sequence, it is characterized in that this method may further comprise the steps:
A. advance quene threshold value and one and stop into quene threshold value for each processor is provided with one;
B. allocating task is given each processor, and execution in step is as follows:
(b1) length value of the waiting list on the computing machine;
(b2) judge this length value whether less than this processor advance the quene threshold value, if, execution in step (b3) then;
(b3) calculate each subtask in the group of subtask and be assigned to probability in this processor;
(b4) subtask of probability maximum is added the waiting list of this processor, and this subtask is deleted from the group of subtask;
(b5) calculate the length value of the waiting list on this processor;
(b6) judge this length value whether less than the into quene threshold value that stops of this processor, if, then return step (b3), if not, then return step (b1);
C. when a plurality of processors are competed same subtask, calculate the intensity of load of these a plurality of processors, this subtask is distributed to the processor of intensity of load minimum.
Compared with prior art, the present invention has considered the Optimization Dispatching problem of heterogeneous computing system from dynamic angle, utilize the swarm intelligence technology, a kind of Optimization Dispatching method based on heterogeneous computing system has been proposed, this method can be carried out dynamic Task Distribution according to the processing power of different processor in the heterogeneous computing system, and has considered the race problem that wherein may occur; The computing power of the dynamic considering processor of the present invention, the loading condition of processor, the execution time that can further accelerate heterogeneous computing system.
Embodiment
The invention will be further described below in conjunction with accompanying drawing.
Shown in Fig. 1~4, a kind of dynamic task allocation method of heterogeneous computing system, heterogeneous computing system is finished application task by the common cooperation of the processor of one group of isomery, and it resolves into one group of parallel subtask with task, and be dispatched to each processor by execution sequence, this method may further comprise the steps:
A. advance quene threshold value and one and stop into quene threshold value for each processor is provided with one;
B. allocating task is given each processor, and execution in step is as follows:
(b1) length value of the waiting list on the computing machine;
(b2) judge this length value whether less than this processor advance the quene threshold value, if, execution in step (b3) then;
(b3) calculate each subtask in the group of subtask and be assigned to probability in this processor;
(b4) subtask of probability maximum is added the waiting list of this processor, and this subtask is deleted from the group of subtask;
(b5) calculate the length value of the waiting list on this processor;
(b6) judge this length value whether less than the into quene threshold value that stops of this processor, if, then return step (b3), if not, then return step (b1);
C. when a plurality of processors are competed same subtask, calculate the intensity of load of these a plurality of processors, this subtask is distributed to the processor of intensity of load minimum.
Heterogeneous computing system is by a series of different processor P={p
1, p
2, p
3Lp
nForm, task is decomposed into a series of subtask T={t
1, t
2, t
3Lt
m, suppose that these tasks are separate, general n<m.The problem that need to solve is how according to the different disposal ability of processor, reasonably distributes the subtask, makes the time of Processing tasks T short as much as possible, the performance advantage of performance heterogeneous computing system.
Parameter-definition
Task t
iPriority note make β
i, owing to be heterogeneous system definition V (t
i, p
j) expression task t
iAt processor p
jThe time of last operation, definition of T p (t
i, p
j) expression task t
iArrive processor p by network allocation
jDuring last execution, the needed transmission time.Comp (t
i, p
j) expression task t
iAt p
jOn deadline, so
Comp(t
i,p
j)=V(t
i,p
j)+Tp(t
i,p
j)(1)
W (t
i) expression task t
iFrom distributing to processor to finishing used time, i.e. t
iStand-by period.L (P, p
j) expression processor p
jThe length of first-class pending formation, wherein, set P represents processor p
jIn task, then have
Γ
jExpression processor p
jFinish the time of all tasks, S set is represented processor p
jThe set of middle all tasks of handling.Have so
Definition Γ is the deadline of whole task, and our target is to minimize Γ, promptly
Γ=min{max
1≤j≤nΓ
j}(4)
The dynamic task apportion model
How allocating task can adopt bee colony Task Distribution mode to heterogeneous computing system, and as the corresponding honeybee of processor, work such as offspring are looked for food, looked after to the corresponding honeybee of task, the Task Distribution of the corresponding honeybee of Task Distribution.Therefore, the information interchange model between honeybee and the environment can be used in the task scheduling of heterogeneous computing system, dynamic to realize, adaptive Task Distribution mode.
In the ant colony algorithm of heterogeneous computing system Task Distribution, one of the waiting list regulation of processor is advanced group threshold value L
InWith stop into group threshold value L
Stop, when the length of the waiting list of this processor is less than or equal to into group threshold value L
InThe time, then from unappropriated task, select the waiting list that task adds this processor, when the waiting list length of this processor more than or equal to L
StopThe time, the waiting list that stops this processor adds task.
Each processor p
jTo in the system still the task of unallocated resource the reaction fault value of a correspondence is all arranged.We represent with one group of m * n matrix.
α wherein
IjExpression processor p
jTo task t
iThe respective doors limit value, α
IjWith this task at processor p
jOn execution time V (t
i, p
j), and task is transferred to processor p
jOn transmission time Tp (t
i, p
j) relevant, its formula is as follows
α
ij=ζ+u×Tp(t
i,p
j)+l×V(t
i,p
j)(5)
Wherein: ζ, u, l are constant.
As can be seen, task execution time and data transmission period are long more from formula (5), and reaction fault value is big more, and the possibility of accepting this task is more little; Task execution time and data transmission period are long more, and reaction fault value is more little, and the possibility that receives this task is big more.
Equally, still unappropriated task can be sent stimulus signal to the processor of available use, with vectorial B=(θ
1θ
2L θ
n) represent.θ wherein
iThe stimulus signal that the expression task is sent is with task stand-by period W (t
i) and the priority β of task
iRelevant, its formula is as follows
θ
i=β
i+h×W(t
i)(6)
Wherein: h is a constant.
From formula (6) as can be seen, task stand-by period W (t
i) long more, the priority β of task
iThe stimulus signal that big more then this task of priority is sent is strong more, can preferentially be selected into the load queue of processor.
So, when Task Distribution, can come the selection task to enter the waiting list of processor according to the stimulus signal that the reaction fault value and the uncompleted task of each processor are sent.Can be by probability
We can draw to draw a conclusion task t according to formula (7)
iThe stimulus signal that sends is strong more, or processor p
jReaction fault value low more, then to be assigned to the possibility of this processor big more for task.
Provided the step of selecting task on each processor below:
Step1. calculate on this processor wait to row L length, if L<L
InThen continue;
Step2. according to formula (5), calculate the stimulus signal θ of promising scheduler task
i,, calculate the reaction fault value α of this processor according to formula (6)
Ij,, calculate the probability P (α that scheduler task is selected into this processor according to formula (7)
Ij, θ
i);
Step3. select probability P (α
Ij, θ
i) one group of maximum (t
i, p
j), t
iThe wait that enters this processor is to row, with t
iFrom T, delete;
Step4. calculate the length of the wait of this processor, judge, if L<L to row L
StopThen change Step2, otherwise change Step1;
Under actual conditions, the situation that a plurality of processors are striven same task unexpectedly can appear, at document
[1]In utilize social hierarchy's outline of bee colony self-organization to solve the race problem of a plurality of honeybees, the honeybee of promptly participating in competition has been endowed an intensity level, intensity level is more little, the probability of its triumph is big more.In this article, the intensity of load size comparator processor when striving unexpectedly that we can be by weighing each processor.Processor P
jIntensity W
jBe defined as the length of the pending formation on this processor and being competed of task t
iDeadline sum on this processor.Promptly
W
j=L(p
j)+Comp(t
i,p
j)(8)
When competition occurring, get the processor of intensity level minimum.
Present embodiment is tested method of the present invention, and with existing mean allocation method (i.e. not considering processor processing power and load state, and give each processor the workload mean allocation) compare, this test run is in PVM (Parallel Virtual Machine) 3.4.3 heterogeneous computing environment.PVM is supported in the virtual machine loading tasks operation automatically, can intercom mutually between task and synchronously.The node that in the PVM system, allows user's appointed task to be loaded.During experiment, with 1 DELL server PowerEdge 1800 (CPU:Xeon 3.2GHz internal memory: 1G), as main frame.Six desktop computers are as the node machine, and wherein a CPU is Pentium41.5GHz, in save as 1024MB; 3 CPU are Pentium4866MHz, in save as 512MB; 2 CPU are Pentium3500MHz, in save as 256MB.
When carrying out simulated experiment, 6 node machines increase successively, and node machine of every increase is tested one group of data, and experimental data is as shown in table 1.
Table 1: the execution time of the following two kinds of models of different processor relatively in the heterogeneous system
Fig. 2 compares the execution time when having only a node machine, and this moment, the experimental result of two kinds of experimental techniques was approaching, and this paper model has only been saved 23.34s (3.2%) than average distribution system.Along with the increase of experiment node machine, the advantage of this paper model is more and more outstanding, and as shown in Figure 3, two kinds of model execution time compare when being 6 desktop computers of employing, and this paper model has been saved 101.42s (17.55%) than the mean allocation method execution time.
Fig. 4 compares the execution time of the following two kinds of models of different test environments in the heterogeneous system, can obviously find out from Fig. 4, when the 4th node machine is increased to the 5th node machine, the execution time of average distribution system does not obviously reduce, only save 6.90s, and the execution time of this paper model has been saved 23.6s.Reason is the computing power that should be the 5th the node machine very big gap of comparing with preceding four node machines, the mean allocation algorithm is not considered machine performance, just with task simply mean allocation give each node machine, the execution time of the 5th node machine is more than the execution time of preceding four node machines when handling identical data, thereby cause having increased a machine, the execution time does not obviously reduce.And this paper algorithm has been considered the processing power of each node machine, and according to the loading condition of processor, dynamic rational allocating task shortens deadline of whole task.
The invention belongs to utilizing the swarm intelligence The Application of Technology.Swarm intelligence (Swarm Intelligence) is meant the colony that is made up of a plurality of simple individualities, has the ability of finishing problem solving by simple coordination each other.Over past ten years, the research field that application group's intelligence solves variety of issue more and more is subjected to people's attention.The collective behavior that occurs in a group social insect is called as swarm intelligence, colony of social insect use intelligence, distributed method solves complicated problems jointly, these problems are individual insurmountable.Some scholars have proposed to be used for the derivation algorithm and the theory of combinatorial optimization problem according to the result of study to the insect group behavior, as ant group algorithm, ant colony algorithm etc., and have obtained application in a lot of fields.Task scheduling problem in the heterogeneous computing system itself also belongs to combinatorial optimization problem, and parallel subtasks wherein and each processor can be considered as simple individuality, each other by coordinating to realize optimum.