CN106155799A - Codelet dispatching method based on genetic algorithm - Google Patents

Codelet dispatching method based on genetic algorithm Download PDF

Info

Publication number
CN106155799A
CN106155799A CN201610628188.3A CN201610628188A CN106155799A CN 106155799 A CN106155799 A CN 106155799A CN 201610628188 A CN201610628188 A CN 201610628188A CN 106155799 A CN106155799 A CN 106155799A
Authority
CN
China
Prior art keywords
codelet
task
scheduling
node
scheduler
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610628188.3A
Other languages
Chinese (zh)
Other versions
CN106155799B (en
Inventor
裴颂文
王金恺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Shanghai for Science and Technology
Original Assignee
University of Shanghai for Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by University of Shanghai for Science and Technology filed Critical University of Shanghai for Science and Technology
Priority to CN201610628188.3A priority Critical patent/CN106155799B/en
Publication of CN106155799A publication Critical patent/CN106155799A/en
Application granted granted Critical
Publication of CN106155799B publication Critical patent/CN106155799B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Software Systems (AREA)
  • Biophysics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Physics & Mathematics (AREA)
  • Molecular Biology (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Physiology (AREA)
  • Computing Systems (AREA)
  • Computational Linguistics (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Artificial Intelligence (AREA)
  • Genetics & Genomics (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

The present invention relates to a kind of Codelet dispatching method based on genetic algorithm, based on Codelet data-flow computation model, genetic algorithm dispatching method based on polycaryon processor parallel system is combined with the task scheduling of Codelet model, this dispatching method is when solving Mission Scheduling, use the coded system of explicit two-dimensional array, operated by genetic operators such as hybridization, variations, two arrays " are merged " and produces new array as follow-on solution.This dispatching method can be effectively improved the executed in parallel efficiency of task, reduces the free time of performance element, improves the resource utilization of multi-processor system-on-chip.The method can also be extended to other kinds of data flow model, it is achieved task executed in parallel in multiple nucleus system.

Description

Codelet dispatching method based on genetic algorithm
Technical field
The present invention relates to the design of a kind of multinuclear data flow computer system method for scheduling task, particularly to one based on The Codele dispatching method of genetic algorithm.
Background technology
For a long time, the computer system of main flow performs model is the von Neumann computation model centered by controlling stream. The feature of this model is that the instruction that a succession of order performs is put into same address space, and by a single program counter Control.Along with emerging in large numbers of distributed storage computer model and multiple nucleus system, parallel computation has become heterogeneous polynuclear with parallel memory access The basic demand of computer system, the application of big data algorithm has promoted the development of large-scale data flow calculation model further.
The high resiliency that algorithm is supported by data-flow computation model with it, stronger set expandability, power dissipation ratio of performance is high Feature, is widely regarded as the potential replacement scheme to control the Traditional parallel computation model centered by flowing.Data-flow computation mould Type be a kind of natural, by the Parallel Execution Model of data-driven, the programmed logic of data stream is expressed based on data flow diagram. When all input data of certain program unit are the most ready, this program unit will be activated.Necessary hardware resource is all subsequently In the case of Man Zuing, this program unit will operationally performs under (Runtime) environment automatically.This based on data stream parallel Process model and meet the developing direction of current multinuclear calculating system infrastructure, the scale of big market demand can be effectively improved Execution efficiency.
MODEL C odelet is performed for the University of Delaware a kind of novel data streams in parallel that scholar proposes of being correlated with, this A kind of Codelet dispatching method based on genetic algorithm of bright proposition.Codelet model is a kind of fine-grained, by event-driven Hybrid Parallel Execution Model, by basic performance element Codelet and the multi-threaded program (Treaded serving as container Procedure) composition.This by the execution model of grade classification, the mode using Codelet large-scale parallel to perform inherits The high concurrent feature of data-flow computation model, also uses multi-threaded program to compensate for lacking of data-flow computation model space locality difference Fall into, become the Typical Representative of current data flow calculation model development.During the operation of Codelet model DARTS provide three kinds former Raw dispatching method, respectively static scheduling method, dynamic dispatching method and close take (Work Stealing) dispatching method. Static scheduling method uses the mode of poll successively the Codelet node of activation to be distributed to each scheduler, it is possible to by artificially The metadata of Codelet be set specify the scheduler performing Codelet;Dynamic dispatching method is by complete for the Codelet activated Portion puts in the ready pond (RP) of multi-threaded program scheduler, can take from this ready pond (RP) uniformly during the scheduler free time Codelet;Close to take dispatching method similar with dynamic dispatching method, when certain scheduler free time, can dispatch from other randomly The ready pond (RP) of device takes Codelet.The Codelet dispatching efficiency of the Codelet dispatching method that three of the above is primary is low, be System poor expandability.
The highly simultaneous access being effectively improved the execution of Codelet program unit is the important channel improving this systematic function.Therefore, The present invention proposes a kind of Codelet dispatching method based on genetic algorithm, the three kind scheduling primary compared to Codelet model Method, experiment proves that this dispatching method has a significant effect.
Summary of the invention
The present invention be directed to the primary static scheduling of Codelet model and dynamic dispatching bad adaptability, system concurrency perform Spend low problem, it is proposed that a kind of Codelet dispatching method based on genetic algorithm, with Codelet data-flow computation model be Basis, devises a kind of Codelet dispatching method based on genetic algorithm, and is applied to actual Codelet model, this scheduling Method, when solving Mission Scheduling, uses the coded system of explicit two-dimensional array, is grasped by genetic operators such as hybridization, variations Make, two arrays " are merged " and produces new array as follow-on solution.Experimental verification the method can improve multi-core parallel concurrent system The utilization rate of the system efficiency of tasks carrying and hardware resource is it was confirmed the effectiveness of the method.
The technical scheme is that a kind of Codelet dispatching method based on genetic algorithm, specifically include following step Rapid:
1) import a Codelet data flow diagram, calculate the degree of depth of codelet, and Task Switching is become two-dimensional matrix, meter Calculate scheduling time:
One Codelet data flow diagram includes
A, n Codelet node V={V0, V1..., Vn-1};
B, each Codelet internodal directed edge dependence < Vi, Vj> represent node ViWith VjDependence, ViIt is VjBefore continue, VjIt is ViFollow-up, i.e. Vi∈PRED(Vj), Vj∈SUCC(Vi);
C, the operation time of each Codelet node, Rt (Vi) represent and run node ViThe time spent;
D, the degree of depth of each Codelet node, node ViThe degree of depth0≤d≤ dm, dmIt it is the degree of depth maximum in CDG figure;
Two-dimensional matrix:
The corresponding Codelet data flow diagram of one task, m core processor performs a task, this m core system every The most corresponding scheduler of individual processor core, m scheduler altogether, in each scheduler, with good grounds scheduler task order combines The tasks carrying sequence of Codelet data flow diagram interior joint dependence, QiRepresent that the task included in i-th scheduler is held Line order arranges, i.e. Qi=[Vli,V2i..., Vki]T, wherein k is the sequence length that this scheduler performs node successively;
Scheduling S is expressed as a two-dimensional array matrix, i.e. S=[Q1, Q2..., Qm];
Scheduling time:
Combining each Codelet node in task according to scheduling S and run time and the degree of depth, the system that calculates is according to scheduling S Perform the total time T (S) that all Codelet nodes are spent;
2) stochastic generation initial solution group POP (t), t=0:
Initial solution is mined massively and is used the mode stochastic generation of mean allocation, and the task queue on the most each scheduler is comprised Codelet quantity is essentially identical, thus has reduced the gap of task queue required time on each scheduler;
3) according to selected fitness function, the adaptive value that initial solution group respectively solves is calculated;
4) detect whether that meeting iteration convergence stops condition, skips to step 10 if meeting), otherwise perform step 5);
5) roulette is used, the parent of selection hybridization:
Calculate and solve each adaptive value solved in group, and addition draws adaptive value summation;Calculate the adaptive value of individuality solution with suitable Should be worth the ratio of summation, the ratio drawn is to select individual probit;Select to adapt to strong two from Xie Qunzhong according to probit Individual solution is individual as the parent of crossover operation;
6) rule of thumb set probability P c, according to step 5) selected individual probit more than Pc, then perform outside miscellaneous Hand over operation, perform internal hybrid operation less than Pc;
7) rule of thumb set probability P m, perform mutation operation with probability P m;
8) use elitism strategy, retain original optimal solution solved in group:
Retain the solution that in former solution group, adaptive value is the highest, be designated as B (t)=Best (POP (t));Calculate individual in new explanation group solution Adaptive value, note new explanation group in optimal solution be B (t+1)=Best (POP (t+1));Worst solution in POP (t+1) is replaced Become the optimal solution in POP (t);
9) using optimal solution as new solution group POP (t+1), t=t+1, calculating the adaptive value that new solution group respectively solves, return is held Row step 4);
10) output approximate optimal solution.
Described step 6) peripheral crossover operation step is as follows:
The part performing swap operation is all task sequences between all scheduling:
(1) two scheduling S1 and S2 are randomly selected;
(2) stochastic generation two number d '1And d '2As the degree of depth of hybridization point, and 0 <=d '1, d '2<=dm
(3) by d '1And d '2Determine the mode and position operated of intersecting;
(4) if d '1With d '2Equal, perform two-point crossover operation, by two parts hybridized between point in scheduling S1 and S2 (set of task sequence fragment) is exchanged with each other;
(5) if d '1With d '2, perform single-point intersection operation, the part after S1 with S2 hybridization point will be dispatched and be exchanged with each other.
Described step 6) in internal hybrid operating procedure as follows:
The part performing swap operation is execution swap operation between all task sequences in each scheduler:
I, from one scheduling S randomly select two task sequence Q1 and Q2;
II, stochastic generation two number d '1And d '2As the degree of depth of hybridization point, and 0 <=d '1, d '2<=dm
III, by d '1And d '2Determine the mode and position operated of intersecting;
If IV is d '1With d '2Equal, perform two-point crossover operation, in task sequence Q1 and Q2 two are hybridized between point Partly (set of Codelet) be exchanged with each other;
If V is d '1With d '2, perform single-point intersection operation, by mutual for the part after hybridization point in task sequence Q1 with Q2 Exchange.
Described step 7) in mutation operation: two nodes under the same degree of depth, stochastic generation in one scheduling of random exchange One number d ', make 0 < d ' < dm;Randomly choosing two degree of depth is the node of d ';Exchange two nodes, produce new explanation.
The beneficial effects of the present invention is: present invention Codelet based on genetic algorithm dispatching method, will be based on multinuclear at The genetic algorithm dispatching method of reason device parallel system combines with the task scheduling of Codelet model, and it is many to be that one can adapt to Assess the Parallel Task Scheduling method of calculation system.This dispatching method can be effectively improved the executed in parallel efficiency of task, reduces and performs The free time of unit, improve the resource utilization of multi-processor system-on-chip.The method can also be extended to other kinds of Data flow model, it is achieved task executed in parallel in multiple nucleus system.
Accompanying drawing explanation
Fig. 1 is Codelet model schematic of the present invention;
Fig. 2 is the algorithm flow chart that the present invention is corresponding;
Fig. 3 is the task of the present invention Codelet scheduling graph on monolithic Dinuclear Systems;
Fig. 4 is the outside crossover operation figure in dispatching algorithm of the present invention;
Fig. 5 is the internal hybrid operation figure in dispatching algorithm of the present invention;
Fig. 6 is the variation swap operation figure in dispatching algorithm of the present invention.
Detailed description of the invention
The present invention based on Codelet model as task in multi-core parallel concurrent system basis perform model.Codelet is Comprise the computing unit of a succession of machine instruction or the fragment of program, corresponding to an execution node in data flow diagram. Codelet model is made up of performance element Codelet and multi-threaded program TP.As a example by the schematic diagram of Fig. 1 Codelet model, S Represent start node and the end node of Codelet figure respectively with E, A, B, C, D are the program in the middle of tasks carrying process respectively Cell node;Multi-threaded program is the container of all Codelet nodes in each scheduler, the data sharing being responsible in scheduler with And the task coordinate between scheduler.The semanteme that Codelet node performs is: the sync cap of and if only if Codelet is corresponding When dependence data are the most ready, Codelet node is automatically activated, and by Codelet task in the case of hardware resource meets Scheduler controls to perform the usability of program fragments (job sequence) in Codelet node.This model is many by becoming to comprise by Task Switching The Codelet data flow diagram of weight dependence, and by Codelet node according to certain dispatching method specified distribution extremely each tune In the task queue that degree device is corresponding.
The core concept of the present invention is that certain task is divided into multiple subtask, and is expressed as the number of a directed acyclic According to flow graph;Again this data flow diagram is mapped on Codelet model.The configuration calculating system hardware resources according to multinuclear can be by Codelet data flow diagram explicit conversion becomes a two-dimensional array matrix, and this certain two-dimensional array vector correspondence task therein exists Scheduling sequence on certain Codelet node.Meeting between each Codelet on the premise of data dependence relation, the most randomly Codelet node is assigned on hardware resource, completes the initialization to task scheduling;Then according to genetic algorithm through repeatedly Iterative evolution show that Codelet model performs the optimal scheduling scheme of this task.
Codelet scheduling flow based on genetic algorithm is as shown in Figure 2: specifically comprise the following steps that
(1) import a Codelet data flow diagram (CDG), calculate the degree of depth of codelet, and Task Switching is become two dimension Matrix, calculates scheduling time;
(2) stochastic generation initial solution group POP (t), t=0;
(3) according to fitness function, calculate, by scheduling time, the adaptive value that initial solution group respectively solves;
(4) detect whether to meet convergence termination condition, skipping to step (10) if meeting, otherwise performing step (5);
(5) use roulette, select the parent of hybridization;
(6) rule of thumb set probability P c, be more than Pc according to the probit of selected parent, then perform outside hybridization behaviour Make, perform internal hybrid operation less than Pc;
(7) rule of thumb set probability P m, perform mutation operation with probability P m;
(8) use elitism strategy, retain original optimal solution solved in group;
(9) using optimal solution as new solution group POP (t+1), t=t+1, the new adaptive value that group respectively solves that solves, return are calculated Perform step (4);
(10) output approximate optimal solution.
Dispatching method in the present invention generates the process of optimal solution and includes four nucleus modules: the table of (1) Codelet scheduling Show, the expression of (2) fitness function, the generation of (3) initial solution group, (4) operation operator.
The expression of 1.Codelet scheduling
First, task is convertible into Codelet figure (CDG) (Chinese Codelet number in Codelet model According to flow graph), corresponding data flow diagram CDG can convert corresponding to a two-dimensional matrix.The dimension of two-dimensional array matrix corresponding certain Individual cluster or multinuclear calculate the scheduler quantity that system is comprised.Therefore, task scheduling in Codelet model is asked Topic, the present invention be given following some definition:
I. note G is certain CDG figure, and this figure representation is G=<V, E, Rt, d>, then have:
V represents the set of n node (Codelet), i.e. V={V0,V1..., Vn-1};
E represents the set of internodal directed edge (dependence), < Vi, Vj> represent node ViWith VjDependence, ViIt is VjBefore continue, VjIt is ViFollow-up, i.e. Vi∈PRED(Vj), Vj∈SUCC(Vi);
Rt represents the operation time of certain Codelet node, Rt (Vi) represent and run node ViThe time spent;
D represents the degree of depth of certain Codelet node, node ViThe degree of depth may be defined as:
0≤d≤dm, dmIt it is the degree of depth maximum in CDG figure.
Wherein, the degree of depth is an important parameter of CDG figure, for generating initial solution group and judging the legal of genetic algorithm solution Property.
Fig. 3 is task Codelet scheduling graph on monolithic Dinuclear Systems, the wherein stream of Codelet data shown in Fig. 3 (a) Figure, this CDG figure contains 7 Codelet nodes (V0~V6), and the information of each node includes the operation time Rt of Codelet With degree of depth d (Rt of such as V0 is 3, and d is 0), arrow represents the internodal dependence of Codelet.
Ii. note S is the scheduling of certain CDG figure, and this scheduling is represented by S=<C, Q>, then have:
C represents the set of m scheduler, i.e. C=[C0,C1..., Cm-1], CiRepresent that ID is the scheduler of i;
·QiRepresent scheduler CiIncluded in Codelet tasks carrying sequence, i.e. Qi=[V1i, V2i..., Vki]T, its Middle k is this scheduler CiPerform the sequence length of Codelet node successively;
Scheduling S can be expressed as a two-dimensional array matrix, i.e. S=[Q1, Q2..., Qm]。
Owing to scheduler is that the order according to task sequence performs Codelet successively, upset original in CDG figure depending on Bad relation may make task normally to perform.Therefore, in order to ensure that system can normally perform Codelet according to scheduling, Before performing dispatching method and calculating, first the node in task sequence is carried out ascending order arrangement by the node degree of depth.
The scheduling schematic diagram of CDG figure as shown in Fig. 3 (b), it is assumed that perform certain task T on certain polycaryon processor, should The most corresponding scheduler of each processor core of multiple nucleus system.If for this Dinuclear Systems have two scheduling S1 and S2, two scheduling S1 and S2 can complete to perform identical task T, the most corresponding task sequence of each scheduling, each task Sequence represents that scheduler performs the order of Codelet node.In figure, S1 can be expressed as { [V0, V1, V3, V6], [V2, V4, V5] }, S2 can be expressed as { [V0, V2, V5], [V1, V3, V4, V6] }.
Iii. remember that T (S) performs the total time that all Codelet nodes are spent, Ts (Q by system according to scheduling Si) for holding Row task sequence QiUnder total time of being spent of all Codelet, then have T (S)=MAX (Ts (Qi)),Fig. 3 (c) combines Fig. 3 (a) each Codelet node for the scheduler task order according to Fig. 3 (b) and runs The system that time and the degree of depth are drawn performs the schematic diagram of total time, and scheduling S1 and the S2 execution cost time is respectively T (S1)=14, T (S2)=13.
According to defined above, the scheduling in Codelet model of task is finally convertible into a two-dimensional array square Battle array.The target of Codelet scheduling is to find, for multiple nucleus system, the scheduling S that a kind of overall situation is optimal, makes Codelet node according to set Order executed in parallel in multiple schedulers, and it is minimum to make system perform total time of task, i.e. MIN (T (S)),
2. fitness function
Fitness function describes and uses the communication overhead between execution time of each Codelet node and Codelet to estimate Task execution total time in systems, and solve the evaluation index of superiority-inferiority using the adaptive value of this function as certain.Such as: figure 3 illustrate same task performs on monolithic polycaryon processor two kinds scheduling execution total times, scheduling S1 the execution time be 14, and the execution time dispatching S2 is 13.Therefore, according to adaptive value T (S1) > T (S2), then scheduling S2 is better than scheduling S1.
Adaptive value is for evaluating individual good and bad standard in genetic algorithm, the present invention fitness function is defined as f (S)= C-T (S), wherein, c is set as certain sufficiently large constant, can be such as the total of all Codelet pre-execution time with value With, i.e.T (S) be system after distributing Codelet node, perform the total time of all Codelet.Cause This, f (S) is the biggest, and the total time that expression system has performed this task is the shortest.Such as Fig. 3 (c), the execution time of scheduling S1 is T (S1) it is c=20 that=14, all Codelet perform temporal summation, then adaptive value f (S1)=c-T (S1)=6, and scheduling S2 is corresponding Adaptive value f (S2)=c-T (S2)=7, fitness function can use addition according to calculating autonomous setting, present invention subtraction Can also.
3. initial solution group
Initial solution is mined massively and is used the mode stochastic generation of mean allocation, and the task queue on the most each scheduler is comprised Codelet number of nodes is essentially identical, thus has reduced the gap of task queue required time on each scheduler.In order to enter One step improves the quality of initial solution group, and this algorithm can first generate M initial solution, calculates each adaptive value solved, Cong Zhongxuan afterwards Take the big solution of N (N < M) individual adaptive value as initial solution group.
Owing to Codelet model is a kind of data streams in parallel computation model, Codelet node can be equally distributed to Scheduler.Note n (i) is that in CDG figure, the degree of depth is the Codelet number of nodes of i, and m is the quantity of scheduler, and sets ave (i)= N (i)/m, it is [ave (i), ave (i)+1] that the Codelet node of the most same degree of depth is assigned to the quantity of each scheduler, and respectively The summation of the Codelet number of nodes that scheduler is assigned to should be equal to n (i).By the Codelet under same scheduler by degree of depth liter The most available legal task sequence of sequence arrangement, is an initial solution, and the Codelet of each scheduler is arranged by degree of depth ascending order Row obtain each legal task sequence, form an initial solution group.
The quality of initial solution group determines the speed of genetic algorithm convergence, and the solution being initially generated has the strongest random Property.In order to further speed up the speed of Algorithm for Solving, prevent Premature Convergence, the meeting multiple initial solution of prior stochastic generation, calculating After each adaptive value solved, the outstanding solution that therefrom screening adaptive value is high is as actual initial solution, to improve the quality of initial solution group.
4. operation operator
In genetic algorithm, selection and the evolution of Xie Qun are realized by sequence of operations operator.These operation operators Including selection opertor, Crossover Operator and mutation operator, selection opertor can use roulette as the method choosing individual solution, And use elitism strategy as retaining excellent individual solution to follow-on method;In order to expand region of search, Crossover Operator is according to miscellaneous The difference handing over object can be divided into again outer Crossover Operator and internal hybrid operator;The most identical according to hybridization point, the intersection behaviour of hybridization Single-point it is divided into again to intersect and two-point crossover;Mutation operator uses traditional swap operation, i.e. exchanges two in single solution Codelet node.
I. selection opertor-roulette
The mechanism of selection is that the size according to adaptive value selects and retains excellent individual, eliminates the process of worst individual.This The mode of bright employing roulette determines that the parent that each iteration carries out hybridizing is individual.Detailed process is as follows:
(1) calculate each adaptive value solved in solution group, and addition draws adaptive value summation;
(2) calculating adaptive value and the ratio of adaptive value summation that individuality solves, the ratio drawn is to select individual probit;
(3) according to the principle (according to the adaptive value algorithm of the present invention, the biggest more excellent) that probit is the biggest more excellent, from Xie Qunzhong Choose two individual solutions individual as the parent of crossover operation.
Ii. outside Crossover Operator
Before carrying out crossover operation, rule of thumb it is set for outside probability of crossover Pc, general Pc=0.7~0.9, institute Outside crossover operation is carried out, selected by outside crossover operation when the probit of the parent individuality selected is more than probability P c selected Parent individuality is scheduling, two scheduling i.e. obtained by selection opertor, and the part performing swap operation is all of two scheduling Task sequence.Detailed process is as follows:
(1) two scheduling S1 and S2 are randomly selected;
(2) stochastic generation two number d '1And d '2As the degree of depth of hybridization point, and 0 <=d '1, d '2<=dm
(3) by d '1And d '2Determine the mode and position operated of intersecting;
(4) if d '1With d '2Equal, perform two-point crossover operation, by two parts hybridized between point in scheduling S1 and S2 (set of task sequence fragment) is exchanged with each other;
(5) if d '1With d '2, perform single-point intersection operation, the part after S1 with S2 hybridization point will be dispatched and be exchanged with each other.
As shown in Figure 4, two scheduling perform outside crossover operation, and in figure, the degree of depth of two hybridization points is respectively 0 and 2, Therefore, degree of depth Codelet (i.e. the degree of depth is the Codelet of 1 and 2) between 0 and 2 in two scheduling need to be performed two-point crossover Operation, i.e. dispatches the dashed box part of S1 and scheduling S2 in crossing-over map 4.(Q2 in S1 and S2 all occurs in that the degree of depth is 2 two Codelet, explains outside the intersection according to Fig. 4)
Iii. internal hybrid operator
Unlike the hybridization of outside, the operation object of internal hybrid is individual solution rather than solution group, i.e. to two schedulers In two task sequence Q1 and Q2 in any one scheduler perform swap operations, therefore typically do not do the situations of outside hybridization Under make internal hybrid, outside hybridization and internal hybrid effect can be compared in case of doubt, then determine.Internal Hybridization detailed process is as follows:
(1) from a scheduling S, two task sequence Q1 and Q2 are randomly selected;
(2) (3) step is identical with outside crossover operation;
(4) if d '1With d '2Equal, perform two-point crossover operation, in task sequence Q1 and Q2 two are hybridized between point Partly (set of Codelet) be exchanged with each other;
(5) if d '1With d '2, perform single-point intersection operation, by the part phase after hybridization point in task sequence Q1 with Q2 Interchangeable.
Fig. 5 illustrates the operation of twice internal hybrid, and wherein, the hybridization point degree of depth corresponding for scheduling S1 is respectively 1 and 2, therefore Perform is two-point crossover operation, and the part of intersection is degree of depth Codelet (the i.e. degree of depth between 1 and 2 in two task sequences It is the Codelet of 2);Owing to the hybridization point degree of depth of scheduling S2 is 1, therefore perform is single-point intersection operation, the part of intersection It is the degree of depth Codelet more than 1 in two task sequences.
Iv. mutation operator
Mutation operation is that iteration produces new individual supplementary mode, can be maintained the multiformity understanding group by variation, accelerate The convergence rate of optimal solution.Mutation operator uses traditional swap operation, the most at random in exchange one scheduling under the same degree of depth Two nodes.Detailed process is as follows:
(1) stochastic generation one number d ', make 0 < d ' < dm
(2) randomly choosing two degree of depth is the node of d ';
(3) two nodes of exchange, produce new explanation.
As shown in Figure 6, scheduling S1 performs mutation operation, and the degree of depth selecting variation is 2, and the Codelet meeting condition has V3, V4 and V5, therefore these three Codelet is when performing mutation operation, can randomly select two transpositions.
V. selection opertor-elitism strategy
Owing to the selection mode of roulette is based on probability selection, therefore there is statistical error, in order to by excellent individual Retaining to of future generation, it is ensured that the adaptive value monotonic increase of iteration optimal solution every time, retention mechanism uses elitism strategy, this strategy The outstanding solution that main thought is to maintain the adaptive value of Xie Qunzhong big is not lost.Detailed process is as follows:
(1) retain the solution that in former solution group, adaptive value is the highest, be designated as B (t)=Best (POP (t));
(2) calculating the individual adaptive value solved in new explanation group, the optimal solution in note new explanation group is B (t+1)=Best (POP (t+ 1));
(3) the worst solution in POP (t+1) is replaced to the optimal solution in POP (t).
The group's operation by above each genetic operator of old solution, has finally given new explanation group, and the adaptive value of newly-generated solution group Must be not less than original solution group, therefore, this genetic algorithm gradually can be received to optimal solution (i.e. optimal scheduling) after successive ignition Hold back.
5. the condition of convergence
Reasonably convergence termination condition is set, the solution that genetic algorithm is generated can be made closer to preferable optimal solution.In order to Generating outstanding solution within the shortest time, the present invention is provided with the following two condition of convergence:
(1) genetic algorithm convergence after given iteration convergence threshold value, adaptive value remains unchanged (real in the test of this invention Testing and arranging threshold value is 500, can be fixed according to test object), the solution being newly generated is exported as final result;
(2) if genetic algorithm does not restrains after given iteration convergence threshold value, when iterations exceedes given Greatest iteration threshold value (the greatest iteration threshold value arranged in the testing experiment of this invention is 2000, can be fixed according to test object) After, for avoiding expending the too many time during generating optimal solution, using defeated as the optimal solution of approximation for the solution being newly generated Go out.

Claims (4)

1. a Codelet dispatching method based on genetic algorithm, it is characterised in that specifically include following steps:
1) import a Codelet data flow diagram, calculate the degree of depth of codelet, and Task Switching is become two-dimensional matrix, calculate and adjust Spend the time:
One Codelet data flow diagram includes
A, n Codelet node V={V0, V1..., Vn-1};
B, each Codelet internodal directed edge dependence < Vi, Vj> represent node ViWith VjDependence, ViIt is Vj's Before continue, VjIt is ViFollow-up, i.e. Vi∈PRED(Vj), Vj∈SUCC(Vi);
C, the operation time of each Codelet node, Rt (Vi) represent and run node ViThe time spent;
D, the degree of depth of each Codelet node, node ViThe degree of depth0≤d≤dm, dm It it is the degree of depth maximum in CDG figure;
Two-dimensional matrix:
One corresponding Codelet data flow diagram of task, m core processor performs a task, each place of this m core system The most corresponding scheduler of reason device core, m scheduler altogether, in each scheduler, with good grounds scheduler task order combines The tasks carrying sequence of Codelet data flow diagram interior joint dependence, QiRepresent that the task included in i-th scheduler is held Line order arranges, i.e. Qi=[V1i, V2i..., Vki]T, wherein k is the sequence length that this scheduler performs node successively;
Scheduling S is expressed as a two-dimensional array matrix, i.e. S=[Q1, Q2..., Qm];
Scheduling time:
Combining each Codelet node in task according to scheduling S and run time and the degree of depth, the system that calculates performs according to scheduling S The total time T (S) that all Codelet nodes are spent;
2) stochastic generation initial solution group POP (t), t=0:
Initial solution is mined massively and is used the mode stochastic generation of mean allocation, and the task queue on the most each scheduler is comprised Codelet quantity is essentially identical, thus has reduced the gap of task queue required time on each scheduler;
3) according to selected fitness function, the adaptive value that initial solution group respectively solves is calculated;
4) detect whether that meeting iteration convergence stops condition, skips to step 10 if meeting), otherwise perform step 5);
5) roulette is used, the parent of selection hybridization:
Calculate and solve each adaptive value solved in group, and addition draws adaptive value summation;Calculate adaptive value and adaptive value that individuality solves The ratio of summation, the ratio drawn is to select individual probit;According to probit from Xie Qunzhong select to adapt to strong two each and every one Body solution is individual as the parent of crossover operation;
6) rule of thumb set probability P c, according to step 5) selected individual probit more than Pc, then perform outside hybridization behaviour Make, perform internal hybrid operation less than Pc;
7) rule of thumb set probability P m, perform mutation operation with probability P m;
8) use elitism strategy, retain original optimal solution solved in group:
Retain the solution that in former solution group, adaptive value is the highest, be designated as B (t)=Best (POP (t));In calculating new explanation group, individual solution is suitable Should be worth, the optimal solution in note new explanation group is B (t+1)=Best (POP (t+1));Worst solution in POP (t+1) is replaced to POP Optimal solution in (t);
9) using optimal solution as new solution group POP (t+1), t=t+1, calculating the new adaptive value that group respectively solves that solves, return performs step Rapid 4);
10) output approximate optimal solution.
Codelet dispatching method based on genetic algorithm the most according to claim 1, it is characterised in that described step 6) in Outside crossover operation step is as follows:
The part performing swap operation is all task sequences between all scheduling:
(1) two scheduling S1 and S2 are randomly selected;
(2) stochastic generation two number d '1And d '2As the degree of depth of hybridization point, and 0≤d '1, d '2≤ dm
(3) by d '1And d '2Determine the mode and position operated of intersecting;
(4) if d '1With d '2Equal, perform two-point crossover operation, by two part (tasks hybridized between point in scheduling S1 and S2 The set of sequence fragment) it is exchanged with each other;
(5) if d '1With d '2, perform single-point intersection operation, the part after S1 with S2 hybridization point will be dispatched and be exchanged with each other.
Codelet dispatching method based on genetic algorithm the most according to claim 1, it is characterised in that described step 6) in Internal hybrid operating procedure is as follows:
The part performing swap operation is execution swap operation between all task sequences in each scheduler:
I, from one scheduling S randomly select two task sequence Q1 and Q2;
II, stochastic generation two number d '1And d '2As the degree of depth of hybridization point, and 0≤d '1, d '2≤ dm
III, by d '1And d '2Determine the mode and position operated of intersecting;
If IV d '1With d '2Equal, perform two-point crossover operation, by task sequence Q1 and Q2 two parts hybridized between point (set of Codelet) is exchanged with each other;
If V is d '1With d '2, performing single-point intersection operation, the part after hybridizing point in task sequence Q1 with Q2 is mutually handed over Change.
Codelet dispatching method based on genetic algorithm the most according to claim 1, it is characterised in that described step 7) in Mutation operation: two nodes under the same degree of depth, stochastic generation one number d in one scheduling of random exchange ', make 0 < d ' < dm;With Machine selects two degree of depth to be the node of d ';Exchange two nodes, produce new explanation.
CN201610628188.3A 2016-08-03 2016-08-03 Codelet dispatching method based on genetic algorithm Active CN106155799B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610628188.3A CN106155799B (en) 2016-08-03 2016-08-03 Codelet dispatching method based on genetic algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610628188.3A CN106155799B (en) 2016-08-03 2016-08-03 Codelet dispatching method based on genetic algorithm

Publications (2)

Publication Number Publication Date
CN106155799A true CN106155799A (en) 2016-11-23
CN106155799B CN106155799B (en) 2019-07-23

Family

ID=57328833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610628188.3A Active CN106155799B (en) 2016-08-03 2016-08-03 Codelet dispatching method based on genetic algorithm

Country Status (1)

Country Link
CN (1) CN106155799B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108399455A (en) * 2017-02-08 2018-08-14 北京京东尚科信息技术有限公司 Dispatching method based on genetic algorithm and device
CN111797634A (en) * 2020-06-04 2020-10-20 语联网(武汉)信息技术有限公司 Document segmentation method and device
CN112199177A (en) * 2020-10-19 2021-01-08 上海交通大学 SKA task scheduling system and method based on genetic algorithm and computational topology model

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080270331A1 (en) * 2007-04-26 2008-10-30 Darrin Taylor Method and system for solving an optimization problem with dynamic constraints
CN102508708A (en) * 2011-11-30 2012-06-20 湖南大学 Heterogeneous multi-core energy-saving task schedule method based on improved genetic algorithm
CN103345657A (en) * 2013-04-02 2013-10-09 江苏大学 Task scheduling method based on heredity and ant colony in cloud computing environment
CN104932938A (en) * 2015-06-16 2015-09-23 中电科软件信息服务有限公司 Cloud resource scheduling method based on genetic algorithm

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080270331A1 (en) * 2007-04-26 2008-10-30 Darrin Taylor Method and system for solving an optimization problem with dynamic constraints
CN102508708A (en) * 2011-11-30 2012-06-20 湖南大学 Heterogeneous multi-core energy-saving task schedule method based on improved genetic algorithm
CN103345657A (en) * 2013-04-02 2013-10-09 江苏大学 Task scheduling method based on heredity and ant colony in cloud computing environment
CN104932938A (en) * 2015-06-16 2015-09-23 中电科软件信息服务有限公司 Cloud resource scheduling method based on genetic algorithm

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108399455A (en) * 2017-02-08 2018-08-14 北京京东尚科信息技术有限公司 Dispatching method based on genetic algorithm and device
CN108399455B (en) * 2017-02-08 2021-05-25 西安京迅递供应链科技有限公司 Scheduling method and device based on genetic algorithm
CN111797634A (en) * 2020-06-04 2020-10-20 语联网(武汉)信息技术有限公司 Document segmentation method and device
CN111797634B (en) * 2020-06-04 2023-09-08 语联网(武汉)信息技术有限公司 Document segmentation method and device
CN112199177A (en) * 2020-10-19 2021-01-08 上海交通大学 SKA task scheduling system and method based on genetic algorithm and computational topology model
CN112199177B (en) * 2020-10-19 2023-03-31 上海交通大学 SKA task scheduling system and method based on genetic algorithm and computational topology model

