CN109032667A - Adjacency list method for fast establishing and system in a kind of molecular dynamics simulation - Google Patents
Adjacency list method for fast establishing and system in a kind of molecular dynamics simulation Download PDFInfo
- Publication number
- CN109032667A CN109032667A CN201810770153.2A CN201810770153A CN109032667A CN 109032667 A CN109032667 A CN 109032667A CN 201810770153 A CN201810770153 A CN 201810770153A CN 109032667 A CN109032667 A CN 109032667A
- Authority
- CN
- China
- Prior art keywords
- particle
- coordinate
- difference
- adjacency list
- mask
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000000329 molecular dynamics simulation Methods 0.000 title claims abstract description 40
- 239000002245 particle Substances 0.000 claims abstract description 231
- 238000004088 simulation Methods 0.000 claims description 26
- 230000014759 maintenance of location Effects 0.000 claims description 21
- 238000004364 calculation method Methods 0.000 claims description 11
- 230000000737 periodic effect Effects 0.000 description 11
- 238000000605 extraction Methods 0.000 description 7
- 238000012216 screening Methods 0.000 description 5
- 230000000694 effects Effects 0.000 description 4
- 230000014509 gene expression Effects 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- 229910002056 binary alloy Inorganic materials 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 239000000126 substance Substances 0.000 description 3
- 230000001413 cellular effect Effects 0.000 description 2
- 238000007796 conventional method Methods 0.000 description 2
- 238000005457 optimization Methods 0.000 description 2
- 238000013459 approach Methods 0.000 description 1
- 238000006073 displacement reaction Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000011835 investigation Methods 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/30007—Arrangements for executing specific machine instructions to perform operations on data operands
- G06F9/30018—Bit or string instructions
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The present invention relates to adjacency list method for fast establishing and systems in a kind of molecular dynamics simulation, it include: the rounded coordinate by each particle of binary number representation, particle pair to be compared is selected from multiple particles, and the rounded coordinate of the second particle of particle centering will be subtracted after the rounded coordinate of the first particle of particle centering and the progress step-by-step of the first mask or operation, obtain the first difference, the rounded coordinate of the first particle will be subtracted after the rounded coordinate of second particle and the progress step-by-step of the first mask or operation, obtain the second difference;First difference and the second difference carry out step-by-step and operation with the second mask respectively, obtain the first operation values and the second operation values, if the first operation values and the second operation values step-by-step be 0, and the first operation values move to left 1 after with the second operation values step-by-step with for 0, and the first operation values move to right 1 after with the second operation values step-by-step with for 0, then by the storage of the first particle into the adjacency list of the second particle.
Description
Technical field
The present invention relates to the technical fields such as high-performance calculation, molecular dynamics simulation.
Background technique
In molecular dynamics simulation, it usually needs calculate the short-range contingence between particle (such as atom, molecule).Short distance
The sphere of action of power, i.e. power is smaller, and active force can rapidly reduce with the increase of distance between particle.In simulation process, when
When the distance between particle is greater than certain value (i.e. truncation radius), active force between the two be can be ignored.Therefore, it calculates
It is right that the stress condition of some particle need to only calculate the particle (i.e. neighbor particle) within the scope of the truncation radius centered on the particle
The stress condition of the particle.The prior art stores neighbours' grain that current time walks interior each particle using adjacent list data structure
Son.In simulation process, particle would generally constantly be moved in simulated domain, therefore the neighbor particle of each particle also can constantly be sent out
Changing.Therefore, before the simulation of each time step, can all calculate in each particle and simulated domain between other particles away from
From to judge which particle is deposited within the scope of the truncation radius of the particle, and by the neighbor particle number within the scope of truncation radius
It stores up in adjacency list, completes the update (re-establishing) of adjacency list.In order to reduce the search range of neighbor particle, existing molecule
Entire simulated domain further can be divided into multiple cellulars by dynamics simulation software;In the adjoining for establising or updating some particle
When table, need to only judge particle in local cellular and neighbours' cell region whether within the scope of the truncation radius of the particle, and
Non-search entire simulated domain.In conclusion in adjacency list during establising or updating, the prior art can calculate particle it
Between distance to judge particle whether within the scope of truncation radius.It is located in three-dimensional simulation space, if two particle P1And P2Seat
Mark is respectively (x1,y1,z1) and (x2,y2,z2), the prior art can calculate P using following formula (1)1And P2Two particles it
Between distance.Although this calculation method simple, intuitive, due to being related to extraction of square root and multiplying, on computers
Execution efficiency it is not high.
On modern computer, executes bit arithmetic, addition or subtraction and take around several clock cycle;Execute multiplication
Operation takes around more than ten of clock cycle;And operation of extracting square root needs to call the function in math library to realize, executes needs
Thousands of clock cycles.In the prior art, addition, subtraction, multiplication (square) will be related to and open by establising or updating adjacency list
Square operation, as shown in formula (1).As can be seen that since the foundation of adjacency list in the prior art is related to extraction of square root and multiplying,
Its computational efficiency is very low.And it is the operation for needing frequently to call in molecular dynamics simulation that adjacency list, which is established, computational efficiency is low
Performance bottleneck can be become.
Summary of the invention
The purpose of the invention is to overcome the problems, such as that it is poor that above-mentioned adjacency list in the prior art establishes calculated performance, propose
A kind of adjacency list method for fast establishing based on bit arithmetic.This invention removes the low extraction of square root of computational efficiency in the prior art and
The foundation of adjacency list in molecular dynamics simulation only can be realized in multiplying by bit arithmetic and subtraction, relative to existing
There is technology to be obviously improved the calculated performance of adjacency list foundation.
Specifically, the invention discloses adjacency list method for fast establishing in a kind of molecular dynamics simulation, including:
Step 1 obtains the three-dimensional simulation region comprising multiple particles, and passes through the three of each particle of binary number representation
Coordinate is tieed up, as the rounded coordinate of each particle, selects particle pair to be compared from multiple particles, and by the particle centering
Particle is respectively designated as the first particle and the second particle;
Step 2 subtracts second particle after the rounded coordinate of first particle and the first mask are carried out step-by-step or operation
Rounded coordinate, obtain the first difference, will the rounded coordinate of second particle and the first mask carry out step-by-step or operation after subtract
The rounded coordinate of first particle obtains the second difference;
Step 3, first difference and second difference carry out step-by-step and operation with the second mask respectively, obtain the first operation
Value and the second operation values, if first operation values and the second operation values step-by-step be equal to 0, and first operation values move to left 1
Behind position with the second operation values step-by-step and be also equal to 0, and first operation values move to right 1 after with the second operation values step-by-step with
It is also equal to 0, then by the storage of the first particle into the adjacency list of the second particle, and the second particle is stored into the adjoining to the first particle
In table.
Adjacency list method for fast establishing in the molecular dynamics simulation, wherein the step 1 includes: to have most according between particle
There is a particle, the crystalline substance according to locating for particle in each lattice at most for the three-dimensional simulation region division lattice in small distance limitation
The position of lattice determines the three-dimensional coordinate of each particle, determines the binary number of each dimensional coordinate values of the three-dimensional coordinate, by
The leading zero of the binary number highest order of each dimension coordinate obtains the rounded coordinate as reserved bit.
Adjacency list method for fast establishing in the molecular dynamics simulation, wherein the step 2 include:
The rounded coordinate of first particle and the first mask are subjected to step-by-step or operation, obtain third operation values, by this
The rounded coordinate for subtracting second particle in three operation values after retention position 1 obtains first difference;
The rounded coordinate of second particle and the first mask are subjected to step-by-step or operation, obtain the 4th operation values, by this
The rounded coordinate for subtracting first particle in four operation values after retention position 1 obtains second difference.
Adjacency list method for fast establishing in the molecular dynamics simulation, wherein first mask is used to pass through step-by-step or operation
By the retention position 1.
Adjacency list method for fast establishing in the molecular dynamics simulation, the wherein step 3 further include: set truncation radius N, then
It enablesStep-by-step and operation are carried out with second mask respectively by first difference and second difference, it will
Reserved bit and the corresponding binary low position M 0 of each dimension.
The invention also discloses adjacency lists in a kind of molecular dynamics simulation quickly to establish system, including:
Particle for obtaining the three-dimensional simulation region comprising multiple particles, and passes through binary number representation to selecting module
The three-dimensional coordinate of each particle selects particle pair to be compared as the rounded coordinate of each particle from multiple particles,
And the particle centering particle is respectively designated as the first particle and the second particle;
Or computing module, for subtracting this after the rounded coordinate of first particle and the first mask are carried out step-by-step or operation
The rounded coordinate of second particle obtains the first difference, and the rounded coordinate of second particle and the first mask are carried out step-by-step or fortune
The rounded coordinate that first particle is subtracted after calculation obtains the second difference;
With computing module, it is used to first difference and second difference carrying out step-by-step and operation with the second mask respectively,
Obtain the first operation values and the second operation values, if first operation values and the second operation values step-by-step be equal to 0, and this first
Operation values move to left 1 after with the second operation values step-by-step and be also equal to 0, and first operation values move to right 1 after with this second
Operation values step-by-step and it is also equal to 0, then by the storage of the first particle into the adjacency list of the second particle, and by the second particle storage to the
In the adjacency list of one particle.
Adjacency list quickly establishes system in the molecular dynamics simulation, and wherein the particle includes: according to grain to selecting module
Have minimum range limitation, for the three-dimensional simulation region division lattice, at most there is a particle in each lattice between son, according to
The position of lattice locating for particle determines the three-dimensional coordinate of each particle, determine the two of each dimensional coordinate values of the three-dimensional coordinate into
Number processed obtains the rounded coordinate by the leading zero of the binary number highest order in each dimension coordinate as reserved bit.
Adjacency list quickly establishes system in the molecular dynamics simulation, is wherein somebody's turn to do or computing module includes:
The rounded coordinate of first particle and the first mask are subjected to step-by-step or operation, obtain third operation values, by this
The rounded coordinate for subtracting second particle in three operation values after retention position 1 obtains first difference;
The rounded coordinate of second particle and the first mask are subjected to step-by-step or operation, obtain the 4th operation values, by this
The rounded coordinate for subtracting first particle in four operation values after retention position 1 obtains second difference.
Adjacency list quickly establishes system in the molecular dynamics simulation, and wherein first mask is used to pass through step-by-step or operation
By the retention position 1.
Adjacency list quickly establishes system in the molecular dynamics simulation, wherein should and computing module further include: set truncation half
Diameter N, then enableStep-by-step and fortune are carried out with second mask respectively by first difference and second difference
It calculates, by the corresponding binary low position M 0 of reserved bit and each dimension.
The foundation of adjacency list is the committed step in molecular dynamics simulation.In simulation process, each particle has one
A adjacency list is used for the neighbor particle being stored in the particle sphere of action.It is both needed to update each grain in the simulation of each time step
The adjacency list of son, therefore, it is very high that the foundation operation of adjacency list executes frequency.It needs to calculate often in general, updating or establishing adjacency list
The distance between other all particles in a particle and simulated domain, to judge other particles whether in its sphere of action.
Therefore, adjacency list, which is updated or established, has very high computation complexity, it will usually the calculated performance bottleneck as simulation.The present invention
A kind of adjacency list method for fast establishing based on bit arithmetic is proposed, adjacency list is completed by bit arithmetic and a small amount of subtraction
Update and foundation.Relative to Traditional calculating methods, method proposed by the present invention has been obviously improved the computational of adjacency list foundation
Energy.
Detailed description of the invention
Fig. 1 is that the present invention is based on the adjacency list Establishing process figures of bit arithmetic;
Fig. 2 is the three-dimensional positive integer coordinate schematic diagram that particle is indicated with 32 binary system positive integer T;
Fig. 3 is neighbor particle screening schematic diagram in two-dimensional analog region;
Fig. 4 is periodical BORDER PROCESSING schematic diagram on the direction x.
Specific embodiment
Inventor has found that existing code performance is poor largely when carrying out the optimization of molecular dynamics simulation code performance
On be due to adjacency list update or establish performance it is poor caused by.During molecular dynamics simulation, adjacency list is established
Execution frequency is very high and computation complexity with higher, it will usually become performance bottleneck.In the prior art, adjacency list is built
It is vertical to be realized by addition, subtraction, multiplication and extraction of square root operation, wherein multiplication and extraction of square root operation (especially extraction of square root operation)
Execution performance is relatively low on computers.Inventor carries out further investigation hair by the calculated performance optimization established to adjacency list
Existing, which can be realized by a series of bit arithmetics and a small amount of subtraction, these bit arithmetics and subtraction are calculating
Very high execution performance is all had on machine.Calculation method is established relative to traditional adjacency list, it is proposed by the present invention to be transported based on position
The adjacency list method for building up of calculation has been obviously improved calculated performance.
Thus the invention discloses adjacency list method for fast establishing in a kind of molecular dynamics simulation, comprising:
Step 1 obtains the three-dimensional simulation region comprising multiple particles, and passes through the three of each particle of binary number representation
Coordinate is tieed up, as the rounded coordinate of each particle, selects particle pair to be compared from multiple particles, and by the particle centering
Particle is respectively designated as the first particle and the second particle;
Step 2 subtracts second particle after the rounded coordinate of first particle and the first mask are carried out step-by-step or operation
Rounded coordinate, obtain the first difference, will the rounded coordinate of second particle and the first mask carry out step-by-step or operation after subtract
The rounded coordinate of first particle obtains the second difference;
Step 3, first difference and second difference carry out step-by-step and operation with the second mask respectively, obtain the first operation
Value and the second operation values, if first operation values and the second operation values step-by-step be equal to 0, and first operation values move to left 1
Behind position with the second operation values step-by-step and be also equal to 0, and first operation values move to right 1 after with the second operation values step-by-step with
It is also equal to 0, then by the storage of the first particle into the adjacency list of the second particle, and the second particle is stored into the adjoining to the first particle
In table.
Adjacency list method for fast establishing in the molecular dynamics simulation, wherein the step 1 includes: to have most according between particle
There is a particle, the crystalline substance according to locating for particle in each lattice at most for the three-dimensional simulation region division lattice in small distance limitation
The position of lattice determines the three-dimensional coordinate of each particle, determines the binary number of each dimensional coordinate values of the three-dimensional coordinate, by
The leading zero of the binary number highest order of each dimension coordinate obtains the rounded coordinate as reserved bit.
Adjacency list method for fast establishing in the molecular dynamics simulation, wherein the step 2 include:
The rounded coordinate of first particle and the first mask are subjected to step-by-step or operation, obtain third operation values, by this
The rounded coordinate for subtracting second particle in three operation values after retention position 1 obtains first difference;
The rounded coordinate of second particle and the first mask are subjected to step-by-step or operation, obtain the 4th operation values, by this
The rounded coordinate for subtracting first particle in four operation values after retention position 1 obtains second difference.
Adjacency list method for fast establishing in the molecular dynamics simulation, wherein first mask is used to pass through step-by-step or operation
By the retention position 1.
Adjacency list method for fast establishing in the molecular dynamics simulation, the wherein step 3 further include: set truncation radius N, then
It enablesStep-by-step and operation are carried out with second mask respectively by first difference and second difference, it will
Reserved bit and the corresponding binary low position M 0 of each dimension.
The present invention is indicated the three-dimensional coordinate of particle with a positive integer by shift operation and step-by-step or operation.This is just
A certain section of continuous binary digit is used to indicate the coordinate of a dimension in integer, therefore three latitude coordinates are just whole with this respectively
Three sections of binary digits indicate in number, are respectively set one 0 as reserved bit before three sections of binary digit highest orders.It does so
Technical advantage is to carry out difference calculating to three latitude coordinates values simultaneously.And in the prior art, it needs respectively to tie up three
The coordinate value of degree carries out difference calculating respectively.Therefore, the present invention has higher computational efficiency compared with the existing technology.
Pass through coordinate difference between step-by-step or operation and subtraction two particles of calculating.One of grain is randomly selected first
The corresponding positive integer of subcoordinate sets 1 as minuend, and by three of them reserved bit, the corresponding positive integer of another particle coordinate
As subtrahend, first difference is obtained by subtraction.Select later the corresponding positive integer of another particle coordinate as
Minuend, and three of them reserved bit is set 1, and do identical operation, second difference is obtained by subtraction.It does so
Technical advantage is to guarantee that the result subtracted each other is positive number under the premise of not knowing two particle coordinate value size relations.
By carrying out step-by-step and, displacement and step-by-step or operation to two differences calculated in step 2, obtain final
As a result.If final result is greater than 0, two interparticle distances are not within the scope of truncation radius;If final result is equal to 0, two
A interparticle distance is within the scope of truncation radius.The technical advantage done so first is that bit arithmetic have on computers it is very high
Calculated performance;In addition, this judgment method can be included in the particle in periodic boundary in determination range simultaneously.
To allow features described above and effect of the invention that can illustrate more clearly understandable, special embodiment below, and cooperate
Bright book attached drawing is described in detail below.
A specific embodiment of the invention can be divided into six steps, as shown in Fig. 1 example, in figure | indicate step-by-step or operation (a |
B indicates that when it is 1 that at least one in a and b, which corresponds to binary digit, it is 1 that then result, which corresponds to binary digit, otherwise for 0);& is indicated
Step-by-step and operation (a&b indicates that it is 1 that then result, which corresponds to binary digit, when the corresponding binary digit of a and b must be 1, otherwise for
0);> > indicates shift right operation, and (binary representation of a is moved to right 3 by a > > 3 expressions, 0) high position is mended;< < expression shift left operation (a < < 3
It indicates to move to left the binary representation of a into 3,0) low level is mended;Indicate arithmetic subtraction operation;Truncation radius is set as 3.
Step 1: three-dimensional simulation region is carried out logical partitioning by basic unit of lattice first, for distributing to particle
Coordinate.Since, there are repulsive force, two particles have minimum range limit it is not possible that infinite approach that is, between particle between particle
System.According to interparticle minimum range, the size of lattice is arranged, to guarantee only one most particle in single lattice.
If the lattice number that three-dimensional simulation region is divided is N*N*N, then the position of each particle can navigate to a crystalline substance
On lattice.The coordinate of each particle can indicate by three-dimensional positive integer coordinate (x, y, z), wherein [0, N-1] x ∈, y ∈ [0,
N-1], z ∈ [0, N-1].Three-dimensional coordinate (x, y, z) is indicated with a positive integer T by shift left operation and step-by-step or operation, from
And three latitude coordinates can be handled simultaneously in subsequent calculating.If N≤2C, then T=x | y < < (C+1) | z < < 2 (C+
1).Fig. 2 gives the expression of 32 binary system positive integer T (i.e. as N≤512) as C=9.It is worth noting that, the two of T
9 binary representations of x dimension coordinate are contained in system expression, y ties up 9 binary representations of coordinate and z ties up the 9 of coordinate
Position binary representation;X coordinate binary representation and y dimension coordinate binary representation between use 0 bit interval, y dimension coordinate two
System indicates to use 0 bit interval between the binary representation of z dimension coordinate, and higher one of binary representation that z ties up coordinate is also
0, the present invention is known as reserved bit for this 30.If three-dimensional coordinate (the x of some particlen,yn,zn)=(1,2,3), then it is corresponding
Tn=00000000001100000000100000000001.In Fig. 1 first step, two the first particle of particle P are calculated1And second
Particle P2Corresponding T1And T2Value need 4 step-by-steps or operation and 4 shift operations altogether.
Step 2: from P1And P2A particle is chosen in two particles, using its corresponding T value as minuend.Here it first selects
Take T1, then by T1With the first mask Mask1Step-by-step or operation are carried out, by T1In 3 retention positions 1 obtain third operation values T1',
This mask Mask1Purposes be by step-by-step or operation by 3 retention positions 1.Therefore, corresponding 3 reserved bits of the mask are
1, remaining is 0.
Step 3: using T1' subtract T2Obtain the first difference D1.Significantly, since T1' in 3 reserved bits be 1,
So necessarily satisfying for T1'>T2, to ensure that D1For positive number.
Step 4: selection T2, then by T2With mask Mask1Step-by-step or operation are carried out, by T2In 3 retention positions 1 obtain
4th operation values T2'.Use T2' subtract T1Obtain the second difference D2.Latitude coordinates value is corresponded to since two particles can not be predefined
Between size relation, so needing to calculate D1And D2Two differences, later using the two differences carry out subsequent calculating with into one
Step judgement.As can be seen that needing 2 step-by-steps or operation and 2 subtractions altogether from second step to the 4th step.
Step 5: setting truncation radius N as 3, then enablePass through D1And D2Respectively with mask Mask2It carries out
The corresponding binary low position M 0 of 3 reserved bits and each dimension is obtained D by step-by-step and operation, the present invention1' and D2'.Figure
Truncation radius is set as 3 in 1 example provided, therefore by D1And D2In corresponding binary low 2 position 0 of each dimension.This is because
D1And D2In corresponding binary low 2 of each dimension no matter initial value is how many, will not influence subsequent whether in truncation radius model
Enclose interior judgement.In 5th step, 2 step-by-steps and operation are needed altogether.Mask Mask2Purposes be by step-by-step and operation by D1 and
The low position M 0 of 3 reserved bits and each latitude coordinates in D2.Therefore, 3 gap digits and each latitude coordinates in the mask
Low M is 0, remaining position is 1.As shown in Figure 1.When truncation radius is 10, according to above-mentioned formula, then by 3 of D1 and D2
Reserved bit and corresponding binary low 4 position 0 of each dimension.Although the model of neighbor particle can be increased to a certain extent in this way
It encloses, but can be by Traditional calculating methods further accurate screening, the relatively entire simulated domain of the range of screening is big again
It is big to reduce.
Step 6: if the first operation values D1' and the second operation values D2' step-by-step be equal to 0, and D1' move to left 1 after with
D2' step-by-step and it is also equal to 0, and D1' move to right 1 after with D2' step-by-step and be also equal to 0, then P2In P1Truncation radius within the scope of;It is no
Then P2Not in P1Truncation radius within the scope of.Its calculating process is R=(D1'&D2')|(D1'<<1&D2')|(D1'>>1&D2'), such as
Fruit R is equal to 0, then P2In P1Truncation radius within the scope of;If R is greater than 0, P2Not in P1Truncation radius within the scope of.Sentence in this way
Disconnected reason is if P2In P1Truncation radius within the scope of, then in 9 binary systems corresponding for each dimension, D1' and D2'
In have and only one be full 0;If P2Not in P1Truncation radius within the scope of, then at least one dimension it is corresponding 9 two into
In system, D1' and D2' it is not full 0.The correctness of above-mentioned judgement can be verified by way of example.6th step needs 3 step-by-steps altogether
With operation, 2 shift operations and 2 step-by-steps or operation.
The above-mentioned first step needs 8 step-by-steps or operation, 5 step-by-steps and operation to the 6th step altogether, 6 shift operations and 2 times
Subtraction.
The calculating process in Fig. 1 is further illustrated with concrete instance below.If truncation radius is 3, P1Three-dimensional
Coordinate is (x1,y1,z1)=(1,2,3), P2Three-dimensional coordinate be (x2,y2,z2)=(2,1,4).According to first step meter in Fig. 1
It calculates, then T1=00000000001100000000100000000001, T2=
00000000010000000000010000000010.According to second and third in Fig. 1, four-step calculation process, available D1=
00011111111110000000010111111111, D2=00100000000101111111111000000001.According to Fig. 1
In the 5th step calculate, available D1'=00011111110000000000000111111100, D2'=
00000000000001111111000000000000.It is calculated according to the 6th step in Fig. 1, available R=
00000000000000000000000000000000, therefore may determine that P2In P1Truncation radius within the scope of.It is worth noting
, above-mentioned calculating process may determine that P2Whether with P1Centered on twice of truncation radius be side length cubical area
Interior, this is more somewhat larger as the spheric region of radius than using one times of truncation radius.Fig. 3 gives the case where two-dimensional analog region, according to
According to the method that the present invention provides, P2、P3、P4And P5With P1Centered on twice of truncation radius be side length dashed square
In region, but wherein P5With P1The distance between be more than truncation radius, be located at solid line border circular areas except.Therefore according to this hair
Bright method can increase neighbor particle number to a certain extent, but this has no effect on simulation precision.It obtains if necessary accurate
Neighbor particle can use conventional method (i.e. formula (1)) and do further screening to the obtained neighbor particle of the present invention;Due to
The range relative analog region of screening has greatly reduced again, therefore additional computing cost also very little.
Below by way of illustrating that method proposed by the invention can processing with seamless compatibility to periodic boundary.Molecule power
Periodic boundary condition can generally be introduced by learning in simulation, this is done because: first, in the motion process of particle, if having one
A or several particles exceed simulated domain, then must have one or several particles to return in simulated domain from opposite interface, thus
It ensure that the constant of population in simulation system;Second, due to periodic boundary condition, in simulated domain boundary
Atomic force is just relatively more comprehensive, to eliminate boundary effect.Fig. 4 gives the processing of the periodic boundary condition on the direction x,
The particle being wherein located in the rightmost truncation radius width of the direction simulated domain x can be used as the leftmost perimeter strip of simulated domain
Part, the particle being similarly located in the Far Left truncation radius width of the direction simulated domain x can be as the boundary of simulated domain rightmost
Condition.In Fig. 4 (truncation radius=3, periodic boundary peak width are equal to truncation radius), if truncation radius is 3, P1X sit
Scale value is 1, P3In periodic boundary region and x coordinate value is 510, if traditionally at (i.e. formula (1))
It manages, then P1With P3The distance between be much larger than truncation radius, but according to periodic boundary condition, P3In P1Truncation radius range
It is interior, therefore conventional method still needs to just make accurate judgement to periodic boundary progress specially treated.And it is proposed by the invention
Method can processing with seamless compatibility to periodic boundary.It is verified below with the next concrete instance in three-dimensional simulation region:
If truncation radius is 3, if P1Three-dimensional coordinate is (x1,y1,z1)=(1,2,3), P in periodic boundary region3Three-dimensional coordinate be
(x3,y3,z3)=(510, Isosorbide-5-Nitrae), it is calculated according to the first to six step in Fig. 1, R=can be obtained
00000000000000000000000000000000, therefore may determine that P3In P1Truncation radius within the scope of.
Table 1: execution performance of several typical operations on modern computer
Technical effect in order to further illustrate the present invention lists several typical operations on modern computer in table 1
Execution performance.Table 1 does not list the accurate clock periodicity needed for each operation executes, this is because different manufacturers or grinding
Processor produced (such as Intel processor, AMD processor, arm processor and domestic Shen prestige processor) is studied carefully specific
Different is had in performance parameter, but difference is little.Clock periodicity listed by table 1 reflects being averaged for current generation processor
Performance level.
Two interparticle distances are from 3 subtractions of needs under prior art calculating three-dimensional simulation region it can be seen from formula (1)
Operation, 3 multiplyings, 2 sub-addition operations and 1 extraction of square root operation.The performance of each operation referring to listed by table 1
Data are available, when the prior art judges whether a particle needs thousands of within the scope of the truncation radius of another particle
Clock period, i.e. O (103) a clock cycle.
Whether the invention proposes a kind of adjacency list method for building up based on bit arithmetic, judge a particle in another grain
8 step-by-steps or operation, 5 step-by-steps and operation, 6 shift operations and 2 subtraction fortune are needed within the scope of the truncation radius of son altogether
It calculates.Number needed for how obtaining each operation can be explained in detail in subsequent specific embodiment.It is each referring to listed by table 1
The performance data of a operation is available, with method proposed by the invention judge a particle whether another particle cut
Tens of clock cycle are only needed in disconnected radius, i.e. O (101) a clock cycle, compared with the existing technology in method therefor
Two orders of magnitude can be improved.
The following are system embodiment corresponding with above method embodiment, present embodiment can be mutual with above embodiment
Cooperation is implemented.The above-mentioned relevant technical details mentioned in mode of applying are still effective in the present embodiment, in order to reduce repetition, this
In repeat no more.Correspondingly, the relevant technical details mentioned in present embodiment are also applicable in above embodiment.
The invention also discloses adjacency lists in a kind of molecular dynamics simulation quickly to establish system, including:
Particle for obtaining the three-dimensional simulation region comprising multiple particles, and passes through binary number representation to selecting module
The three-dimensional coordinate of each particle selects particle pair to be compared as the rounded coordinate of each particle from multiple particles,
And the particle centering particle is respectively designated as the first particle and the second particle;
Or computing module, for subtracting this after the rounded coordinate of first particle and the first mask are carried out step-by-step or operation
The rounded coordinate of second particle obtains the first difference, and the rounded coordinate of second particle and the first mask are carried out step-by-step or fortune
The rounded coordinate that first particle is subtracted after calculation obtains the second difference;
With computing module, it is used to first difference and second difference carrying out step-by-step and operation with the second mask respectively,
Obtain the first operation values and the second operation values, if first operation values and the second operation values step-by-step be equal to 0, and this first
Operation values move to left 1 after with the second operation values step-by-step and be also equal to 0, and first operation values move to right 1 after with this second
Operation values step-by-step and it is also equal to 0, then by the storage of the first particle into the adjacency list of the second particle, and by the second particle storage to the
In the adjacency list of one particle.
Adjacency list quickly establishes system in the molecular dynamics simulation, and wherein the particle includes: according to grain to selecting module
Have minimum range limitation, for the three-dimensional simulation region division lattice, at most there is a particle in each lattice between son, according to
The position of lattice locating for particle determines the three-dimensional coordinate of each particle, determine the two of each dimensional coordinate values of the three-dimensional coordinate into
Number processed obtains the rounded coordinate by the leading zero of the binary number highest order in each dimension coordinate as reserved bit.
Adjacency list quickly establishes system in the molecular dynamics simulation, is wherein somebody's turn to do or computing module includes:
The rounded coordinate of first particle and the first mask are subjected to step-by-step or operation, obtain third operation values, by this
The rounded coordinate for subtracting second particle in three operation values after retention position 1 obtains first difference;
The rounded coordinate of second particle and the first mask are subjected to step-by-step or operation, obtain the 4th operation values, by this
The rounded coordinate for subtracting first particle in four operation values after retention position 1 obtains second difference.
Adjacency list quickly establishes system in the molecular dynamics simulation, and wherein first mask is used to pass through step-by-step or operation
By the retention position 1.
Adjacency list quickly establishes system in the molecular dynamics simulation, wherein should and computing module further include: set truncation half
Diameter N, then enableStep-by-step and fortune are carried out with second mask respectively by first difference and second difference
It calculates, by the corresponding binary low position M 0 of reserved bit and each dimension.
Claims (10)
1. adjacency list method for fast establishing in a kind of molecular dynamics simulation characterized by comprising
Step 1 obtains the three-dimensional simulation region comprising multiple particles, and is sat by the three-dimensional of each particle of binary number representation
Mark selects particle pair to be compared as the rounded coordinate of each particle from multiple particles, and by the particle centering particle
It is respectively designated as the first particle and the second particle;
Step 2 subtracts the whole of second particle after the rounded coordinate of first particle is carried out step-by-step or operation with the first mask
Number coordinate, obtains the first difference, subtracts this after the rounded coordinate of second particle and first mask are carried out step-by-step or operation
The rounded coordinate of first particle obtains the second difference;
Step 3, first difference and second difference carry out step-by-step and operation with the second mask respectively, obtain the first operation values and
Second operation values, if first operation values and the second operation values step-by-step be equal to 0, and after first operation values move to left 1
With the second operation values step-by-step be equal to 0, and first operation values move to right 1 after with the second operation values step-by-step be equal to 0,
Then by the storage of the first particle into the adjacency list of the second particle, and by the storage of the second particle into the adjacency list of the first particle.
2. adjacency list method for fast establishing in molecular dynamics simulation as described in claim 1, which is characterized in that the step 1
It include: according to having minimum range limitation, for the three-dimensional simulation region division lattice, at most there is one in each lattice between particle
A particle, the position of the lattice according to locating for particle determine the three-dimensional coordinate of each particle, determine every one-dimensional seat of the three-dimensional coordinate
The binary number of scale value obtains integer seat by the leading zero of the binary number highest order in each dimension coordinate as reserved bit
Mark.
3. adjacency list method for fast establishing in molecular dynamics simulation as claimed in claim 2, which is characterized in that the step 2
Include:
The rounded coordinate of first particle and the first mask are subjected to step-by-step or operation, third operation values is obtained, which is transported
The rounded coordinate for subtracting second particle in calculation value after retention position 1 obtains first difference;
The rounded coordinate of second particle and the first mask are subjected to step-by-step or operation, obtain the 4th operation values, by the 4th fortune
The rounded coordinate for subtracting first particle in calculation value after retention position 1 obtains second difference.
4. adjacency list method for fast establishing in molecular dynamics simulation as claimed in claim 2, which is characterized in that this first is covered
Code is for passing through step-by-step or operation for the retention position 1.
5. adjacency list method for fast establishing in molecular dynamics simulation as claimed in claim 2, which is characterized in that the step 3
Further include: truncation radius N is set, then is enabledBy first difference and second difference respectively with this second
Mask carries out step-by-step and operation, by the corresponding binary low position M 0 of reserved bit and each dimension.
6. adjacency list quickly establishes system in a kind of molecular dynamics simulation characterized by comprising
Particle is to selecting module, for obtaining the three-dimensional simulation region comprising multiple particles, and it is each by binary number representation
The three-dimensional coordinate of a particle selects particle pair to be compared, and will as the rounded coordinate of each particle from multiple particles
The particle centering particle is respectively designated as the first particle and the second particle;
Or computing module, for the rounded coordinate of first particle and the first mask are carried out subtract after step-by-step or operation this second
The rounded coordinate of particle obtains the first difference, after the rounded coordinate of second particle and the first mask are carried out step-by-step or operation
The rounded coordinate for subtracting first particle obtains the second difference;
It is obtained with computing module for first difference and second difference to be carried out step-by-step and operation with the second mask respectively
First operation values and the second operation values, if first operation values and the second operation values step-by-step be equal to 0, and first operation
Value move to left 1 after with the second operation values step-by-step and be also equal to 0, and first operation values move to right 1 after with second operation
Value step-by-step and it is also equal to 0, then by the storage of the first particle into the adjacency list of the second particle, and the second particle is stored to first
In the adjacency list of son.
7. adjacency list quickly establishes system in molecular dynamics simulation as claimed in claim 6, which is characterized in that the particle pair
Selecting module includes: according to having minimum range limitation between particle, for the three-dimensional simulation region division lattice, in each lattice most
There is a particle, the position of the lattice according to locating for particle determines the three-dimensional coordinate of each particle, determines the three-dimensional coordinate more
The binary number of each dimensional coordinate values is obtained by the leading zero of the binary number highest order in each dimension coordinate as reserved bit
The rounded coordinate.
8. adjacency list quickly establishes system in molecular dynamics simulation as claimed in claim 7, which is characterized in that this or operation
Module includes:
The rounded coordinate of first particle and the first mask are subjected to step-by-step or operation, third operation values is obtained, which is transported
The rounded coordinate for subtracting second particle in calculation value after retention position 1 obtains first difference;
The rounded coordinate of second particle and the first mask are subjected to step-by-step or operation, obtain the 4th operation values, by the 4th fortune
The rounded coordinate for subtracting first particle in calculation value after retention position 1 obtains second difference.
9. adjacency list quickly establishes system in molecular dynamics simulation as claimed in claim 7, which is characterized in that this first is covered
Code is for passing through step-by-step or operation for the retention position 1.
10. adjacency list quickly establishes system in molecular dynamics simulation as claimed in claim 7, which is characterized in that should be with fortune
Calculate module further include: set truncation radius N, then enableBy first difference and second difference respectively with
Second mask carries out step-by-step and operation, by the corresponding binary low position M 0 of reserved bit and each dimension.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810770153.2A CN109032667B (en) | 2018-07-13 | 2018-07-13 | Method and system for quickly establishing adjacency list in molecular dynamics simulation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810770153.2A CN109032667B (en) | 2018-07-13 | 2018-07-13 | Method and system for quickly establishing adjacency list in molecular dynamics simulation |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109032667A true CN109032667A (en) | 2018-12-18 |
CN109032667B CN109032667B (en) | 2020-09-15 |
Family
ID=64642453
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810770153.2A Active CN109032667B (en) | 2018-07-13 | 2018-07-13 | Method and system for quickly establishing adjacency list in molecular dynamics simulation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109032667B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112820356A (en) * | 2021-01-29 | 2021-05-18 | 广东工业大学 | Method for quickly applying molecular dynamics boundary conditions based on geometric boundary operation |
CN112861154A (en) * | 2021-02-24 | 2021-05-28 | 中国科学院计算技术研究所 | SHA algorithm execution method, storage medium and electronic device for data flow architecture |
EP4239639A1 (en) * | 2022-03-02 | 2023-09-06 | Fujitsu Limited | Simulation program, simulation method, and simulation device |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101430709A (en) * | 2008-09-24 | 2009-05-13 | 腾讯科技(深圳)有限公司 | Neighbor searching method and apparatus |
-
2018
- 2018-07-13 CN CN201810770153.2A patent/CN109032667B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101430709A (en) * | 2008-09-24 | 2009-05-13 | 腾讯科技(深圳)有限公司 | Neighbor searching method and apparatus |
Non-Patent Citations (1)
Title |
---|
赵成龙: "基于AMD平台的OpenCL优化研究及其在分子动力学中的应用", 《中国优秀硕士学位论文全文数据库》 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112820356A (en) * | 2021-01-29 | 2021-05-18 | 广东工业大学 | Method for quickly applying molecular dynamics boundary conditions based on geometric boundary operation |
CN112861154A (en) * | 2021-02-24 | 2021-05-28 | 中国科学院计算技术研究所 | SHA algorithm execution method, storage medium and electronic device for data flow architecture |
EP4239639A1 (en) * | 2022-03-02 | 2023-09-06 | Fujitsu Limited | Simulation program, simulation method, and simulation device |
Also Published As
Publication number | Publication date |
---|---|
CN109032667B (en) | 2020-09-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Murotani et al. | Development of hierarchical domain decomposition explicit MPS method and application to large-scale tsunami analysis with floating objects | |
CN108053028A (en) | Data fixed point processing method, device, electronic equipment and computer storage media | |
CN109032667A (en) | Adjacency list method for fast establishing and system in a kind of molecular dynamics simulation | |
KR101702996B1 (en) | Structured grids and graph traversal for image processing | |
CN106709503B (en) | Large-scale spatial data clustering algorithm K-DBSCAN based on density | |
CN102411613B (en) | Optimized displaying method for dimordinate on network map | |
CN102521854A (en) | Parallel flow line placing method applicable to two-dimensional flow field | |
Jiang et al. | Parallel contributing area calculation with granularity control on massive grid terrain datasets | |
CN108763777B (en) | Method for establishing VLSI global layout model based on Poisson equation explicit solution | |
CN106023317A (en) | Weighted Voronoi diagram generation method used for big data test | |
CN106484532A (en) | GPGPU parallel calculating method towards SPH fluid simulation | |
CN107464272A (en) | The interpolation method of central diffusion type meteorological causes isopleth based on key point | |
Tu et al. | Comparative investigation of parallel spatial interpolation algorithms for building large-scale digital elevation models | |
CN105426626B (en) | Multiple-Point Geostatistics modeling method based on set of metadata of similar data pattern cluster | |
CN110349265B (en) | Tetrahedral topological mesh generation method and electronic equipment | |
Liu et al. | Small polyhedron reconnection for mesh improvement and its implementation based on advancing front technique | |
CN109949420B (en) | Delaunay triangulation grid refining method suitable for GPU, GPU and system | |
JP3276862B2 (en) | Planning device and planning method | |
CN106066912A (en) | A kind of generation method of multi partition structured grid | |
CN106529011B (en) | A kind of Parallel districts implementation method for SPH algorithm | |
Arunkumar et al. | A system for extracting product features from CAD models–a STEP approach | |
CN113095681B (en) | Mining investigation and development area evaluation method and device | |
Manstetten et al. | Sparse surface speed evaluation on a dynamic three-dimensional surface using an iterative partitioning scheme | |
CN114741918B (en) | Parallel grid subdivision method for site degradation finite element analysis | |
McGough et al. | Massively parallel landscape-evolution modelling using general purpose graphical processing units |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |