Molecular dynamics calculation method and device based on space grid, equipment and medium
Through the molecular dynamics calculation method based on space grid, the problems of high computational complexity and high resource consumption in the prior art are solved, efficient proximity atomic search and parallel computing are realized, and the calculation efficiency is improved.
Patent Information
- Application Number
- CN202411018434.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-11-26
AI Technical Summary
The existing molecular dynamics calculation methods have high computational complexity, resulting in large resource consumption and difficulty in dealing with large numbers of particles.
Using the calculation method based on the space grid, by obtaining the number of chips and the preset spatial grid form, a spatial grid is established in the preset spatial coordinate system, and the vertices of the chip are determined according to the physical position and connection method of the chip. The corresponding relationship between , molecular dynamics calculation is performed.
Efficient search and parallel computing of adjacent atoms are realized, and computing resources are fully utilized, and computing efficiency is significantly improved.
Smart Images

Figure CN119028457A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of molecular dynamics calculation technology, and in particular to a molecular dynamics calculation method, device, equipment and medium based on a space grid. Background Art
[0002] Molecular dynamics (MD) simulation is an important technology for studying the behavior of materials and molecules by calculating the interactions between molecules and atoms. It is widely used in chemistry, physics, biology, and materials science. As the complexity and scale of the research objects increase, the computational resource requirements and time consumption of MD simulations increase significantly, becoming the main bottleneck limiting its application.
[0003] At present, most existing technologies use distributed clusters for computing, assigning computing tasks to multiple units and directly performing interaction calculations. For each pair of particles, their interaction forces need to be calculated, which has high computational complexity. The amount of calculation also increases rapidly with the increase in the number of particles, and a large amount of computing resources is required for scenes with a large number of particles. Summary of the invention
[0004] The present invention provides a molecular dynamics calculation method, device, equipment and medium based on a space grid, so as to solve the problems of high complexity and large resource consumption of molecular dynamics calculation in the prior art.
[0005] In a first aspect, an embodiment of the present invention provides a molecular dynamics calculation method based on a spatial grid, comprising:
[0006] Get the number of chips and the preset spatial grid shape;
[0007] Establishing a spatial grid in a preset spatial coordinate system based on the number of the chips and the preset spatial grid form; wherein the number of vertices included in the spatial grid is the same as the number of the chips;
[0008] Determine the corresponding relationship between each chip and the space grid vertex according to the physical position and connection mode of the chip; wherein the physical position of the chip includes the frame ID, the board ID and the chip ID;
[0009] Molecular dynamics calculations were performed based on the correspondence.
[0010] Optionally, establishing a spatial grid in a preset spatial coordinate system based on the number of the chips and the preset spatial grid form includes:
[0011] Determining the number of space grid units included in the space grid according to the number of the chips and the preset space grid form; wherein the space grid unit includes a preset number of vertices;
[0012] Establishing spatial grid units in a preset spatial coordinate system based on the number of the spatial grid units;
[0013] Connect each spatial grid unit to obtain a spatial grid.
[0014] Optionally, establishing a spatial grid unit in a preset spatial coordinate system based on the number of the spatial grid units includes:
[0015] Determine the number of spatial grid units included in the preset spatial coordinate system along each coordinate axis direction; wherein the preset spatial coordinate system includes a first direction axis, a second direction axis and a third direction axis;
[0016] Constructing an initial spatial grid unit; wherein a vertex of the initial spatial grid unit is the origin of the preset spatial coordinate system;
[0017] The initial space grid unit is iteratively replicated based on the number of space grid units included in each coordinate axis direction to obtain a space grid.
[0018] Optionally, iteratively replicating the initial spatial grid unit based on the number of spatial grid units included in each coordinate axis direction to obtain the spatial grid includes:
[0019] Based on the number of spatial grid units included in the first direction axis, the initial spatial grid unit is replicated along the first direction axis to obtain a first sub-space grid;
[0020] Based on the number of space grid units included in the second direction axis, the first subspace grid is copied along the second direction axis to obtain a second subspace grid;
[0021] The second sub-space grid is copied along the third direction axis based on the number of space grid units included in the third direction axis to obtain a space grid.
[0022] Optionally, determining the correspondence between each chip and the vertices of the spatial grid according to the physical position and connection mode of the chip includes:
[0023] Select any chip and make the physical position of the chip correspond to the origin of the spatial coordinate system;
[0024] Based on the chip corresponding to the origin and the connection mode between the chips, determine the offset between the physical position of the chip and the vertex position of the spatial grid; wherein the vertex position is represented by the coordinates of the vertex in the preset spatial coordinate system;
[0025] The offset is determined as the physical position of the chip and the connection mode determines the corresponding relationship between each chip and the vertices of the space grid.
[0026] Optionally, the preset spatial grid form includes any one of the following: a cube, a cylinder or a sphere; correspondingly, the preset spatial coordinate system is: a Cartesian coordinate system, a cylindrical coordinate system or a spherical coordinate system.
[0027] In a second aspect, an embodiment of the present invention provides a molecular dynamics calculation device based on a space grid, comprising:
[0028] An acquisition module is used to obtain the number of chips and the preset spatial grid form;
[0029] An establishing module, configured to establish a spatial grid in a preset spatial coordinate system based on the number of the chips and the preset spatial grid form; wherein the number of vertices included in the spatial grid is the same as the number of the chips;
[0030] A determination module, used to determine the corresponding relationship between each chip and the space grid vertex according to the physical position and connection mode of the chip; wherein the physical position of the chip is composed of the frame ID, the board ID and the chip ID;
[0031] A calculation module is used to perform molecular dynamics calculation based on the corresponding relationship.
[0032] Optionally, the establishing module includes:
[0033] A determination unit, configured to determine the number of space grid units included in the space grid according to the number of the chips and the preset space grid form; wherein the space grid unit includes a preset number of vertices;
[0034] An establishing unit, configured to establish a spatial grid unit in a preset spatial coordinate system based on the number of the spatial grid units;
[0035] The connection unit is used to connect the spatial grid units to obtain the spatial grid.
[0036] In a third aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising:
[0037] at least one processor; and
[0038] a memory communicatively connected to the at least one processor; wherein,
[0039] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the spatial grid-based molecular dynamics calculation method described in any embodiment of the present invention.
[0040] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the spatial grid-based molecular dynamics calculation method described in any embodiment of the present invention when executed.
[0041] The technical solution of the embodiment of the present invention is to obtain the number of chips and the preset spatial grid form; establish a spatial grid in a preset spatial coordinate system based on the number of chips and the preset spatial grid form; wherein the number of vertices included in the spatial grid is the same as the number of chips; determine the correspondence between each chip and the spatial grid vertex according to the physical position and connection method of the chip; wherein the physical position of the chip includes a frame ID, a board ID and a chip ID; perform molecular dynamics calculations based on the correspondence, solve the problems of high molecular dynamics calculation complexity and high resource consumption in the prior art, and realize efficient search of neighboring atoms; and atoms on the spatial grid can be calculated in parallel with adjacent atoms through chips, fully utilizing computing resources and effectively improving computing efficiency.
[0042] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0044] Figure 1 A flowchart of a molecular dynamics calculation method based on a spatial grid provided in Example 1 of the present invention;
[0045] Figure 2 A schematic diagram of a spatial grid unit provided in Embodiment 1 of the present invention;
[0046] Figure 3 A flow chart of a molecular dynamics calculation method based on a space grid provided in the second embodiment of the present invention;
[0047] Figure 4 A schematic diagram of a first subspace grid provided in Embodiment 2 of the present invention;
[0048] Figure 5A schematic diagram of a second subspace grid provided in Embodiment 2 of the present invention;
[0049] Figure 6 A schematic diagram of a third subspace grid provided in Embodiment 2 of the present invention;
[0050] Figure 7 A schematic diagram of the structure of a molecular dynamics calculation device based on a space grid provided in Embodiment 3 of the present invention;
[0051] Figure 8 A schematic diagram of the structure of an electronic device that can be used to implement an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0052] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0053] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0054] Embodiment 1
[0055] Figure 1 This is a flowchart of a molecular dynamics calculation method based on a space grid provided in the first embodiment of the present invention. This embodiment is applicable to molecular dynamics calculation situations. The method can be executed by a molecular dynamics calculation device based on a space grid. The molecular dynamics calculation device based on a space grid can be implemented in the form of hardware and / or software. The molecular dynamics calculation device based on a space grid can be configured in an electronic device. Figure 1 As shown, the method includes:
[0056] S110, obtaining the number of chips and the preset spatial grid form.
[0057] The number of chips may refer to the number of chips contained in a spatial grid; the preset spatial grid shape may refer to a pre-set spatial grid shape; specifically, it may be a cube, a cylinder, a cone or a sphere, etc.
[0058] In this embodiment, the number of chips contained in a space grid and the pre-set space grid shape can be directly obtained through a software program. The space grid shape can be a cube, cylinder, cone or sphere, etc., which has strong adaptability and scalability.
[0059] S120, establishing a spatial grid in a preset spatial coordinate system based on the number of chips and the preset spatial grid form; wherein the number of vertices included in the spatial grid is the same as the number of chips.
[0060] The preset spatial coordinate system may refer to a preset spatial coordinate system; specifically, the corresponding preset spatial coordinate system may be determined according to the preset spatial grid shape; for example, if the preset spatial grid shape is a cube, the corresponding preset spatial coordinate system may be a Cartesian coordinate system. The spatial grid may refer to a three-dimensional grid structure, usually composed of linear rods and vertices.
[0061] In this embodiment, after determining the number of chips contained in a spatial grid and the preset spatial grid form, a spatial grid corresponding to the chip can be automatically established in a preset spatial coordinate system corresponding to the preset spatial grid form through program setting; wherein the number of vertices included in the spatial grid is the same as the number of chips. For example, if the preset spatial grid form is a cube, the corresponding preset spatial coordinate system can be a Cartesian coordinate system, and if the number of chips is 216, it can be determined that the established spatial grid is a 6*6*6 cube.
[0062] S130, determining the corresponding relationship between each chip and the space grid vertex according to the physical position and connection mode of the chip; wherein the physical position of the chip includes the frame ID, the board ID and the chip ID.
[0063] Among them, the physical location of the chip may refer to the actual location of the chip, for example, on which board or in which frame. The frame may refer to an integrated platform, one or more boards may be integrated and installed in the frame, and one or more chips may be installed in the board. The connection mode of the chip may refer to the connection relationship between multiple chips contained in a spatial grid, for example, the connection relationship between chips in the same board, the connection relationship between chips in different boards, the connection relationship between chips in the same frame, the connection relationship between chips in different frames, etc. The physical location and connection mode of the chip may be pre-configured, for example, how many frames are configured, how many boards are configured in each frame, how many chips are configured in each board, and the connection relationship of each chip may all be pre-configured. The frame ID may refer to the frame number, the board ID may refer to the board number, and the chip ID may refer to the chip number. The corresponding relationship may refer to the corresponding relationship between the physical position of the chip and the coordinates of the vertices of the spatial grid.
[0064] In a specific embodiment, if there are 9 frames in total, 12 boards in each frame, and 2 chips in each board, the frame ID can be 1-9, the board ID can be 1-12, and the chip ID can be 1-2; if the physical position of the chip is [1,3,1], it can be understood that the chip is chip 1 in board 3 in frame 1. In order to form a spatial grid structure, each chip needs to be physically connected to at least 6 high-speed input and output buses; and the connection between chips can be connected through a backplane connector or a cable. For example, if the preset spatial grid shape is a cube and the preset spatial coordinate system is a Cartesian coordinate system, the connection relationship between the chips can be: the chips at the same position of the frame board are connected through a backplane connector in the Z-axis direction of the spatial grid, and the chips are connected through cables in the Y-axis direction of the spatial grid. In the X-axis direction of the spatial grid, half of the chips are interconnected with the chips in the board through the backplane connector, and the other half of the chips are connected to the same position of the adjacent frame through a cable; further, since there is a parity inversion phenomenon in the horizontal connection of the chip backplane routing, in order to optimize the routing length, the connection between the chips in the X-axis direction of the spatial grid can be reversed by using a parity flipping method, specifically, the backplane connectors of half of the boards and the other half of the boards in the frame have opposite polarities in the X-axis direction of the spatial grid, the cable interfaces have opposite polarities in the X-axis direction of the spatial grid, and the polarity configurations of the upper and lower adjacent frames in the X-axis direction of the spatial grid are also opposite; this embodiment does not limit the specific chip physical position configuration and connection mode configuration. In actual application, the physical location and connection method of the chips can be configured according to the number of chips and the spatial grid form, which has strong adaptability and scalability.
[0065] In this embodiment, the physical position and connection mode of the chips can be pre-configured according to the number of chips and the preset spatial grid form; the correspondence between the physical position of each chip and each vertex of the spatial grid is determined according to the physical position and connection mode of the chips.
[0066] S140. Perform molecular dynamics calculation based on the corresponding relationship.
[0067] Among them, molecular dynamics calculations can refer to observing and analyzing the behavior of the system by simulating the motion state of atoms and molecules over a period of time based on set initial conditions and interatomic interaction potentials. Specifically, chips can be used for molecular dynamics calculations, which can greatly improve the speed and accuracy of the simulation.
[0068] In this embodiment, performing molecular dynamics calculation based on the correspondence relationship may refer to performing molecular dynamics calculation by constructing a spatial grid with a correspondence relationship between the physical position of the chip and the coordinates of the vertices of the spatial grid, thereby realizing efficient search of neighboring atoms; for example, Figure 2 A schematic diagram of a space grid unit provided in the first embodiment of the present invention, such as Figure 2 As shown, one vertex corresponds to one chip. If each chip only calculates the force of one atom, then one point can only calculate the interaction force in six directions, for example Figure 2 For the point "5" at the upper right corner of the middle cube, we can only calculate the directions between "5" and "1", between "5" and "7", between "5" and "6", and the other three directions connected to "5" ( Figure 2 Compared with the cluster-like uneven atomic distribution in the prior art, the present invention can efficiently realize the efficient search of neighboring atoms by constructing a spatial grid with a corresponding relationship between the physical position of the chip and the coordinates of the spatial grid vertices, which can effectively improve the calculation efficiency. In addition, Figure 2 As shown, the interaction forces between "2" and "4", "2" and "6", and "2" and "1" can be calculated simultaneously, that is, the atoms on the spatial grid and the adjacent atoms can be calculated in parallel through the chip, making full use of computing resources and further improving computing efficiency.
[0069] The technical solution of this embodiment is to obtain the number of chips and the preset spatial grid form; establish a spatial grid in a preset spatial coordinate system based on the number of chips and the preset spatial grid form; wherein the number of vertices included in the spatial grid is the same as the number of chips; determine the correspondence between each chip and the spatial grid vertex according to the physical position and connection method of the chip; wherein the physical position of the chip is determined by the frame ID, board ID and chip ID; perform molecular dynamics calculations based on the corresponding relationship to solve the problems of high molecular dynamics calculation complexity and high resource consumption in the prior art; realize efficient search of neighboring atoms; and atoms on the spatial grid can be calculated in parallel with adjacent atoms through chips, fully utilizing computing resources and greatly improving computing efficiency.
[0070] Optionally, in the constructed spatial grid, after each pair of particles performs an interaction force calculation, it does not need to be saved, which can effectively reduce memory usage. For example, Figure 2 As shown in the figure, the calculation between "1" and "2" can be completed without saving; then the calculation between "1" and "3", that is, the calculation between atoms is independent of each other. In addition, the number of connection buses and the connection direction of the chips in the spatial grid are pre-fixed, and there is no need to consider which chip is connected in each direction, which can effectively simplify the boundary condition processing.
[0071] Embodiment 2
[0072] Figure 3 This is a flow chart of a molecular dynamics calculation method based on a spatial grid provided in the second embodiment of the present invention. The technical solution of this embodiment is further refined on the basis of the above embodiment. Figure 3 As shown, the method includes:
[0073] S210, obtaining the number of chips and the preset spatial grid form.
[0074] S220, determining the number of space grid units included in the space grid according to the number of chips and the preset space grid form, wherein the space grid unit includes a preset number of vertices.
[0075] The spatial grid unit may refer to the basic unit for establishing a spatial grid, and the number of spatial grid units may refer to the number of spatial grid units required for establishing a spatial grid. The spatial grid unit may be composed of a preset number of vertices, and the specific preset number may be determined according to the spatial grid form. Different spatial grid forms correspond to different spatial grid units, and the number of vertices constituting different spatial grid units also varies. For example, if the preset spatial grid form is a cube, such as Figure 2 As shown, Figure 2The cube in is a space grid unit, and the space grid unit includes 8 vertices.
[0076] In this embodiment, the preset number of vertices for constructing the spatial grid unit can be determined according to the preset spatial grid form. The number of chips is the number of vertices in the spatial grid. The number of spatial grid units is determined according to the number of vertices in the spatial grid and the preset number of vertices for constructing the spatial grid unit. Specifically, the number of spatial grid units can be equal to the number of vertices in the spatial grid divided by the preset number of vertices for constructing the spatial grid unit. For example, if the preset spatial grid form is a cube, then the spatial grid unit can be a small cube, such as Figure 2 As shown, the preset number of vertices for constructing the space grid unit is 8. If the number of chips is 216, the number of the space grid units is 216 / 8=27.
[0077] S230: Establishing spatial grid units in a preset spatial coordinate system based on the number of spatial grid units.
[0078] In this embodiment, a corresponding number of space grid units may be established in the preset space coordinate system according to the number of space grid units.
[0079] S240, connecting the spatial grid units to obtain a spatial grid.
[0080] In this embodiment, the established spatial grid units are arranged according to the preset arrangement positions and connected to each other through the bus to obtain a spatial grid. The preset arrangement position may refer to the preset position of each spatial grid unit in the spatial coordinate system, and a spatial grid of a preset spatial grid form may be constructed according to the preset arrangement position.
[0081] S250, determining the corresponding relationship between each chip and the space grid vertex according to the physical position and connection mode of the chip; wherein the physical position of the chip includes the frame ID, the board ID and the chip ID.
[0082] S260. Perform molecular dynamics calculation based on the corresponding relationship.
[0083] In this embodiment, by obtaining the number of chips and a preset spatial grid form, the number of spatial grid units contained in the spatial grid is determined according to the number of chips and the preset spatial grid form; wherein the spatial grid unit includes a preset number of vertices; based on the number of spatial grid units, a spatial grid unit is established in a preset spatial coordinate system; each spatial grid unit is connected to obtain a spatial grid; the correspondence between each chip and the spatial grid vertex is determined according to the physical position and connection method of the chip; wherein the physical position of the chip is determined by the frame ID, the board ID and the chip ID; molecular dynamics calculations are performed based on the correspondence; the problems of high complexity and high resource consumption of molecular dynamics calculations in the prior art are solved; efficient search of neighboring atoms is achieved; and atoms on the spatial grid and adjacent atoms can be calculated in parallel through chips, fully utilizing computing resources, which can greatly improve computing efficiency.
[0084] Furthermore, the present invention determines different spatial grid units and the number of spatial grid units according to different spatial grid forms, and establishes a spatial grid corresponding to the spatial grid form. The preset spatial grid form is not limited to a cube, and can be a cube, a cylinder, a cone, a sphere, etc. This embodiment does not limit the specific preset spatial grid form, and can be pre-set according to actual conditions. Therefore, the spatial grid constructed by the present invention has strong adaptability and extensibility, and can effectively improve the flexibility and efficiency of molecular dynamics calculations.
[0085] Optionally, establishing a spatial grid unit in a preset spatial coordinate system based on the number of the spatial grid units includes:
[0086] Determine the number of spatial grid units included in the preset spatial coordinate system along each coordinate axis direction; wherein the preset spatial coordinate system includes a first direction axis, a second direction axis and a third direction axis;
[0087] Among them, the number of spatial grid units contained in each coordinate axis direction may refer to the number of spatial grid units divided along each coordinate axis when constructing the spatial grid. It can be specifically determined according to the number of chips and the preset spatial grid form. For example, if the preset spatial grid form is a cube and the number of chips is 216, then the number of spatial grid units is 216 / 8=27. Since 27=3*3*3, the number of spatial grid units contained in each coordinate axis direction is 3. In addition, depending on the different preset spatial coordinate systems, the coordinate axes in the preset spatial coordinate system are also different. For example, if the preset spatial coordinate system is a three-dimensional Cartesian coordinate system, then the coordinate axes in the Cartesian coordinate system are X, Y, and Z axes, and the first direction axis, the second direction axis, and the third direction axis can be any one of the X, Y, and Z axes; if the preset spatial coordinate system is a cylindrical coordinate system, then the coordinate axes in the cylindrical coordinate system are r, φ, and z axes, and the first direction axis, the second direction axis, and the third direction axis can be any one of the r, φ, and z axes.
[0088] Constructing an initial spatial grid unit; wherein a vertex of the initial spatial grid unit is the origin of the preset spatial coordinate system;
[0089] The initial spatial grid unit may refer to the first spatial grid unit established.
[0090] Specifically, the origin coordinates in a preset spatial coordinate system can be predefined by a software program, and an initial spatial grid unit can be constructed by replicating along the first direction axis, the second direction axis, and the third direction axis based on the determined origin coordinates. Figure 2 As shown, if the preset spatial coordinate system is a three-dimensional Cartesian coordinate system, the first direction axis, the second direction axis and the third direction axis are the X, Y and Z axes respectively, and "4" is pre-defined as the origin coordinate [0, 0, 0] in the Cartesian coordinate system, the origin coordinate "4" is copied one unit along the X axis to obtain "2" with coordinates [1, 0, 0], and "2" and "4" are copied one unit along the Y axis to obtain "3" with coordinates [0, 1, 0] and "1" with coordinates [1, 1, 0], and "1", "2", "3" and "4" are copied one unit along the Z axis to obtain "5" with coordinates [1, 1, 1], "6" with coordinates [1, 0, 1], "7" with coordinates [0, 1, 1], and "8" with coordinates [0, 0, 1]; an initial spatial grid unit is constructed through vertices "1", "2" ... "8".
[0091] The initial space grid unit is iteratively replicated based on the number of space grid units included in each coordinate axis direction to obtain a space grid.
[0092] Here, iterative replication may refer to repeated replication; specifically, based on the established initial spatial grid unit, repeated replication may be performed along each coordinate axis direction according to the number of spatial grid units included in each coordinate axis direction to obtain a spatial grid.
[0093] In this embodiment, the number of spatial grid units included in the preset spatial coordinate system along each coordinate axis direction can be determined according to the number of chips and the preset spatial grid form; an initial spatial grid unit is constructed by pre-defining the origin coordinates in a preset spatial coordinate system; the initial spatial grid unit is iteratively replicated based on the number of spatial grid units included in each coordinate axis direction to obtain a spatial grid; molecular dynamics calculations are performed according to the correspondence between each chip and the spatial grid, which can achieve efficient search of neighboring atoms, and atoms on the spatial grid can be calculated in parallel with adjacent atoms through chips, making full use of computing resources and greatly improving computing efficiency.
[0094] Optionally, iteratively replicating the initial spatial grid unit based on the number of spatial grid units included in each coordinate axis direction to obtain the spatial grid includes:
[0095] Based on the number of spatial grid units included in the first direction axis, the initial spatial grid unit is replicated along the first direction axis to obtain a first sub-space grid;
[0096] Specifically, the initial spatial grid unit can be replicated along the first direction axis based on the preset unit, and the number of replications along the first direction axis can be determined according to the number of spatial grid units included in the first direction axis. The preset unit can refer to the unit corresponding to each replication, which is specifically an integer not less than 2; the number of replications along the first direction axis can specifically be the number of spatial grid units included in the first direction axis minus 1.
[0097] In a specific embodiment, Figure 4 A schematic diagram of a first subspace grid provided in Embodiment 2 of the present invention is shown in FIG. Figure 4 As described above, if the set unit is 2, the preset spatial coordinate system is a Cartesian coordinate system, the first direction axis is the Z axis, and the number of spatial grid units contained in the first direction axis is 3, then the initial spatial grid unit is copied twice along the Z axis, and the Z axis coordinate increases by 2 units each time it is copied, and two copied initial spatial grid units are obtained. Adding the originally established initial spatial grid units, three initial spatial grid units are obtained, and the first sub-space grid is established by the three initial spatial grid units.
[0098] Based on the number of space grid units included in the second direction axis, the first subspace grid is copied along the second direction axis to obtain a second subspace grid;
[0099] Specifically, the first subspace grid can be replicated along the second direction axis based on a preset unit, and the number of replications along the second direction axis can be determined according to the number of spatial grid units included in the second direction axis. The number of replications along the second direction axis can specifically be the number of spatial grid units included in the second direction axis minus 1.
[0100] In a specific embodiment, Figure 5 A schematic diagram of a second subspace grid provided in the second embodiment of the present invention is shown in FIG. Figure 5 As described above, if the set unit is 2, the preset spatial coordinate system is the Cartesian coordinate system, the second direction axis is the X-axis, and the number of spatial grid units contained in the second direction axis is 3, then the first subspace grid is copied twice along the X-axis, and the X-axis coordinate increases by 2 units each time it is copied, and two copied first subspace grids are obtained. Add the originally established first subspace grid, that is, 3 first subspace grids are obtained, and the second subspace grid is established by the 3 first subspace grids.
[0101] The second sub-space grid is copied along the third direction axis based on the number of space grid units included in the third direction axis to obtain a space grid.
[0102] Specifically, the second subspace grid can be copied along the third axis based on the preset unit, and the number of copies along the third axis can be determined according to the number of spatial grid units included in the third axis. The number of copies along the third axis can be specifically the number of spatial grid units included in the third axis minus 1.
[0103] In a specific embodiment, Figure 6 A schematic diagram of a third subspace grid provided in the second embodiment of the present invention is shown in FIG. Figure 6 As shown, if the set unit is 2, the preset spatial coordinate system is the Cartesian coordinate system, the third axis is the Y axis, and the number of spatial grid units contained in the third axis is 3, then the second subspace grid is copied twice along the Y axis, and the Y axis coordinate increases by 2 units each time it is copied, and two copied second subspace grids are obtained. Adding the originally established second subspace grid, three second subspace grids are obtained, and a spatial grid is established by the three second subspace grids.
[0104] In this embodiment, the initial spatial grid cells are replicated along the first direction axis based on the number of spatial grid cells included in the first direction axis to obtain a first subspace grid; the first subspace grid is replicated along the second direction axis based on the number of spatial grid cells included in the second direction axis to obtain a second subspace grid; the second subspace grid is replicated along the third direction axis based on the number of spatial grid cells included in the third direction axis to obtain a spatial grid; based on the spatial grid obtained by iterative replication, molecular dynamics calculations are performed according to the correspondence between each chip and the spatial grid, which can achieve efficient search of neighboring atoms, and the atoms on the spatial grid and the adjacent atoms can be calculated in parallel through the chip, making full use of computing resources, which can greatly improve computing efficiency.
[0105] Optionally, determining the correspondence between each chip and the vertices of the spatial grid according to the physical position and connection mode of the chip includes:
[0106] Select any chip and make the physical position of the chip correspond to the origin of the spatial coordinate system;
[0107] Based on the chip corresponding to the origin and the connection mode between the chips, determine the offset between the physical position of the chip and the vertex position of the spatial grid; wherein the vertex position is represented by the coordinates of the vertex in the preset spatial coordinate system;
[0108] The offset is determined as the physical position of the chip and the connection mode determines the corresponding relationship between each chip and the vertices of the space grid.
[0109] Among them, the offset value may refer to a new position obtained by moving from a specified reference position according to a specific row offset and column offset. Specifically, due to the limitation of the actual physical position of the chip, such as multiple chips are installed in the same board, and multiple boards are installed in the same frame, the spatial grid constructed by the present invention is a spatial grid formed according to the connection method of each chip connection bus, and the straight rods between the vertices in the spatial grid are the connection buses between chips. However, since the high-speed input and output buses between chips are not connected in sequence according to the board order, for different bus connection methods between chips, the offset between the physical position of different chips and the vertex position of the spatial grid is also different, so the offset function can be used to identify the orientation relationship between chips and determine the offset between the physical position of different chips and the vertex position of the spatial grid.
[0110] In a specific embodiment, any one chip can be selected from multiple chips in the program code to correspond the physical position of the chip to the origin of the spatial coordinate system; for example, if the spatial coordinate system is a Cartesian coordinate system, the chip [1,1,1] whose physical position is frame 1, board 1, chip 1 can be selected to correspond to the origin [0,0,0] of the spatial coordinate system, then the offset between the physical position of the chip and the vertex position of the spatial grid in each coordinate axis direction is 1. For another example, if the chip corresponding to the origin
[0111] The chip connected to [1,1,1] is [1,3,1]. The physical connection between the two chips is that the same position of board 1 and board 3 in chassis 1 (that is, chip 1 in board 1 and chip 1 in board 3) are connected together, and the vertex coordinates connected to the origin coordinates in the spatial grid are [0,1,0]. The offset between chip [1,3,1] and vertex [0,1,0] in the X-axis direction is 1, the offset in the Y-axis direction is 2, and the offset in the Z-axis direction is 1.
[0112] In this embodiment, any one chip can be selected from multiple chips through the program code, and the physical position of the chip can be corresponded to the origin of the spatial coordinate system. Based on the chip corresponding to the origin and the actual connection method between the chips, the offset between the physical positions of different chips and the vertex positions of the spatial grid is determined through the offset function; the offset is determined as the physical position and connection method of the chip to determine the correspondence between each chip and the vertices of the spatial grid, thereby realizing efficient search of adjacent atoms, and the atoms on the spatial grid and the adjacent atoms can be calculated in parallel through the chip, making full use of computing resources, which can greatly improve computing efficiency.
[0113] Optionally, the preset spatial grid form includes any one of the following: a cube, a cylinder or a sphere; correspondingly, the preset spatial coordinate system is: a Cartesian coordinate system, a cylindrical coordinate system or a spherical coordinate system.
[0114] Embodiment 3
[0115] Figure 7 This is a schematic diagram of the structure of a molecular dynamics calculation device based on a space grid provided in the third embodiment of the present invention. Figure 7 As shown, the device comprises:
[0116] An acquisition module 310 is used to acquire the number of chips and a preset spatial grid shape;
[0117] An establishing module 320, configured to establish a spatial grid in a preset spatial coordinate system based on the number of the chips and the preset spatial grid form; wherein the number of vertices included in the spatial grid is the same as the number of the chips;
[0118] A determination module 330 is used to determine the correspondence between each chip and the vertices of the spatial grid according to the physical position and connection mode of the chip; wherein the physical position of the chip is composed of the frame ID, the board ID and the chip ID;
[0119] The calculation module 340 is used to perform molecular dynamics calculation based on the corresponding relationship.
[0120] Optionally, the establishing module 320 includes:
[0121] A determination unit, configured to determine the number of space grid units included in the space grid according to the number of the chips and the preset space grid form; wherein the space grid unit includes a preset number of vertices;
[0122] An establishing unit, configured to establish a spatial grid unit in a preset spatial coordinate system based on the number of the spatial grid units;
[0123] The connection unit is used to connect the spatial grid units to obtain the spatial grid.
[0124] Optionally, build a unit including:
[0125] A determination subunit, used to determine the number of spatial grid units included in the preset spatial coordinate system along each coordinate axis direction; wherein the preset spatial coordinate system includes a first direction axis, a second direction axis and a third direction axis;
[0126] A construction subunit is used to construct an initial space grid unit; wherein a vertex of the initial space grid unit is the origin of the preset space coordinate system;
[0127] The iterative replication subunit is used to iteratively replicate the initial spatial grid unit based on the number of spatial grid units included in each coordinate axis direction to obtain a spatial grid.
[0128] Optionally, iteratively copy subunits, specifically for:
[0129] Based on the number of spatial grid units included in the first direction axis, the initial spatial grid unit is replicated along the first direction axis to obtain a first sub-space grid;
[0130] Based on the number of space grid units included in the second direction axis, the first subspace grid is copied along the second direction axis to obtain a second subspace grid;
[0131] The second sub-space grid is copied along the third direction axis based on the number of space grid units included in the third direction axis to obtain a space grid.
[0132] Optionally, the determination module 330 is specifically configured to:
[0133] Select any chip and make the physical position of the chip correspond to the origin of the spatial coordinate system;
[0134] Based on the chip corresponding to the origin and the connection mode between the chips, determine the offset between the physical position of the chip and the vertex position of the spatial grid; wherein the vertex position is represented by the coordinates of the vertex in the preset spatial coordinate system;
[0135] The offset is determined as the physical position of the chip and the connection mode determines the corresponding relationship between each chip and the vertices of the space grid.
[0136] Optionally, the preset spatial grid form includes any one of the following: a cube, a cylinder or a sphere; correspondingly, the preset spatial coordinate system is: a Cartesian coordinate system, a cylindrical coordinate system or a spherical coordinate system.
[0137] The molecular dynamics calculation device based on a space grid provided in the embodiment of the present invention can execute the molecular dynamics calculation method based on a space grid provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0138] Embodiment 4
[0139] Figure 8 A schematic diagram of an electronic device that can be used to implement an embodiment of the present invention is shown. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0140] like Figure 8 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by the at least one processor 11, and the computer program is executed by the at least one processor 11 so that the at least one processor 11 can execute the spatial grid-based molecular dynamics calculation method provided by the present invention.
[0141] The processor 11 can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 12 or a computer program loaded from a storage unit 18 into a random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0142] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0143] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a molecular dynamics calculation method based on a spatial grid.
[0144] In some embodiments, the molecular dynamics calculation method based on the spatial grid can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the molecular dynamics calculation method based on the spatial grid described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the molecular dynamics calculation method based on the spatial grid by any other appropriate means (for example, by means of firmware).
[0145] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard parts (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0146] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0147] In the context of the present invention, a computer-readable storage medium stores a computer instruction, and the computer instruction is used to implement the molecular dynamics calculation method based on the spatial grid provided by the present invention when the processor is executed. A computer-readable storage medium can be a tangible medium, which can contain or store a computer program for use by an instruction execution system, a device or an equipment or used in combination with an instruction execution system, a device or an equipment. A computer-readable storage medium can include but is not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the above. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0148] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a cathode ray tube (CRT) or a liquid crystal display (LCD monitor)) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball), through which the user may provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0149] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by digital data communication (e.g., a communication network) in any form or medium. Examples of communication networks include: Local Area Network (LAN), Wide Area Network (WAN), blockchain network, and the Internet.
[0150] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.
[0151] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0152] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A molecular dynamics calculation method based on spatial grid, It is characterized in that include: Get the number of chips and the preset spatial grid shape; Establishing a spatial grid in a preset spatial coordinate system based on the number of the chips and the preset spatial grid form, wherein the number of vertices included in the spatial grid is the same as the number of the chips; Determine the corresponding relationship between each chip and the space grid vertex according to the physical position and connection mode of the chip, wherein the physical position of the chip includes the frame ID, the board ID and the chip ID; Molecular dynamics calculations were performed based on the correspondence.
2. The method according to claim 1, It is characterized in that Establishing a spatial grid in a preset spatial coordinate system based on the number of the chips and the preset spatial grid form includes: Determine the number of space grid units included in the space grid according to the number of the chips and the preset space grid form, wherein the space grid unit includes a preset number of vertices; Establishing spatial grid units in a preset spatial coordinate system based on the number of the spatial grid units; Connect each spatial grid unit to obtain a spatial grid.
3. The method according to claim 2, It is characterized in that Establishing a spatial grid unit in a preset spatial coordinate system based on the number of the spatial grid units includes: Determine the number of spatial grid units included in the preset spatial coordinate system along each coordinate axis direction; wherein the preset spatial coordinate system includes a first direction axis, a second direction axis and a third direction axis; Constructing an initial spatial grid unit; wherein a vertex of the initial spatial grid unit is the origin of the preset spatial coordinate system; The initial space grid unit is iteratively replicated based on the number of space grid units included in each coordinate axis direction to obtain a space grid.
4. The method according to claim 3, It is characterized in that The initial spatial grid unit is iteratively replicated based on the number of spatial grid units included in each coordinate axis direction to obtain a spatial grid, including: Based on the number of spatial grid units included in the first direction axis, the initial spatial grid unit is replicated along the first direction axis to obtain a first sub-space grid; Based on the number of space grid units included in the second direction axis, the first subspace grid is copied along the second direction axis to obtain a second subspace grid; The second sub-space grid is copied along the third direction axis based on the number of space grid units included in the third direction axis to obtain a space grid.
5. The method according to claim 3, It is characterized in that Determining the corresponding relationship between each chip and the vertices of the spatial grid according to the physical position and connection mode of the chip, including: Select any chip and make the physical position of the chip correspond to the origin of the spatial coordinate system; Based on the chip corresponding to the origin and the connection mode between the chips, determine the offset between the physical position of the chip and the vertex position of the spatial grid; wherein the vertex position is represented by the coordinates of the vertex in the preset spatial coordinate system; The offset is determined as the physical position of the chip and the connection mode determines the corresponding relationship between each chip and the vertices of the space grid.
6. The method according to any one of claims 1 to 5, It is characterized in that The preset spatial grid shape includes any one of the following: a cube, a cylinder or a sphere; correspondingly, the preset spatial coordinate system is: a Cartesian coordinate system, a cylindrical coordinate system or a spherical coordinate system.
7. A molecular dynamics calculation device based on a spatial grid, It is characterized in that include: An acquisition module is used to obtain the number of chips and the preset spatial grid form; An establishing module, configured to establish a spatial grid in a preset spatial coordinate system based on the number of the chips and the preset spatial grid form; wherein the number of vertices included in the spatial grid is the same as the number of the chips; A determination module, used to determine the corresponding relationship between each chip and the space grid vertex according to the physical position and connection mode of the chip; wherein the physical position of the chip includes the frame ID, the board ID and the chip ID; A calculation module is used to perform molecular dynamics calculation based on the corresponding relationship.
8. The device according to claim 7, It is characterized in that The establishment module comprises: A determination unit, configured to determine the number of space grid units included in the space grid according to the number of the chips and the preset space grid form; wherein the space grid unit includes a preset number of vertices; An establishing unit, configured to establish a spatial grid unit in a preset spatial coordinate system based on the number of the spatial grid units; The connection unit is used to connect the spatial grid units to obtain the spatial grid.
9. An electronic device, It is characterized in that include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the spatial grid-based molecular dynamics calculation method according to any one of claims 1 to 6.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the molecular dynamics calculation method based on a spatial grid according to any one of claims 1 to 6 when executed.
Citation Information
Patent Citations
Adaptive parallel algorithm for traversing neighbors in fixed radius under CPU-GPU (Central Processing Unit-Graphic Processing Unit) heterogeneous framework
CN105468439A
Communication method and device for management chip and chip grid array, equipment and medium
CN113709039A
Large-scale high-speed molecular dynamics calculation method based on FPGA heterogeneous calculation platform
CN115527617A
Molecular dynamics calculating device
JP1993274277A
Cited By
Debugging method and system for molecular dynamics atom migration calculation
CN121215052A