Also Published As

Publication number Publication date
CN106155799B (en) 2019-07-23

Similar Documents

Publication Publication Date Title
CN104331321B (en) Cloud computing task scheduling method based on tabu search and load balancing
CN101593132B (en) Multi-core parallel simulated annealing method based on thread constructing module
Kardani-Moghaddam et al. A hybrid genetic algorithm and variable neighborhood search for task scheduling problem in grid environment
CN105159762A (en) Greedy strategy based heuristic cloud computing task scheduling method
CN108255613B (en) SOA system resource management method based on graph coloring
CN109144702A (en) One kind being used for row-column parallel calculation coarse-grained reconfigurable array multiple-objection optimization automatic mapping dispatching method
CN110471762A (en) A kind of cloud resource distribution method and system based on multiple-objection optimization
CN106611231A (en) Hybrid particle swarm tabu search algorithm for solving job-shop scheduling problem
CN106155799B (en) Codelet dispatching method based on genetic algorithm
Heidari et al. Scheduling in multiprocessor system using genetic algorithm
Dorronsoro et al. Combining machine learning and genetic algorithms to solve the independent tasks scheduling problem
CN111813500B (en) Multi-target cloud workflow scheduling method and device
Sassi et al. A decomposition-based artificial bee colony algorithm for the multi-objective flexible jobshop scheduling problem
CN116700176A (en) Distributed blocking flow shop scheduling optimization system based on reinforcement learning
CN114968531A (en) Quantum cloud hybrid task scheduling method and device based on multi-fitness genetic optimization
CN105005503A (en) Cellular automaton based cloud computing load balancing task scheduling method
Jalalian et al. A hierarchical multi-objective task scheduling approach for fast big data processing
Xuan et al. Off-line time aware scheduling of bag-of-tasks on heterogeneous distributed system
Vahidi et al. Optimization of resource allocation in cloud computing by grasshopper optimization algorithm
CN110119317B (en) Cloud computing task scheduling method and system based on genetic algorithm
Alzaqebah et al. Self-adaptive bee colony optimisation algorithm for the flexible job-shop scheduling problem
Zhang et al. A distributed computing framework for All-to-All comparison problems
Cai et al. Hybrid artificial immune system for job shop scheduling problem
Singh Task scheduling in parallel systems using genetic algorithm
CN113031522B (en) Low-power-consumption scheduling method suitable for periodically dependent tasks of open type numerical control system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant