Parallel discrete events simulation object distribution method based on community's characteristicTechnical field: the present invention relates to the simulation object distribution method of parallel discrete events simulation, especially towards division and the distribution method of parallel discrete events simulation object on multiprocessor with community's characteristic of parallel or cluster computer.
Background technology: parallel discrete events simulation (PDES, Parallel Discrete Event Simulation), can be called for short parallel artificial, it is the important method of scale complex system being carried out modeling and simulation research, it is by a plurality of ingredients with complication system---and simulation object (or artificial physical) is distributed to executed in parallel on a plurality of processors, obtain the operation speed-up ratio, improve simulation run efficient.Parallel discrete events simulation adopts discrete event to drive modeling pattern, all kinds of simulation objects (Simulation Object) of forming complication system are carried out modeling, realize data communication and mutual by event scheduling between simulation object, whole simulation system is handled by parallel event and is advanced.Parallel artificial adopts the virtualized thought of processor, when emulation is disposed the simulation object example is distributed to concrete physical computing node, therefore can carry out on the computing node of different parallel computation environments or different numbers.The parallel artificial kernel can be converted to the event scheduling between simulation object on the various computing node remote message automatically and send, event scheduling on the same computing node then directly copies to pending list of thing by the shared drive mode, and its expense is less than remote message and sends.Because the employed computing node number of parallel artificial is uncertain often before its operation,, reaches and to make full use of the target that many computing nodes resource can efficiently be moved emulation again so need the support of simulation object distribution method flexibly.
Because often comprise a large amount of objects in the scale complex system, number is thousands of, intricate alternately between object makes the division of simulation object and distribution become the key factor that influences the parallel artificial operational efficiency.At first, because the execution time of whole parallel artificial is depended on the computing node that working time is the longest, the computational load of each computer node needs balanced, and promptly the quantity of simulation object that is carried and event handling will be about equally.More existing parallel artificial platforms, as μ sik, SPEEDES, ROSS etc., the simulation object distribution method of employing has SCATTER, BLOCK, random distribution and User Defined mode.SCATTER method (also claiming round-robin method) is distributed one by one according to distributional mode, for example 10 simulation objects is distributed to 3 computing nodes, and then the Distribution Results of SCATTER is [{ 0,3,6,9}, { 1,4,7}, { 2,5,8}], be about to 0,3,6, No. 9 simulation object and be distributed to node 0, all the other and the like.The BLOCK method is to carry out the distribution of simulation object according to partitioned mode, earlier simulation object is divided into impartial piece according to numbering, distributes then.The BLOCK Distribution Results of last example can be [0,1,2}, 3,4,5}, 6,7,8,9}].The User Defined mode then is to be responsible to define the simulation object distribution policy by the emulation user, the appointment of need encoding in program.Said method can be referred to as the balanced distribution policy of computational load.The second, the communication overhead (100 μ s level) between the consideration computing node differs 100 times nearly much larger than the communication overhead (1 μ s level) of intra-node, therefore also needs to consider to minimize internodal communication on the basis of computational load equilibrium as far as possible.There is document that the interactive relation between simulation object and each object is built into a figure (Graph) at present, utilize the figure division methods (K-cut algorithm etc.) in the mathematics graph theory that this figure is carried out the K division, can with this figure approximate equality be divided into K part and minimize connection between the each several part as far as possible, according to dividing the result simulation object is distributed on K the computing node then.But it is a np problem of generally acknowledging at present that figure divides, and is difficult to try to achieve optimum solution under sweeping situation.In addition, for the Simulation Application of some particular types, it calculates and traffic load is concentrated in some zone, is fit to adopt according to space-time dividing region method, for example in the traffic simulation calculated amount of busy crossroad with communicate by letter relatively largely, can divide according to the area of space of crossroad.In addition, balancing dynamic load (Dynamic Load Balancing) method also is used widely in parallel artificial.Load on each computing node of status information Dynamic Maintenance when balancing dynamic load moves according to system, owing to simulation object need be moved between different computing nodes, therefore the expense cost and obtainable benefit that need comprehensive balance migration in use cause it to use difficulty bigger.These class methods can be described as calculating-traffic load method for equalization and distribution.
In recent years, a large amount of positive researches find that the annexation between simulation object is not a stochastic distribution often in the complication system, and present certain community structure (Community Structure) and tissue (Organization) characteristic.Some simulation objects can in the body that gathers in a flock, the connection of colony inside is dense relatively, the connection between the different groups is then sparse relatively.This group structure characteristic is commonly referred to as community (Community).Correlative study shows in the complication system (as social system, electric system, information network, military bloc etc.) of many types and all comprises community structure, even we can say that community's characteristic has universality.These community's characteristics have different implications in dissimilar application, for example community can refer to the population in family, friend or somewhere in social emulation, in biosystem emulation, can refer to the structural unit that function is relevant, the collections of web pages that in internet, applications, can refer to associated topic, or the like.Because the connection of community inside is than comparatively dense, the connection between community is sparse relatively, corresponding to Simulation Application, when emulation is carried out in the community between simulation object alternately also can be frequent relatively, the rareness alternately of simulation object between community.This is remarkable especially in emulation such as Social Dynamics, and for example in the infectious disease microscopic simulation, the virus carrier can be some more with the chance that its relatives, friend contact, and it is higher relatively to cause infecting probability.
So-called community discovery is meant that utilization community discovery algorithm excavates the middle inherent community structure of publishing picture.The basic thought of community discovery method is the cohesion tolerance according to node, recursively network chart is merged or divides, and network chart is decomposed into nested community's hierarchical structure.In this field multiple community discovery method has appearred at present, as minimum-cut figure division methods, modular approach and information flow method etc.Though community discovery and figure division methods have certain similarity, but have some key distinctions: (1) figure division methods attempts figure is divided into the part of equal sizes, this is worthless from the angle of community's characteristic, because community's number that exists among the figure and size are uncertain.Analyze and find that the size that comprises community in many illustratons of model is the distribution of power rate, wherein.This means that most communities are small-sized or medium-scale, but very large-scale community may exist also.For example, film performer's cooperative relationship model is carried out community discovery, community's size (being the simulation object number that comprises in the community) is for the community of 10-200 accounts for 62.5% altogether, and maximum community's size is 28385, but the number rareness.(2) connection between community is not that the strictness that the figure division methods requires minimizes, and some big intercommunal connection may be more.In a word, because the figure division methods also reckons without in the system the mutual characteristic of polymerization in the simulation object community, divide and pursue equal portions stiffly, therefore, community-based model division methods can more gear to actual circumstances than pure figure division methods, thereby also more superior, the scale complex system emulation that especially is fit to have social characteristic.
In the research of complication system modeling and simulation, pervasive community's characteristic will help improving the operational efficiency of complication system parallel artificial, and the community's characteristic that how the to make full use of complication system discrete events simulation object distribution that walks abreast is the major issue that those skilled in the art pay close attention to.Still no-trump community characteristic applies to the report that the parallel artificial object is distributed both at home and abroad.
Technical scheme: the technical problem to be solved in the present invention is how to utilize community's characteristic of scale complex system and a kind of novel parallel artificial object distribution method that proposes, community's characteristic is incorporated in the parallel simulation system, with the community is that unit carries out polymerization to simulation object in the analogue system, and the polymerization figure of community is divided according to the computing node number, instruct the distribution of simulation object by the division result, thereby reduce the mutual expense in the community, improve the operational efficiency of parallel artificial on a plurality of processors.
Concrete technical scheme of the present invention is:
The first step extracts the event scheduling relation between simulation object and simulation object, the illustraton of model of complex structure system from complication systemG (V, E)Illustraton of model is made up of node and fillet, and wherein node is represented simulation object, and fillet is represented and had the event scheduling relation between simulation object.Suppose in the complication system totalmIndividual simulation object, total between simulation objectnThe bar limit is usedNodeiAmong the representation model figure corresponding toiThe node of individual simulation object is usedEdgekExpression thekThe bar limit is used simultaneouslyEdgeI, jThe expression connected nodeiWithjThe limit, wherein0<i≤m, 0<j≤m, 0<k≤nThe concrete steps that make up illustraton of model are as follows:
1.1 the non-directed graph of a newly-built sky is usedG (V, E)Expression, whereinVThe set of expression node,EThe set on expression limit.WithsThe expression node setVSize, be initially 0;
1.2 orderI=1
1.3 ifI≤m, carried out for 1.4 steps; IfI〉m, illustrate all simulation objects are disposed that illustraton of model has been constructed and finished, changeed for 1.10 steps;
1.4 toiIndividual simulation object makes up a new nodeNodei, and willNodeiJoin figureG (V, E)In,S=s+1
1.5 orderJ=1
1.6 ifJ≤s, carried out for 1.7 steps; IfJ〉s, changeed for 1.9 steps;
1.7 judgement simulation objectiWithjBetween whether have event scheduling relation, if there is the event scheduling relation, to figureG (V, E)Add a connectionNodeiWithNodejNonoriented edgeEdgeI, j
1.8J=j+1, changeed for 1.6 steps.
1.9I=i+1, changeed for 1.3 steps.
1.10 all simulation objects and relation thereof have all made up and have finished, and obtain illustraton of modelG (V, E)
Second step is according to community's characteristic of complication system, to illustraton of modelG (V, E)Carry out community discovery, obtain the community structure between simulation object.Be published in the community discovery thought that the papers " Community structure in social and biological networks " of the 99th 12 phases of volume of American National science proceedings is proposed according to Girvan in 2002 and Newman, adopt and constantly remove the method on the highest centrad (Centrality) limit illustraton of modelG (V, E)Carry out community discovery, each node is aggregated to different communities.Wherein, adopt the shortest path weightSW(Shortest-path Weight) as the estimated value of the centrad on limit, defines the number that community discovery will remove the limit simultaneously to beNumEdgesRemove,1≤NumEdgesRemove≤n, for reaching community discovery effect preferably,NumEdgesRemoveValue isN * 10%Integral part.For damage model figure notG (V, E), really the limit is not removed, but is figureG (V, E)In the limit increase a data fieldRemoved, be used for sign and whether be removed,RemovedBe that 1 expression removes,RemovedBe that 0 expression does not remove.Concrete steps are as follows:
2.1 the shortest path weight on all limits among the computation model figureSWValue, method is:
2.1.1 orderI=1
2.1.2 ifI≤m, carry out the 2.1.3 step; IfI〉m, change the 2.1.12 step;
2.1.3 make up the storehouse that going into earlier of a sky afterwards goes outStackFormation with a first-in first-outQueue,StackWithQueueEach element be node, the data structure of node comprises 4 territories: distanced(distance of representing this node and root node, initial value are-1), weightwThe set of (weighted value of node, initial value are 0), father nodeList(deposit the father node of this node, be initially sky) and relating valueDependency(weigh the strength of association between node and father node, initial value is 0).Use symbol respectivelydx, wx, listx, dependencyxExpressionNodexDistance, weight, father node set and relating value.Be provided withNodeiDistancedi=0, weightwi=1, and willNodeiBe added toQueueIn;
2.1.4 judgeQueueWhether be empty, if not empty is carried out the 2.1.5 step; Otherwise change the 2.1.7 step;
2.1.5 from formationQueueHead shift out a node, be made asv, and this node is pressed into storehouseStack
2.1.6 to illustraton of modelG (V, E)InvEach neighbor nodeb, judge whetherdb<0If, true, then willbJoin formationQueueIn, and be provided withdb=dv+ 1Judge againdbWhether equaldv+ 1If, true, then with nodebWeight increasewv, promptlywb=wb+ wv, and willvJoinbFather node setListbIn; Change the 2.1.4 step;
2.1.7 judgeStackWhether be empty, if not empty is carried out the 2.1.8 step; Otherwise change the 2.1.11 step;
2.1.8 from storehouseStackNode of top removal is made asu
2.1.9 successively to nodeuEach father node in the father node setfCarry out following processing:
2.1.9.1 according to nodeuRelating value and nodefWithuWeight ratio, new node morefRelating valueDependencyf:
dependencyf?=?dependencyf?+(wf/wu)×(1.0+dependencyu);
2.1.9.2 from figureG (V, E)In search connected nodefWithuThe limitEdgeF, u, upgrade the limitEdgeF, uThe shortest path weightSWValue:
SWfu=SWfu+(wf/wu)*(1.0+dependency);
2.1.10 change the 2.1.7 step;
2.1.11I=i+1, change the 2.1.2 step;
2.1.12 finish, obtain the shortest path weight on all limitsSWValue.
2.2 constantly from figureG (V, E)The middle maximum of selectingSWThe limit of value, with this limitRemovedBe made as 1, be labeled as and remove, and computation model figure againG (V, E)In the shortest path weight on all limitsSWValue is carried out community discovery, reaches up to the limit number that removesNumEdgesRemoveConcrete steps are as follows:
2.2.1 orderIi=1
2.2.2 ifIi≤NumEdgesRemove, carry out the 2.2.3 step; IfIi〉NumEdgesRemove, changeed for 2.3 steps;
2.2.3 orderK=1,L=1,Value=0.0
2.2.4 ifK≤n, change the 2.2.5 step; IfK〉n, then change the 2.2.7 step;
2.2.5 judgeSWkValue, as be true, thenL=k,Value=SWk
2.2.6K=k+1, change the 2.2.2 step;
2.2.7 withlThe limitRemovedBe made as 1, be labeled as and remove;
2.2.8 adopt the methods in 2.1 steps to recomputate the shortest path weight SW value on all limits in the illustraton of model,Ii=ii+1, change the 2.2.2 step;
2.3 extract and output model figureG (V, E)In the node that community and community comprised.Has the highest SW value owing to removed continuouslyNumEdgesRemoveThe bar limit makes whole figure be divided into a plurality of mutual disconnected subgraphs.These subgraphs are exactly the community that obtains by the community discovery result, usecThe number of the expression community that finds is usedCommpExpression thepIndividual community.Output model figureG (V, E)In each nodeNodei(0<i≤m) and affiliated society's area codeCommp(0<p≤c), second EOS.
The 3rd step: according to the community of second step discovery, the polymerization figure of community of structural belt weightG ' (V ', E ')Each community all is an illustraton of modelG (V, E)Subgraph, useSizeCommpExpression communitypSize, i.e. the interstitial content that this community comprised.Connection between community's internal node is called the inner connection of community, and the connection between different communities interior nodes is called between community and connects.AdoptG ' (V ', E ')The expression polymerization figure of community usesNode 'pWithEdge 'PqThe difference presentation graphsG ' (V ', E ')In node and limit, useWeight 'pWithWeight 'PqThe weight on expression node and limit.Concrete steps are as follows:
3.1 the heavy non-directed graph of the cum rights of a newly-built skyG ' (V ', E '), whereinV 'WithE 'Represent the set on limit between community set among the polymerization figure of community and community respectively.
3.2 make up node and the weight thereof of the polymerization figure of community, wherein the weight of node is the size of this community.Concrete steps are as follows:
3.2.1 orderP=1
3.2.2 ifP≤c, carry out the 3.2.3 step; IfP〉c, changeed for 3.3 steps;
3.2.3 corresponding to communityCommp, a newly-built nodeNode ' p,Weight ' p=SizeCommp, willNode ' pJoin figureG ' (V ', E ')In;
3.2.4P=p+1, change the 3.2.2 step;
3.3Make up limit and the weight thereof of the polymerization figure of community, wherein the weight on limit is total linking number between this two community between community.Concrete steps are as follows:
3.3.1 orderK=1
3.3.2 ifK≤n, carry out the 3.3.3 step; IfK〉n, changeed for 3.4 steps;
3.3.3 to illustraton of modelG (V, E)In the limitEdgek, search two connected node, be made asNodeiWithNodejAnd inquire about this residing community of two nodes, be made asCommpWithCommq
3.3.4 ifCommpBe equal toCommq, showNodeiWithNodejBe positioned at same community,EdgekBe the fillet of community inside, change the 3.3.7 step; IfCommpWithCommqUnequal, thenEdgekForCommpWithCommqFillet between different communities is carried out the 3.3.5 step;
3.3.5 judge communityCommpWithCommqThe node of correspondence in the polymerization figure of communityNode 'pWithNode 'qBetween whether had the limitEdge 'Pq, if exist, thenWeight 'Pq=Weight 'Pq+ 1, carry out 3.3.7; If do not exist, then carry out 3.3.6;
3.3.6 this momentNode 'pWithNode 'qBetween do not have the limit,To figureG ' (V ', E ')Connection of middle increaseNode 'pWithNode 'qThe limitEdge 'Pq, and be provided withWeight 'Pq=1, carry out 3.3.7;
3.3.7K=k+1, change the 3.3.2 step;
3.4 finish, obtain the polymerization figure of communityG ' (V ', E ')
The 4th step: to the polymerization figure of communityG ' (V ', E ')Carry outKDivide.Count K according to the employed computer node of parallel artificial, adopt that people's such as the nineteen ninety-five Karypis of University of Minnesota technical report " METIS:Unstructured Graph Partitioning and Sparse Matrix Ordering System " proposes based at many levelsKThe METIS method of dividing, cum rights is heavy, the undirected polymerization figure of communityG ' (V ', E ')Carry outKDivide, obtainKIndividual equal portions are usedParthExpression, wherein0<h≤KEach equal portions of dividing among the result comprise 1 to a plurality of communities node, can be expressed as with the set formParth=Node 'a,Node 'b...,Node 'c}, wherein the number of the label of community's node and community is divided according to METIS and is decided.WithWeightParthExpression thehTotal weight of equal portions is the big or small sum of contained community in these equal portions, promptlyWeightParth=WeightNode ' a+ WeightNode ' b+ ...+WeightNode ' cThe internodal fillet of community of same equal portions inside is an internal edges, and the limit in the different equal portions between community's node is a fillet between equal portions.Total weight that the METIS method can make each equal portions effectively is roughly balanced, and minimize fillet between all equal portions weight and, can effectively guarantee the load relative equilibrium on each computer node, and reduce the traffic between computing node as much as possible.
The 5th step: according to the 4th step polymerization figure of communityG ' (V ', E ')KDivide the result and carry out the distribution of parallel artificial object, each equal portions of dividing are specified be distributed to concrete computing node, and Distribution Results is write parallel artificial object distribution parameters file.Detailed process is earlier with the equal portions of being dividedParthUniquely correspond toH-1On number computing node (computing node is from 0 open numbering), correspondingly with community's node of equal portions inside, asNode 'a,Node 'b,Node 'cThe distribution calculation node Deng being distributed to is base unit with the community again, the simulation object that community comprised is all specified be distributed to this computing node, at last Distribution Results is write parallel artificial object distribution parameters file.The content of parallel artificial object distribution of document comprises the computing node numberK, simulation object and their distributions in the simulation object type, community, community the target computing node.The main part of simulation object distribution parameters file adopts the form of hierarchy type, organizes according to each simulation object of various simulation object types, each community, community inside, specifies the affiliated computing node of each simulation object.Parallel artificial by reading this simulation object distribution parameters file, generates the specified simulation object of this distribution method on a plurality of computing nodes when starting.
Core of the present invention is that community's characteristic is incorporated in the parallel simulation system, divides the distribution that realizes parallel discrete events simulation object based on community discovery and the polymerization figure of community, adopts the present invention can reach following beneficial effect:
1. owing to taken into full account the community's characteristic between simulation object in the scale complex system, at first utilize community discovery method just to get in touch closely and gather into community in the simulation object, on the level of community's polymerization, carry out againKEqual portions are divided, and can obtain the simulation object Distribution Results according to the employed computational resource of parallel artificial, are a kind of object of parallel artificial efficiently distribution methods;
2. owing to be basic Dispatching Unit with community, considered community's characteristic of event scheduling between simulation object, the computational load of the many computing nodes of balance and traffic load effectively, especially for extensive microcosmic virtual society, complex network, military combat, Social Dynamics Simulation Application such as (propagating), can significantly improve the operational efficiency of parallel artificial as disease/will of the people/rumor;
3. this method is simple and easy to usefulness, and the scope of application is wider, and the performance on Test Application such as diffusion of information, rumor propagation is better than existing computational load method for equalization and distribution and calculating-traffic load method for equalization and distribution;
4. this method is that unit specifies institute's distribution calculation node to dissimilar simulation objects with the community, and parallel artificial generates corresponding simulation object example by reading parallel artificial object distribution parameters file at each computing node at initial phase.This mode can effectively satisfy large-scale parallel simulation initialisation demand.
Description of drawings:
Fig. 1 is parallel discrete events simulation object distribution synoptic diagram;
Fig. 2 is adopt a present invention walk abreast exemplary plot that the discrete events simulation object distributes;
Fig. 3 is an overview flow chart of the present invention;
Fig. 4 is the process flow diagram that the first step of the present invention makes up illustraton of model;
Fig. 5 is the present invention's second step community discovery process flow diagram;
Fig. 6 is the process flow diagram that the present invention generates the heavy polymerization figure of community of cum rights the 3rd step.
Embodiment:
Fig. 1 is parallel discrete events simulation object distribution synoptic diagram.Simulation object in the complication system and the relation of the event scheduling between simulation object can represent that wherein node is represented simulation object with the figure on band node and limit, and the limit is represented and had the event scheduling relation between two simulation objects, shown in Fig. 1 arrow top.Parallel artificial obtains parallel speed-up ratio by simulation object being distributed to executed in parallel on a plurality of processor computing nodes, improves simulation run efficient.Because employed computing node number was often uncertain before parallel artificial was applied in operation, and different distribution methods can influence the calculating of whole parallel artificial and the equilibrium of traffic load, the therefore support of simulation object distribution mechanisms that need be flexible and efficient.Many complication systems have the community structure characteristic, and simulation object can carry out polymerization according to the dense degree that connects, and forms community, shown in circle part among Fig. 1.Based on community, the connection between simulation object can be divided into community and be connected with intercommunal inner the connection, represents with solid line and dotted line respectively.With the community is that unit distributes simulation object to a plurality of computing nodes, and its Distribution Results is shown in Fig. 1 arrow lower part.Intercommunal connection meeting sends according to the message of dividing between the possibility of result formation computing node, and the shared drive communication of computing node inside is then adopted in the connection of community inside.Because distributor formulas such as existing SCATTER, BLOCK, random approach and figure division are not considered community's characteristic of pervasive existence in the complication system, can not fully satisfy the demand of scale complex system parallel artificial, distribution then is a kind of method that efficiently, gears to actual circumstances based on the parallel artificial object of community's characteristic.
Fig. 2 adopts the present invention to carry out the exemplary plot of parallel artificial object distribution method.Fig. 2 is an example with a simple illustraton of model, described the main process based on the parallel artificial object distribution method of community's characteristic: figure (a) is abstract in simulation object with various piece relatively independent in the complication system, and these simulation objects and the event scheduling between them concern component model figureG (V, E)The node of band number designation represent corresponding simulation object among the figure, and internodal fillet represents to exist between two simulation objects the event scheduling relation, for example simulation object 1 respectively and 3,6 of simulation objects exist event scheduling to concern.Figure (b) is to illustraton of modelG (V, E)Carry out the result of community discovery, the simulation object that is positioned on the difformity piece aggregates into community respectively, and for example { 1,3,6,7}, { 8,9,10,11,12,13,14} etc. form community respectively to simulation object.The principal character of community is that the Connection Density of community inside is often greater than intercommunal connection.Figure (c) is with illustraton of modelG (V, E)In community further be abstracted into the heavy polymerization figure of community of cum rightsG ' (V ', E '), wherein circular node is represented corresponding community, and the circular node size is proportional zoom with community's size, and numeral is community's numbering in the circle, and numeral is community's node weights in the square bracket, the numeral on the fillet is the weight of fillet between community.For example label be community's node of 1 corresponding to simulation object 8,9,10,11,12,13, the community that 14} forms; Because this community comprises 7 simulation objects, so the weight of this community's node is made as 7; Because there is fillet between 1,2 community in this community respectively and between 2, No. 3 communities, therefore giving between the two respectively, the weight of fillet is 1 and 2 simultaneously.To polymerization figureG ' (V ', E ')Carry outKDivide this exampleKValue is 3, the polymerization figure of community is divided into 3 parts, as cutting apart that dotted line among the figure is done.Community 1 becomes equal portions separately, and community 2 and 4,3 and 5 forms all the other two equal portions respectively.BecauseKThe feature of partitioning algorithm, total weight of each equal portions of being divided be (this example all is 7 just) about equally, and total weight less (this example is 2+1+1+1+1=6) of fillet between the community that divides of cut-off rule.
Fig. 3 is an overview flow chart of the present invention, and flow process of the present invention comprised for five steps:
The first step extracts the event scheduling relation between simulation object and simulation object, the illustraton of model of complex structure system from complication systemG (V, E)
Second step is according to community's characteristic of complication system, to illustraton of modelG (V, E)Carry out community discovery, obtain the community structure between simulation object;
The 3rd step is according to the community of second step discovery, the polymerization figure of community of structural belt weightG ' (V ', E ')
The 4th step is to the polymerization figure of communityG ' (V ', E ')Carry outKDivide;
The 5th step is according to the 4th step polymerization figure of communityG ' (V ', E ')KDivide the result and carry out the distribution of parallel artificial object, each equal portions of dividing are specified be distributed to concrete computing node, and Distribution Results is write parallel artificial object distribution parameters file.
Fig. 4 is that the first step of the present invention makes up illustraton of modelG (V, E)Process flow diagram: make up illustraton of model according to the event scheduling between simulation object and simulation object relation in the complication system emulation, wherein node is represented simulation object, and the limit is represented and had the event scheduling relation between two simulation objects.Concrete steps are:
1.1 the non-directed graph of a newly-built sky is usedG (V, E)Expression, whereinVThe set of expression node,EThe set on expression limit.WithsThe expression node setVSize, be initially 0;
1.2 orderI=1
1.3 ifI≤m, carried out for 1.4 steps; IfI〉m, illustrate all simulation objects are disposed that illustraton of model has been constructed and finished, changeed for 1.10 steps;
1.4 toiIndividual simulation object makes up a new nodeNodei, and willNodeiJoin figureG (V, E)In,S=s+1
1.5 orderJ=1
1.6 ifJ≤s, carried out for 1.7 steps; IfJ〉s, changeed for 1.9 steps;
1.7 judgement simulation objectiWithjBetween whether have event scheduling relation, if there is the event scheduling relation, to figureG (V, E)Add a connectionNodeiWithNodejNonoriented edgeEdgeI, j
1.8J=j+1, changeed for 1.6 steps.
1.9I=i+1, changeed for 1.3 steps.
1.10 all simulation objects and relation thereof have all made up and have finished, and obtain illustraton of modelG (V, E)
Fig. 5 is the present invention's second step community discovery process flow diagram: to illustraton of modelG (V, E)Adopt the community discovery method that constantly removes the highest centrad limit, adopt the centrad on shortest path weight (SW) estimation limit.Key step is:
2.1 the shortest path weight on all limits among the computation model figureSWValue;
2.2 constantly from figureG (V, E)The middle maximum of selectingSWThe limit of value, with this limitRemovedBe made as 1, be labeled as and remove, and computation model figure againG (V, E)In the shortest path weight on all limitsSWValue is carried out community discovery, reaches up to the limit number that removesNumEdgesRemove
2.3 extract and output model figure G (V, E) node that community and community comprised in.Because according to predetermined limit numberNumEdgesRemoveRemove limit, make whole figure be divided into a plurality of mutual disconnected subgraphs with higher centrad.These subgraphs are exactly the community that obtains by the community discovery result.
Wherein, figure (a) is the process of the shortest path weight SW value on all limits among the computation model figure, and concrete steps are:
2.1.1 orderI=1
2.1.2 ifI≤m, carry out the 2.1.3 step; IfI〉m, change the 2.1.12 step;
2.1.3 make up the storehouse that going into earlier of a sky afterwards goes outStackFormation with a first-in first-outQueue,StackWithQueueEach element be node, the data structure of node comprises 4 territories: distanced(distance of representing this node and root node, initial value are-1), weightwThe set of (weighted value of node, initial value are 0), father nodeList(deposit the father node of this node, be initially sky) and relating valueDependency(weigh the strength of association between node and father node, initial value is 0).Use symbol respectivelydx, wx, listx, dependencyxExpressionNodexDistance, weight, father node set and relating value.Be provided withNodeiDistancedi=0, weightwi=1, and willNodeiBe added toQueueIn;
2.1.4 judgeQueueWhether be empty, if not empty is carried out the 2.1.5 step; Otherwise change the 2.1.7 step;
2.1.5 from formationQueueHead shift out a node, be made asv, and this node is pressed into storehouseStack
2.1.6 to illustraton of modelG (V, E)InvEach neighbor nodeb, judgedb<0If, true, then willbJoin formationQueueIn, and be provided withdb=dv+ 1Judge againdbWhether equaldv+ 1If, true, then with nodebWeight increasewv, promptlywb=wb+ wv, and willvJoinbFather node setListbIn; Change the 2.1.4 step;
2.1.7 judgeStackWhether be empty, if not empty is carried out the 2.1.8 step; Otherwise change the 2.1.11 step;
2.1.8 from storehouseStackNode of top removal is made asu
2.1.9 successively to nodeuEach father node in the father node setfCarry out following processing:
2.1.9.1 according to nodeuRelating value and nodefWithuWeight ratio, new node morefRelating valueDependencyf:
dependencyf?=?dependencyf?+(wf/wu)×(1.0+dependencyu)
2.1.9.2 from figureG (V, E)In search connected nodefWithuThe limitEdgeF, u, upgrade the limitEdgeF, uThe shortest path weightSWValue:
SWfu=SWfu+(wf/wu)*(1.0+dependency);
2.1.10 change the 2.1.7 step;
2.1.11I=i+1, change the 2.1.2 step;
2.1.12 finish, obtain the shortest path weight on all limitsSWValue.
Figure (b) is the process in the 2.2nd, 2.3 steps in second step, and wherein the concrete steps in the 2nd step are:
2.2.1 orderIi=1
2.2.2 ifIi≤NumEdgesRemove, carry out the 2.2.3 step; IfIi〉NumEdgesRemove, changeed for 2.3 steps;
2.2.3 orderK=1,L=1,Value=0.0
2.2.4 ifK≤n, change the 2.2.4 step; IfK〉n, then change the 2.2.7 step;
2.2.5 judgeSWkValue, as be true, thenL=k,Value=SWk
2.2.6K=k+1, change the 2.2.2 step;
2.2.7 withlThe limitRemovedBe made as 1, be labeled as and remove;
2.2.8 adopt the methods in 2.1 steps to recomputate the shortest path weight SW value on all limits in the illustraton of model,Ii=ii+1, change the 2.2.2 step;
Fig. 6 is the process flow diagram that the present invention generates the heavy polymerization figure of community of cum rights the 3rd step, and concrete steps are:
3.1 the heavy non-directed graph of the cum rights of a newly-built skyG ' (V ', E '), whereinV 'WithE 'Represent the set on limit between community set among the polymerization figure of community and community respectively.
3.2 make up node and the weight thereof of the polymerization figure of community, wherein the weight of node is the size of this community.Concrete steps are as follows:
3.2.1 orderP=1
3.2.2 ifP≤c, carry out the 3.2.3 step; IfP〉c, then changeed for 3.3 steps;
3.2.3 corresponding to communityCommp, a newly-built nodeNode ' p,Weight' p=SizeCommp, willNode ' pJoin figureG ' (V ', E ')In;
3.2.4P=p+1, change the 3.2.2 step;
3.3Make up limit and the weight thereof of the polymerization figure of community, wherein the weight on limit is total linking number between this two community between community.Concrete steps are as follows:
3.3.1 orderK=1
3.3.2 ifK≤n, carry out the 3.3.3 step; IfK〉n, changeed for 3.4 steps;
3.3.3 to illustraton of modelG (V, E)In the limitEdgek, search two connected node, be made asNodeiWithNodejAnd inquire about this residing community of two nodes, be made asCommpWithCommq
3.3.4 ifCommpBe equal toCommq, showNodeiWithNodejBe positioned at same community,EdgekBe the fillet of community inside, change the 3.3.7 step; IfCommpWithCommqUnequal, thenEdgekForCommpWithCommqFillet between different communities is carried out the 3.3.5 step;
3.3.5 judge communityCommpWithCommqThe node of correspondence in the polymerization figure of communityNode 'pWithNode 'qBetween whether had the limitEdge 'Pq, if exist, thenWeight 'Pq=Weight 'Pq+ 1, carry out 3.3.7; If do not exist, then carry out 3.3.6;
3.3.6 this momentNode 'pWithNode 'qBetween do not have the limit,To figureG ' (V ', E ')Connection of middle increaseNode 'pWithNode 'qThe limitEdge 'Pq, and be provided withWeight 'Pq=1, carry out 3.3.7;
3.3.7K=k+1, change the 3.3.2 step;
3.4 finish, obtain the polymerization figure of communityG ' (V ', E ')