CN103491018A - Load balancing method in large-scale behavior modeling application - Google Patents

Load balancing method in large-scale behavior modeling application Download PDF

Info

Publication number
CN103491018A
CN103491018A CN201310398936.XA CN201310398936A CN103491018A CN 103491018 A CN103491018 A CN 103491018A CN 201310398936 A CN201310398936 A CN 201310398936A CN 103491018 A CN103491018 A CN 103491018A
Authority
CN
China
Prior art keywords
territory
load
piece
data processor
simulated object
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
CN201310398936.XA
Other languages
Chinese (zh)
Other versions
CN103491018B (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.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of 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 Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN201310398936.XA priority Critical patent/CN103491018B/en
Publication of CN103491018A publication Critical patent/CN103491018A/en
Application granted granted Critical
Publication of CN103491018B publication Critical patent/CN103491018B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a load balancing method in large-scale behavior modeling application. The load balancing method comprises the following steps that two hash tables are established, wherein one hash table is used for storing all mock objects in a block, and the other hash table is used for storing all block messages in a domain; the hash tables are initialized, increment computation is conducted repeatedly on loads of all domains until the large-scale behavior modeling application is completed, a domain D after load increment calculating is generated, the domain D is divided to generate a domain set Dset, wherein the load of each domain D2 in the divided domain set Dset is T1, all the blocks are mutually connected, the domain D and adjacent domains in the divided domain set Dset are combined, the load of the combined domain D is T1, all the blocks in the domain D are mutually connected, the domain dispatch among all data processors is carried out, and the load balancing of the data processors is achieved. The load balancing method in the large-scale behavior modeling application is capable of solving the problem that load unbalancing can not be effectively removed in an existing method in the large-scale behavior modeling application.

Description

Load-balancing method in a kind of extensive Behavior modeling application
Technical field
The invention belongs to the teaching method technical field, more specifically, relate to the load-balancing method in a kind of extensive Behavior modeling application.
Background technology
Extensive Behavior modeling application is for the extensive autonomous individual group behavior in the simulating reality world, better learns and understands the phenomenon in real world.Such application is dispersed throughout physics, the fields such as biology and anthropology, for example: shoal of fish simulation, celestial body simulation and traffic simulation etc.Such as aspect traffic, can before a traffic construction, utilize the traffic simulation program, the jam situation of look-ahead road, reduce road and realize later traffic congestion situation.These application are with regular time interval operation.When each Fixed Time Interval, simulated object is collected the information of peripheral simulated object, processes and upgrades the operation of its state information for next time interval.For these extensive Behavior modeling programs of operation parallel on group system, the division of data is to have carried out in the mode in territory.That is to say, whole virtual space is divided into a plurality of territories, and all simulated object in territory are assigned to together and process.Like this just can improve data locality, the completing of faster procedure.
Yet, because simulated object in extensive Behavior modeling can group be carried out the position migration, causing simulated object number in above-mentioned said some territory is the several times decades of times even of simulated object number in its co-domain, causes serious load imbalance.And the simulated object number in each territory, along with the time is also changing, makes present method be difficult to effectively solve this load imbalance problem.
Summary of the invention
Above defect or Improvement requirement for prior art, the invention provides the load-balancing method in a kind of extensive Behavior modeling application, its purpose is to solve existing method in extensive Behavior modeling application and is difficult to the effectively technical problem of the load imbalance of elimination.
For achieving the above object, according to one aspect of the present invention, load-balancing method in a kind of extensive Behavior modeling application is provided, to be applied in a kind of load equalizer, the data of this load equalizer for moving its place data processor data management system, to realize the load balancing between data processor, the method comprises the following steps:
(1) set up two Hash tables, one of them is for depositing all simulated object of piece, and another is for depositing all block messages in territory, and this Hash table is carried out to initialization;
(2) repeat increment calculates the load in each territory, until extensive Behavior modeling application end, with the territory D after the load of generation incremental computations; This step comprises following sub-step:
(2-1) judge whether that the processed complete simulated object of all new rounds is all processed, if yes then enter step (2-8), otherwise enter step (2-2);
(2-2) obtain the new location information (O of the simulated object O after processed in each territory x, O y, O z);
(2-3) according to the new location information of simulated object and calculate the numbering K of this simulated object place piece according to following formula new:
x = Ox / S x y = Oy / S y z = Oz / S z Knew = x + y × Nx + z × Nx × Ny
N wherein x, N yand N zthe extensive Behavior modeling application simulation space x in user-defined edge, the number of blocks of y and z axle, S x, S yand S zbe piece respectively along x, the size of y and z axle;
(2-4) the block number K of gained is calculated in judgement newwhether identical with the block number at simulated object O place after processed, if different, enter step (2-5), otherwise return to step (2-1);
(2-5) by this simulated object from the old K that is numbered oldpiece in take out, and this simulated object is inserted and is numbered K newpiece in, and upgrade in the piece table and be numbered K oldbe numbered K newthe simulated object of piece count information and simulated object list information;
(2-6) judgement is numbered K oldbe numbered K newthe simulated object number change value Δ of piece | whether p| surpasses threshold value T, if surpass, just enters step (2-7), otherwise returns to step (2-1);
(2-7) incremental update is numbered K oldbe numbered K newthe load in territory, piece place and the load of this territory adjacent domains, then return to step (2-1);
(2-8) judge whether that all territories all are disposed, if enter step (5), otherwise enter step (2-9);
(2-9) whether the load that judges the territory D after all incremental computations loads is greater than T max, if so, enter step (3), otherwise enter step (2-10);
(2-10) whether the load that judges the territory D after all incremental computations loads is less than T min, if so, enter step (4), otherwise return to step (2-8);
(3) territory D is divided to generate territory set D set, the territory set D after wherein dividing setin the load of each territory D2 be T1, and piece wherein is all interconnective; This step comprises following sub-step:
(3-1) edge of newly-built territory D2,Cong territory D takes out a load and is less than the piece P1 of T1, and is inserted into territory D2;
(3-2) obtain all set of blocks P that are connected with piece P1 in the D of territory set;
(3-3) from set of blocks P setmiddle taking-up piece P2;
(3-4) after decision block P2 inserts territory D2, whether the load of D2 is less than T1, if so, enters step (3-5), otherwise enters step (3-7);
(3-5) piece P2 is inserted to D2, and upgrade the load of D2;
(3-6) obtain set of blocks adjacent with P2 in D, and it is incorporated to set P set, then return to step (3-3);
(3-7) D2 is inserted to resultant field set D set;
(3-8) whether the load that judges D still is greater than T max, if so, return to step (3-1), otherwise return to step (2-8);
(4) by territory D and its territory set D after division setin adjacent domains merged, the load of the territory D after wherein merging is T1, and the piece in the D of territory is all interconnective;
(5) carry out the domain scheduling between each data processor, realize the load balancing of data processor, wherein each territory of same data processor interconnects.
(6) notice tasks carrying device starts the execution of an extensive Behavior modeling application new round;
(7) judge that whether extensive Behavior modeling program new round calculating finishes, and if so, enters step (8), otherwise returns to step (7);
(8) judge whether extensive Behavior modeling program has reached user-defined termination condition, if so, finishes the operation of load equalizer, otherwise return to step (2).
Preferably, step (1) comprises following sub-step:
(1-1) set up a piece table and a territory table, wherein the piece table is for depositing all simulated object of piece, the corresponding data group of each list item, and comprise that four are listd: first lists the key assignments for memory block, lising for second is a chained list, the key assignments that is used for the adjacent block of memory block, the 3rd simulated object number of lising for memory block, lising for the 4th is a chained list, all simulated object information for memory block, the territory table is for depositing all block messages in territory, each list item is a corresponding data group also, and comprise that four are listd: first is listd for storing the key assignments in territory, list for storing the load in territory for second, list for storing the adjacent domains information in territory for the 3rd, lising for the 4th is a chained list, for storing the key assignments of all that territory comprises,
(1-2) the whole virtual space of extensive Behavior modeling application is divided into to the piece of fixed size, the information of all is filled out in the write-in block table, and be averagely allocated to a plurality of territories by all;
(1-3) load in all territories of initialization:
(1-4) notice tasks carrying device starts the execution of extensive Behavior modeling application.
Preferably, step (1-3) is to adopt following formula:
Cost ( D ) = Σ P ∈ D Cost ( P ) Cost ( P ) = | P | × Σ Q ∈ Neighbors ( P ) | Q | ,
Cost(D wherein) and the Cost(P) load of representative domain D and the load of the piece P in IncFlds D respectively, and | P| and | Q| means respectively the simulated object quantity that piece P and piece Q comprise, and Neighbors(P) means the adjacent block set of piece P.
Preferably, step (2-7) is to adopt following formula:
Cost ( D ) = Cost ( D ) + Σ P ∈ D ΔCost ( P ) ΔCost ( P ) = | P | × ΔN + Δ | P | × N + Δ | P | × ΔN ΔN = Σ Q ∈ Neighbors ( P ) Δ | Q | ,
Wherein Δ means the difference to dependent variable.
Preferably, step (4) comprises following sub-step:
(4-1) obtain first adjacent domains D1 of territory D;
(4-2) judge that whether D1Yu territory, territory D is at same data processor, and their load sum is less than threshold value T1, if so, enters step (4-3), otherwise enter step (4-4);
(4-3) territory D1 is merged in the D of territory, and the more load of neofield D, step (4-4) then entered;
(4-4) obtain the next adjacent domains D1 of D;
(4-5) judge that whether D1 is empty, if so, returns to step (2-8), otherwise enters step (4-2).
Preferably, step (5) comprises following sub-step:
(5-1) whether the load that judges current data processor, over threshold value Tt, if so, enters step (5-2), otherwise enters step (6);
(5-2) obtain a territory D of current data processor;
(5-3) obtain the data processor set W at all territory place adjacent with territory D;
(5-4) take out the data processor w1 of least-loaded in W;
(5-5) whether the load that judgement moves to territory D after data processor w1 is less than Tt, if so, enters step (5-6), otherwise enters step (5-7);
(5-6) territory D is moved to data processor w1 above, then enter step (5-1);
(5-7) obtain the data processor WL of least-loaded on all data processors, territory D is moved to this data processor WL above, and enter step (5-1).
In general, the above technical scheme of conceiving by the present invention compared with prior art, can obtain following beneficial effect:
1, load balancing, the cluster utilance is high, program operation speed is fast: because step (2) can solve task load, calculate inaccurate problem, step (3) and step (4) can be divided/merge extremely excessive/too small task of load and be solved extremely unbalanced problem of load, step (5) can be carried out load imbalance problem between data processor, therefore this method can be eliminated the load imbalance in extensive Behavior modeling application, improve the resource utilization of large-scale cluster system, accelerate the speed of simulation program.
2, run-time overhead is few: the load of obtaining each task that can increment due to step (2) solves all task loads and will recalculate the overhead issues of bringing at every turn, step (3-5) only needs on the node that extremely excessive/too small task of load was divided/merged to increment and the part task on the too much node of task quantity of only need to moving is very few to task quantity to solve virtual space all needs to repartition the overhead issues with the mass data migration brought far from it of twice of front and back division result at every turn, so the expense of this method is few.
The accompanying drawing explanation
Fig. 1 is the applied environment figure of the load-balancing method in the extensive Behavior modeling application of the present invention.
Fig. 2 is the flow chart of the load-balancing method in the extensive Behavior modeling application of the present invention.
Fig. 3 is the refinement flow chart of step in the inventive method (3).
Fig. 4 is the refinement flow chart of step in the inventive method (4).
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.In addition, below in each execution mode of described the present invention involved technical characterictic as long as form each other conflict, just can mutually not combine.
General thought of the present invention is, a kind of load-balancing algorithm of increment has been proposed, it can be by the load of each territory of effective real-time assessment (each territory is processed by a task of correspondence), carry out the division of automatic territory and merging on the basis of former division result, effectively guarantee that the load in each territory is much the same.When new one takes turns analog computation and starts, when surpassing high threshold, the load in certain territory just divided; When the load in certain territory during lower than lowest threshold, just it and its adjacent domains are merged, reduce the quantity in territory, finally between data processor, carry out domain scheduling, guarantee the load balancing between each data processor, thereby effectively eliminate the serious load imbalance that in extensive simulation application, group's migration brings, improve the utilance of large-scale cluster, accelerate the simulation program speed of service.
As shown in Figure 1, load-balancing method in the extensive Behavior modeling application of the present invention is to be applied in a kind of system (abbreviation runtime system) of support program operation, this system comprises task manager and data processor, wherein task manager is for initialization and the end of management data processor, data processor is for the treatment of the data of distributing to it, and comprise load equalizer of the present invention, data management system and tasks carrying device, load equalizer is for the load between balanced each data processor, data management system is distributed to the data of its affiliated data processor for management, the tasks carrying device is for carrying out the data that user program comes the deal with data manager to manage.
As shown in Figure 2, load-balancing method in the extensive Behavior modeling application of the present invention is to be applied in a kind of load equalizer, the data of this load equalizer for moving its place data processor data management system, to realize the load balancing between data processor, the method comprises the following steps:
(1) set up two Hash tables, one of them is for depositing all simulated object of piece, and another is for depositing all block messages in territory, and this Hash table is carried out to initialization, and this step comprises following sub-step:
(1-1) set up a piece table and a territory table.The piece table is for depositing all simulated object of piece, the corresponding data group of each list item, and comprise that four are listd: first lists the key assignments for memory block, lising for second is a chained list, the key assignments that is used for the adjacent block of memory block, the 3rd simulated object number of lising for memory block, lising for the 4th is a chained list, for all simulated object information of memory block, it is specifically as shown in table 1.
The piece key assignments The adjacent block key assignments The simulated object number The simulated object information comprised
? ? ? ?
? ? ? ?
Table l
The territory table is for depositing all block messages in territory, each list item is a corresponding data group also, and comprise that four are listd: first is listd for storing the key assignments in territory, list for storing the load in territory for second, list adjacent domains information for storing territory (comprising key assignments, place data processor number and the load of adjacent domains) for the 3rd, lising for the 4th is a chained list, the key assignments of all comprised for storing territory, and it is specifically as shown in table 2;
The territory key assignments The territory load Adjacent domains information The piece key assignments comprised
? ? ? ?
? ? ? ?
Table 2
The advantage of this sub-step is, by setting up Hash table, can be conducive to fast finding, insertion and the renewal in piece and territory.
(1-2) the whole virtual space of extensive Behavior modeling application is divided into to the piece of fixed size, the information of all is filled out in the write-in block table, and be averagely allocated to a plurality of territories by all; The quantity in territory and user-defined number of tasks are equal, and the quantity of piece is to be specified by the user;
(1-3) according to the load in all territories of following formula initialization:
Cost ( D ) = Σ P ∈ D Cost ( P ) Cost ( P ) = | P | × Σ Q ∈ Neighbors ( P ) | Q | ,
Wherein Cost (D) and the load of Cost (P) difference representative domain D and the load of the piece P in IncFlds D, and | P| and | Q | mean respectively the simulated object quantity that piece P and piece Q comprise, these two values can obtain by the query block table, wherein Neighbors (P) means the adjacent block set of piece P, and this value also can obtain by the query block table.
(1-4) notice tasks carrying device starts the execution of extensive Behavior modeling application;
The advantage of this step is, can know each take turns analog computation and complete after the position of the residing new piece of model objects.
(2) repeat increment calculates the load in each territory, until extensive Behavior modeling application end, with the territory D after the load of generation incremental computations; This step comprises following sub-step:
(2-1) judge whether that the processed complete simulated object of all new rounds is all processed, if yes then enter step (2-8), otherwise enter step (2-2);
(2-2) obtain the new location information (O of the simulated object O after processed in each territory x, O y, O z);
(2-3) according to the new location information of simulated object and calculate the numbering K of this simulated object place piece according to following formula new:
x = Ox / S x y = Oy / S y z = Oz / S z Knew = x + y × Nx + z × Nx × Ny
N wherein x, N yand N zthe extensive Behavior modeling application simulation space x in user-defined edge, the number of blocks of y and z axle, and S x, S yand S zbe piece respectively along x, the size of y and z axle, each piece is S x* S y* S zsize.Obvious S x, S yand S zcan by by virtual space along x, the size of y and z axle is respectively divided by number of blocks N x, N yand N zobtain;
(2-4) the block number K of gained is calculated in judgement newwhether identical with the block number at simulated object O place after processed, judge whether simulated object O moves between piece.If different, enter step (2-5), otherwise return to step (2-1);
(2-5) by this simulated object from the old K that is numbered oldpiece in take out, and this simulated object is inserted and is numbered K newpiece in, and upgrade in the piece table and be numbered K oldbe numbered K newthe simulated object of piece count information and simulated object list information;
(2-6) judgement is numbered K oldbe numbered K newthe simulated object number change value Δ of piece | P| whether surpass threshold value T(wherein T be more than or equal to 1 positive integer, generally be set as T and be more than or equal to 50), if surpass, just enter step (2-7), otherwise return to step (2-1);
The advantage of this sub-step is the calculating that can avoid invalid, and this is because a small amount of simulated object number changes the impact of load imbalance degree few;
(2-7) be numbered K according to following formula incremental update oldbe numbered K newthe load in territory, piece place and the load of this territory adjacent domains, then return to step (2-1),
Cost ( D ) = Cost ( D ) + Σ P ∈ D ΔCost ( P ) ΔCost ( P ) = | P | × ΔN + Δ | P | × N + Δ | P | × ΔN ΔN = Σ Q ∈ Neighbors ( P ) Δ | Q |
Wherein Δ means the difference to dependent variable, be the difference that Δ Cost (P) means Cost (P), Δ N means the difference of N, Δ | P| means the difference of P, Δ | Q| means the difference of Q, and the advantage of this sub-step is to avoid a large amount of loads to recalculate the expense of bringing;
(2-8) judge whether that all territories all are disposed, if enter step (5), otherwise enter step (2-9);
(2-9) whether the load that judges the territory D after all incremental computations loads is greater than T max(T wherein maxbe to be more than or equal to 1 positive integer, be traditionally arranged to be T maxbe more than or equal to 4), if so, enter step (3), otherwise enter step (2-10);
(2-10) whether the load that judges the territory D after all incremental computations loads is less than T min(T wherein minspan is 0<T min≤ 1, be traditionally arranged to be 0<T min≤ 1/4), if so, enter step (4), otherwise return to step (2-8);
The advantage of this step (2) is the load in each territory of calculating of increment, need to when each takes turns analog computation, not recalculate the load in all territories, thereby can effectively accurately obtain the load in each territory.
(3) territory D is divided to generate territory set D set, the territory set D after wherein dividing setin the load of each territory D2 be T1(wherein T1 be more than or equal to 1 positive integer), and piece wherein is all interconnective.
The advantage of this step is only to need to divide the great territory of load, before and after making, twice division result is basically identical, thereby reduce the Data Migration amount of step (5), and can guarantee that all in same territory interconnect, thereby better utilize naturally occurring data locality in the Behavior modeling application.
As shown in Figure 3, this step specifically comprises following sub-step:
(3-1) edge of newly-built territory D2,Cong territory D takes out a load and is less than the piece P1 of T1, and is inserted into territory D2;
(3-2) obtain all set of blocks P that are connected with piece P1 in the D of territory set;
(3-3) from set of blocks P setmiddle taking-up piece P2;
(3-4) after decision block P2 inserts territory D2, whether the load of D2 is less than T1, if so, enters step (3-5), otherwise enters step (3-7);
(3-5) piece P2 is inserted to D2, and upgrade the load of D2;
(3-6) obtain set of blocks adjacent with P2 in D, and it is incorporated to set P set, then return to step (3-3);
(3-7) D2 is inserted to resultant field set D set;
(3-8) whether the load that judges D still is greater than T max, if so, return to step (3-1), otherwise return to step (2-8);
(4) by territory D and its territory set D after division setin adjacent domains merged, the load of the territory D after wherein merging is T1, and the piece in the D of territory is all interconnective.
The advantage of this step is only to need to merge the minimum territory of load, before and after making, twice division result is basically identical, thereby the Data Migration amount while reducing step (5), and can guarantee that all in same territory interconnect, thereby better utilize naturally occurring data locality in the Behavior modeling application.
As shown in Figure 4, this step comprises following sub-step:
(4-1) obtain first adjacent domains D1 of territory D;
(4-2) judge that whether D1Yu territory, territory D is at same data processor, and their load sum is less than threshold value T1, if so, enters step (4-3), otherwise enter step (4-4);
(4-3) territory D1 is merged in the D of territory, and the more load of neofield D, step (4-4) then entered;
(4-4) obtain the next adjacent domains D1 of D;
(4-5) judge that whether D1 is empty, if so, returns to step (2-8), otherwise enters step (4-2);
(5) carry out the domain scheduling between each data processor, realize the load balancing of data processor, wherein each territory of same data processor interconnects.
The advantage of this step is to guarantee that the territories of same data processor processes adjoin each other as far as possible, thereby better utilizes naturally occurring data locality in the Behavior modeling application.
This step specifically comprises following sub-step:
(5-1) load that judges current data processor whether surpass threshold value Tt(wherein Tt be user-defined number of tasks divided by the data processor number, its value is for being more than or equal to 8), if so, enter step (5-2), otherwise enter step (6);
(5-2) obtain a territory D of current data processor;
(5-3) obtain the data processor set W at all territory place adjacent with territory D;
(5-4) take out the data processor w1 of least-loaded in W;
(5-5) whether the load that judgement moves to territory D after data processor w1 is less than Tt, if so, enters step (5-6), otherwise enters step (5-7);
(5-6) territory D is moved to data processor w1 above, then enter step (5-1);
(5-7) obtain the data processor WL of least-loaded on all data processors, territory D is moved to this data processor WL above, and enter step (5-1);
(6) notice tasks carrying device starts the execution of an extensive Behavior modeling application new round;
(7) judge that whether extensive Behavior modeling program new round calculating finishes, and if so, enters step (8), otherwise returns to step (7);
(8) judge whether extensive Behavior modeling program has reached user-defined termination condition, if so, finishes the operation of load equalizer, otherwise return to step (2); Particularly, user-defined termination condition can be the wheel number repeatedly calculated.
Those skilled in the art will readily understand; the foregoing is only preferred embodiment of the present invention; not in order to limit the present invention, all any modifications of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.

Claims (6)

1. the load-balancing method in an extensive Behavior modeling application, to be applied in a kind of load equalizer, the data of this load equalizer for moving its place data processor data management system, to realize the load balancing between data processor, it is characterized in that, said method comprising the steps of:
(1) set up two Hash tables, one of them is for depositing all simulated object of piece, and another is for depositing all block messages in territory, and this Hash table is carried out to initialization;
(2) repeat increment calculates the load in each territory, until extensive Behavior modeling application end, with the territory D after the load of generation incremental computations; This step comprises following sub-step:
(2-1) judge whether that the processed complete simulated object of all new rounds is all processed, if yes then enter step (2-8), otherwise enter step (2-2);
(2-2) obtain the new location information (O of the simulated object O after processed in each territory x, O y, O z);
(2-3) according to the new location information of simulated object and calculate the numbering K of this simulated object place piece according to following formula new:
x = Ox / S x y = Oy / S y z = Oz / S z Knew = x + y &times; Nx + z &times; Nx &times; Ny
N wherein x, N yand N zthe extensive Behavior modeling application simulation space x in user-defined edge, the number of blocks of y and z axle, S x, S yand S zbe piece respectively along x, the size of y and z axle;
(2-4) the block number K of gained is calculated in judgement newwhether identical with the block number at simulated object O place after processed, if different, enter step (2-5), otherwise return to step (2-1);
(2-5) by this simulated object from the old K that is numbered oldpiece in take out, and this simulated object is inserted and is numbered K newpiece in, and upgrade in the piece table and be numbered K oldbe numbered K newthe simulated object of piece count information and simulated object list information;
(2-6) judgement is numbered K oldbe numbered K newthe simulated object number change value Δ of piece | whether P| surpasses threshold value T, if surpass, just enters step (2-7), otherwise returns to step (2-1);
(2-7) incremental update is numbered K oldbe numbered K newthe load in territory, piece place and the load of this territory adjacent domains, then return to step (2-1);
(2-8) judge whether that all territories all are disposed, if enter step (5), otherwise enter step (2-9);
(2-9) whether the load that judges the territory D after all incremental computations loads is greater than T max, if so, enter step (3), otherwise enter step (2-10);
(2-10) whether the load that judges the territory D after all incremental computations loads is less than T min, if so, enter step (4), otherwise return to step (2-8);
(3) territory D is divided to generate territory set D set, the territory set D after wherein dividing setin the load of each territory D2 be T1, and piece wherein is all interconnective; This step comprises following sub-step:
(3-1) edge of newly-built territory D2,Cong territory D takes out a load and is less than the piece P1 of T1, and is inserted into territory D2;
(3-2) obtain all set of blocks P that are connected with piece P1 in the D of territory set;
(3-3) from set of blocks P setmiddle taking-up piece P2;
(3-4) after decision block P2 inserts territory D2, whether the load of D2 is less than T1, if so, enters step (3-5), otherwise enters step (3-7);
(3-5) piece P2 is inserted to D2, and upgrade the load of D2;
(3-6) obtain set of blocks adjacent with P2 in D, and it is incorporated to set P set, then return to step (3-3);
(3-7) D2 is inserted to resultant field set D set;
(3-8) whether the load that judges D still is greater than T max, if so, return to step (3-1), otherwise return to step (2-8);
(4) by territory D and its territory set D after division setin adjacent domains merged, the load of the territory D after wherein merging is T1, and the piece in the D of territory is all interconnective;
(5) carry out the domain scheduling between each data processor, realize the load balancing of data processor, wherein each territory of same data processor interconnects.
(6) notice tasks carrying device starts the execution of an extensive Behavior modeling application new round;
(7) judge that whether extensive Behavior modeling program new round calculating finishes, and if so, enters step (8), otherwise returns to step (7);
(8) judge whether extensive Behavior modeling program has reached user-defined termination condition, if so, finishes the operation of load equalizer, otherwise return to step (2).
2. load-balancing method according to claim 1, is characterized in that, step (1) comprises following sub-step:
(1-1) set up a piece table and a territory table, wherein the piece table is for depositing all simulated object of piece, the corresponding data group of each list item, and comprise that four are listd: first lists the key assignments for memory block, lising for second is a chained list, the key assignments that is used for the adjacent block of memory block, the 3rd simulated object number of lising for memory block, lising for the 4th is a chained list, all simulated object information for memory block, the territory table is for depositing all block messages in territory, each list item is a corresponding data group also, and comprise that four are listd: first is listd for storing the key assignments in territory, list for storing the load in territory for second, list for storing the adjacent domains information in territory for the 3rd, lising for the 4th is a chained list, for storing the key assignments of all that territory comprises,
(1-2) the whole virtual space of extensive Behavior modeling application is divided into to the piece of fixed size, the information of all is filled out in the write-in block table, and be averagely allocated to a plurality of territories by all;
(1-3) load in all territories of initialization:
(1-4) notice tasks carrying device starts the execution of extensive Behavior modeling application.
3. load-balancing method according to claim 2, is characterized in that, step (1-3) is to adopt following formula:
Cost ( D ) = &Sigma; P &Element; D Cost ( P ) Cost ( P ) = | P | &times; &Sigma; Q &Element; Neighbors ( P ) | Q | ,
Cost(D wherein) and the Cost(P) load of representative domain D and the load of the piece P in IncFlds D respectively, and | P| and | Q| means respectively the simulated object quantity that piece P and piece Q comprise, and Neighbors(P) means the adjacent block set of piece P.
4. load-balancing method according to claim 3, is characterized in that, step (2-7) is to adopt following formula:
Cost ( D ) = Cost ( D ) + &Sigma; P &Element; D &Delta;Cost ( P ) &Delta;Cost ( P ) = | P | &times; &Delta;N + &Delta; | P | &times; N + &Delta; | P | &times; &Delta;N &Delta;N = &Sigma; Q &Element; Neighbors ( P ) &Delta; | Q | ,
Wherein Δ means the difference to dependent variable.
5. load-balancing method according to claim 1, is characterized in that, step (4) comprises following sub-step:
(4-1) obtain first adjacent domains D1 of territory D;
(4-2) judge that whether D1Yu territory, territory D is at same data processor, and their load sum is less than threshold value T1, if so, enters step (4-3), otherwise enter step (4-4);
(4-3) territory D1 is merged in the D of territory, and the more load of neofield D, step (4-4) then entered;
(4-4) obtain the next adjacent domains D1 of D;
(4-5) judge that whether D1 is empty, if so, returns to step (2-8), otherwise enters step (4-2).
6. load-balancing method according to claim 1, is characterized in that, step (5) comprises following sub-step:
(5-1) whether the load that judges current data processor, over threshold value Tt, if so, enters step (5-2), otherwise enters step (6);
(5-2) obtain a territory D of current data processor;
(5-3) obtain the data processor set W at all territory place adjacent with territory D;
(5-4) take out the data processor w1 of least-loaded in W;
(5-5) whether the load that judgement moves to territory D after data processor w1 is less than Tt, if so, enters step (5-6), otherwise enters step (5-7);
(5-6) territory D is moved to data processor w1 above, then enter step (5-1);
(5-7) obtain the data processor WL of least-loaded on all data processors, territory D is moved to this data processor WL above, and enter step (5-1).
CN201310398936.XA 2013-09-04 2013-09-04 Load-balancing method in a kind of extensive Behavior modeling application Active CN103491018B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310398936.XA CN103491018B (en) 2013-09-04 2013-09-04 Load-balancing method in a kind of extensive Behavior modeling application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310398936.XA CN103491018B (en) 2013-09-04 2013-09-04 Load-balancing method in a kind of extensive Behavior modeling application

Publications (2)

Publication Number Publication Date
CN103491018A true CN103491018A (en) 2014-01-01
CN103491018B CN103491018B (en) 2016-04-20

Family

ID=49830987

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310398936.XA Active CN103491018B (en) 2013-09-04 2013-09-04 Load-balancing method in a kind of extensive Behavior modeling application

Country Status (1)

Country Link
CN (1) CN103491018B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105099732A (en) * 2014-04-28 2015-11-25 华为技术有限公司 Abnormal IP data flow identification method, device and system
US9923794B2 (en) 2014-04-28 2018-03-20 Huawei Technologies Co., Ltd. Method, apparatus, and system for identifying abnormal IP data stream
CN116662013A (en) * 2023-06-28 2023-08-29 劳弗尔视觉科技有限公司 Load balancing processing method based on stripe division

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010047415A1 (en) * 2000-01-31 2001-11-29 Skene Bryan D. Method and system for enabling persistent access to virtual servers by an ldns server
CN1512374A (en) * 2002-12-31 2004-07-14 联想(北京)有限公司 Method for node load information transfer and node survival detection in machine group
US20100223621A1 (en) * 2002-08-01 2010-09-02 Foundry Networks, Inc. Statistical tracking for global server load balancing
CN102236582A (en) * 2011-07-15 2011-11-09 浙江大学 Method for balanced distribution of virtualization cluster load in a plurality of physical machines

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010047415A1 (en) * 2000-01-31 2001-11-29 Skene Bryan D. Method and system for enabling persistent access to virtual servers by an ldns server
US20100223621A1 (en) * 2002-08-01 2010-09-02 Foundry Networks, Inc. Statistical tracking for global server load balancing
CN1512374A (en) * 2002-12-31 2004-07-14 联想(北京)有限公司 Method for node load information transfer and node survival detection in machine group
CN102236582A (en) * 2011-07-15 2011-11-09 浙江大学 Method for balanced distribution of virtualization cluster load in a plurality of physical machines

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105099732A (en) * 2014-04-28 2015-11-25 华为技术有限公司 Abnormal IP data flow identification method, device and system
US9923794B2 (en) 2014-04-28 2018-03-20 Huawei Technologies Co., Ltd. Method, apparatus, and system for identifying abnormal IP data stream
CN105099732B (en) * 2014-04-28 2018-11-20 华为技术有限公司 A kind of methods, devices and systems identifying abnormal IP traffic
CN116662013A (en) * 2023-06-28 2023-08-29 劳弗尔视觉科技有限公司 Load balancing processing method based on stripe division

Also Published As

Publication number Publication date
CN103491018B (en) 2016-04-20

Similar Documents

Publication Publication Date Title
CN102411658B (en) Molecular dynamics accelerating method based on CUP (Central Processing Unit) and GPU (Graphics Processing Unit) cooperation
CN101819540A (en) Method and system for scheduling task in cluster
CN103617150A (en) GPU (graphic processing unit) based parallel power flow calculation system and method for large-scale power system
CN101727653A (en) Graphics processing unit based discrete simulation computation method of multicomponent system
CN108021451A (en) A kind of adaptive container moving method under mist computing environment
CN102521051B (en) Task scheduling method, device and system in Map Reduce system applied to nomography
CN103491018B (en) Load-balancing method in a kind of extensive Behavior modeling application
CN106528270A (en) Automatic migration method and system of virtual machine based on OpenStack cloud platform
CN105930201A (en) Functional simulator for reconfigurable dedicated processor core
CN105205191B (en) Multi tate parallel circuit emulates
CN101295326A (en) Method for generating OD matrix based on GPS data, traffic simulation method thereof
CN104123190B (en) The load-balancing method and device of Heterogeneous Cluster Environment
Xu et al. Efficient graph-based dynamic load-balancing for parallel large-scale agent-based traffic simulation
CN105426255A (en) Network I/O (input/output) cost evaluation based ReduceTask data locality scheduling method for Hadoop big data platform
CN108089918A (en) A kind of figure computational load equalization methods towards heterogeneous server structure
CN110503201A (en) A kind of neural network distributed parallel training method and device
Hanai et al. An adaptive VM provisioning method for large-scale agent-based traffic simulations on the cloud
CN106407005A (en) Concurrent process merging method and system based on multi-scale coupling
CN105243021A (en) Multi-task testability index distribution method
Vu et al. High-performance mesoscopic traffic simulation with GPU for large scale networks
Sohm et al. Impact of load balancing on unstructured adaptive grid computations for distributed-memory multiprocessors
CN107622665A (en) The method of traffic assignment that a kind of macroscopic view interacts with microcosmic traffic simulation system
Fu et al. Demonstrating geosparksim: A scalable microscopic road network traffic simulator based on apache spark
CN106201655A (en) Virtual machine distribution method and virtual machine distribution system
CN110928676B (en) Power CPS load distribution method based on performance evaluation

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant