Molecular dynamics simulation acting force analysis method and device and computer equipment
By constructing a group adjacency list and calculating the force results of molecules, the problems of poor adaptability and low calculation efficiency of supercomputers in the existing technology are solved, and more efficient calculation of inter-atomic interaction forces is achieved.
Patent Information
- Application Number
- CN202410880508.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-02
- Publication Date
- 2024-09-24
AI Technical Summary
Existing molecular dynamics simulation software cannot fully adapt to the processor architecture of supercomputers, resulting in low calculation efficiency of interaction forces between atoms, inability to fully utilize data locality and repeated memory access, resulting in low calculation efficiency.
By obtaining the number of local atoms and the neighbor list, constructing a group adjacency list, randomly screening the target atom group, and calculating the molecular force results, avoiding the complex calculation of the force between a single local atom and all atoms of the simulation system, improving the data reuse rate and Computing performance.
It improves the calculation efficiency of the interaction force between atoms, reduces the memory access overhead, and improves the computing performance during molecular dynamics simulation.
Smart Images

Figure CN118692576A
Abstract
Description
Technical Field
[0001] The present application relates to the field of molecular dynamics technology, and in particular to a method, device, and computer equipment for analyzing the forces of molecular dynamics simulation. Background Art
[0002] Molecular dynamics simulation is a computer simulation method that helps people understand the microscopic process of materials at the atomic and molecular levels. It is one of the important scientific research tools in the field of materials science. The basic principle followed by molecular dynamics simulation is the classical Newton's law of motion. By numerically solving the Newtonian motion equations of particles in the simulation system, the coordinates and momentum of the particles at each moment are obtained, and then the motion trajectory of the phase space is obtained. Then, the macroscopic properties of the system are obtained using statistical mechanics methods, so as to analyze and design materials.
[0003] With the increasing demand for cross-scale material science computing, the scale of molecular dynamics simulation systems has continued to grow, reaching billions or even tens of billions of atoms. Large-scale molecular dynamics simulations cannot be achieved without the support of powerful supercomputers. However, different supercomputers have different processor architecture characteristics. The data structure and algorithm design of existing material calculation software cannot fully capture the local characteristics of the data, making it difficult to perfectly adapt to supercomputers and usually unable to perform optimally. As a result, the calculation efficiency of the interaction forces between atoms is low during molecular dynamics simulations. Summary of the invention
[0004] Based on this, it is necessary to provide a force analysis method, device, computer equipment, computer-readable storage medium and computer program product for molecular dynamics simulation to address the above technical problems.
[0005] In a first aspect, the present application provides a method for analyzing the forces of molecular dynamics simulation. The method comprises:
[0006] Obtain the number of local atoms of the current process and the neighbor list corresponding to each local atom, and determine the number of groups of adjacency lists adapted by the current process and the allocated memory value of all groups of adjacency lists based on the number of local atoms of the current process;
[0007] Based on the number of groups of the adjacency lists adapted by the current process, the local atoms are grouped to obtain atomic groups, and in each atomic group, a target atomic group and a neighbor list corresponding to each local atom in the target atomic group are randomly selected;
[0008] Based on the neighbor lists corresponding to each local atom in the target atomic group and the allocated memory values of all group adjacency lists, a target group adjacency list is constructed through an adjacency list construction strategy, and the target atomic group is re-screened in each non-target atomic group; each atomic group can only be screened once;
[0009] Return to execute the neighbor list corresponding to each local atom in the target atom group, construct the target group adjacency table step through the adjacency list construction strategy, obtain multiple target group adjacency lists, and calculate the molecular force results of each local atom in the current process based on each target group adjacency list, each target atom group corresponding to each target adjacency list, and the three-dimensional coordinates of each local atom.
[0010] Optionally, the determining, based on the number of local atoms of the current process, the number of groups of adjacency lists adapted by the current process and the allocated memory value of all groups of adjacency lists includes:
[0011] Obtaining the maximum number of local atoms in each historical process and a preset group factor, and identifying the number of local atoms of the target atom type in each local atom of the current process;
[0012] Based on the maximum number of local atoms and the number of local atoms of the target atom type, the number of groups of adjacency lists adapted by the current process is calculated, and based on the number of groups of each group of adjacency lists, the maximum number of neighbors of each atom, and the preset group factor, the allocated memory value of all group adjacency lists is calculated.
[0013] Optionally, the grouping of the local atoms based on the number of groups of the adjacency lists adapted by the current process to obtain the atomic groups includes:
[0014] identifying architecture information of the group adjacency list, and based on the architecture information, identifying a vector width of the group adjacency list;
[0015] Based on the vector width, the local atoms are grouped to obtain atomic groups.
[0016] Optionally, after randomly screening the target atom group and the neighbor list corresponding to each local atom in the target atom group in each atom group, the method further includes:
[0017] Obtaining an adjacency list construction strategy, and identifying a target cutoff radius corresponding to the adjacency list construction strategy;
[0018] The atom number of each neighbor atom in each neighbor list is identified, and the neighbor atoms in each neighbor list are sorted in ascending order according to the atom number of each neighbor atom to obtain a list sequence of each neighbor list.
[0019] Optionally, the constructing the target group adjacency list through an adjacency list construction strategy based on the neighbor list corresponding to each local atom in the target atom group and the allocated memory value of all group adjacency lists includes:
[0020] For each local atom, based on the list sequence of the neighbor list corresponding to the local atom, construct an integer pointer of the neighbor list corresponding to the local atom;
[0021] Calculating the starting coordinates of the group adjacency list based on the atomic position of each local atom in the target atomic group, and screening the target memory address of the group adjacency list from the allocated memory of all group adjacency lists based on the starting coordinates of the group adjacency list;
[0022] Based on the target memory address of the group adjacency list, the target truncation radius corresponding to the adjacency list construction strategy, and the integer pointer of the neighbor list corresponding to each of the local atoms, the adjacency list construction strategy is used to filter each of the neighbor lists stored in the group adjacency list, and the group adjacency list containing each of the neighbor atoms is used as the target group adjacency list corresponding to the target atomic group.
[0023] Optionally, the calculating the molecular force result of each local atom of the current process based on each target group adjacency list, each target atom group corresponding to each target adjacency list, and the three-dimensional coordinates of each local atom includes:
[0024] For each target atom group, the three-dimensional coordinates of each local atom in the target atom group are used to generate a first set of vectors, and the atom number of each neighbor atom is obtained from the target group adjacency table corresponding to the target atom group;
[0025] Based on each of the atom numbers, identifying the three-dimensional coordinates of the local atoms corresponding to each of the neighbor atoms, and based on the three-dimensional coordinates of the local atoms, generating a second set of vectors, and performing difference calculations on the second set of vectors and the first set of vectors to obtain a third set of vectors;
[0026] Performing square sum processing on the third group of vectors to obtain a first target vector, and generating a second target vector based on the first target vector and the target cutoff radius;
[0027] Calculate the vector difference between the first target vector and the second target vector to obtain a mask vector, and obtain the atomic type of each local atom in the target atomic group and the potential parameter corresponding to each atomic type;
[0028] Based on the potential parameters of each local atom and the second target vector, the incremental force result of each local atom is calculated respectively, and based on the third group of vectors, the incremental force result of each local atom, and the mask vector, the molecular force result of each local atom is identified.
[0029] In a second aspect, the present application also provides a force analysis device for molecular dynamics simulation. The device comprises:
[0030] An acquisition module, used to acquire the number of local atoms of the current process and the neighbor list corresponding to each local atom, and determine the number of groups of adjacency lists adapted by the current process and the allocated memory value of all groups of adjacency lists based on the number of local atoms of the current process;
[0031] A grouping module, for grouping the local atoms based on the number of groups of the adjacency lists adapted by the current process to obtain atomic groups, and randomly selecting a target atomic group and a neighbor list corresponding to each local atom in the target atomic group in each atomic group;
[0032] A construction module, for constructing a target group adjacency list based on the neighbor list corresponding to each local atom in the target atom group and the allocated memory value of all group adjacency lists through an adjacency list construction strategy, and re-screening the target atom group in each non-target atom group; each atom group can only be screened once;
[0033] A calculation module is used to return and execute a neighbor list corresponding to each local atom in the target atom group, construct a target group adjacency table step through an adjacency table construction strategy, obtain multiple target group adjacency lists, and calculate the molecular force results of each local atom in the current process based on each target group adjacency table, each target atom group corresponding to each target adjacency table, and the three-dimensional coordinates of each local atom.
[0034] Optionally, the acquisition module is specifically used to:
[0035] Obtaining the maximum number of local atoms in each historical process and a preset group factor, and identifying the number of local atoms of the target atom type in each local atom of the current process;
[0036] Based on the maximum number of local atoms and the number of local atoms of the target atom type, the number of groups of adjacency lists adapted by the current process is calculated, and based on the number of groups of each group of adjacency lists, the maximum number of neighbors of each atom, and the preset group factor, the allocated memory value of all group adjacency lists is calculated.
[0037] Optionally, the grouping module is specifically used to:
[0038] identifying architecture information of the group adjacency list, and based on the architecture information, identifying a vector width of the group adjacency list;
[0039] Based on the vector width, the local atoms are grouped to obtain atomic groups.
[0040] Optionally, the device further comprises:
[0041] An identification module, used to obtain an adjacency list construction strategy and identify a target cutoff radius corresponding to the adjacency list construction strategy;
[0042] The sorting module is used to identify the atomic number of each neighbor atom in each neighbor list, and sort each neighbor atom in each neighbor list in ascending order according to the atomic number of each neighbor atom to obtain a list sequence of each neighbor list.
[0043] Optionally, the building module is specifically used for:
[0044] For each local atom, based on the list sequence of the neighbor list corresponding to the local atom, construct an integer pointer of the neighbor list corresponding to the local atom;
[0045] Calculating the starting coordinates of the group adjacency list based on the atomic position of each local atom in the target atomic group, and screening the target memory address of the group adjacency list from the allocated memory of all group adjacency lists based on the starting coordinates of the group adjacency list;
[0046] Based on the target memory address of the group adjacency list, the target truncation radius corresponding to the adjacency list construction strategy, and the integer pointer of the neighbor list corresponding to each of the local atoms, the adjacency list construction strategy is used to filter each of the neighbor lists stored in the group adjacency list, and the group adjacency list containing each of the neighbor atoms is used as the target group adjacency list corresponding to the target atomic group.
[0047] Optionally, the computing module is specifically used for:
[0048] For each target atom group, the three-dimensional coordinates of each local atom in the target atom group are used to generate a first set of vectors, and the atom number of each neighbor atom is obtained from the target group adjacency table corresponding to the target atom group;
[0049] Based on each of the atom numbers, identifying the three-dimensional coordinates of the local atoms corresponding to each of the neighbor atoms, and based on the three-dimensional coordinates of the local atoms, generating a second set of vectors, and performing difference calculations on the second set of vectors and the first set of vectors to obtain a third set of vectors;
[0050] Performing square sum processing on the third group of vectors to obtain a first target vector, and generating a second target vector based on the first target vector and the target cutoff radius;
[0051] Calculate the vector difference between the first target vector and the second target vector to obtain a mask vector, and obtain the atomic type of each local atom in the target atomic group and the potential parameter corresponding to each atomic type;
[0052] Based on the potential parameters of each local atom and the second target vector, the incremental force result of each local atom is calculated respectively, and based on the third group of vectors, the incremental force result of each local atom, and the mask vector, the molecular force result of each local atom is identified.
[0053] In a third aspect, the present application provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of any one of the methods in the first aspect are implemented.
[0054] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of any one of the methods in the first aspect are implemented.
[0055] In a fifth aspect, the present application provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of any one of the methods in the first aspect are implemented.
[0056] The force analysis method, device, and computer device of the molecular dynamics simulation obtain the number of local atoms of the current process and the neighbor list corresponding to each local atom, and determine the number of groups of adjacency lists adapted to the current process and the allocated memory value of all groups of adjacency lists based on the number of groups of local atoms of the current process; based on the number of groups of adjacency lists adapted to the current process, the local atoms are grouped to obtain atomic groups, and in each atomic group, the target atomic group and the neighbor list corresponding to each local atom in the target atomic group are randomly selected; based on the target .... The neighbor list corresponding to each local atom in the target atom group and the allocated memory value of all group adjacency lists are constructed through the adjacency list construction strategy, and the target atom group is re-screened in each non-target atom group; each atom group can only be screened once; return to execute the neighbor list corresponding to each local atom in the target atom group, and construct the target group adjacency list step through the adjacency list construction strategy to obtain multiple target group adjacency lists, and calculate the molecular force results of each local atom in the current process based on the number of local atoms in each target group adjacency list and the three-dimensional coordinates of each local atom. This scheme calculates the molecular force results of each local atom and neighboring atoms by constructing each group of adjacency lists, avoiding the complex calculation problem of calculating the force between a single local atom and all atoms in the simulation system, thereby improving the calculation efficiency. Then, in the prior art, whether it is based on the construction of the adjacency list at each time step of the truncation radius r, or the construction of the adjacency list once based on multiple time steps of the extended truncation radius (r+skin), the data locality of the atomic distribution in the adjacency list cannot be fully utilized, and repeated memory access leads to low calculation efficiency. This scheme improves data reuse, reduces memory access overhead, and improves the performance of force calculation by reorganizing and constructing adjacency lists whose number is the size of the vector width into a group adjacency list, thereby comprehensively improving the calculation efficiency of the interaction force between atoms during molecular dynamics simulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 A schematic diagram of a flow chart of a force analysis method for molecular dynamics simulation in one embodiment;
[0058] Figure 2 A schematic diagram of the time steps for constructing an adjacency list based on a cutoff radius r and an extended cutoff radius (r+skin) in one embodiment;
[0059] Figure 3 It is a schematic diagram of an architecture of an adjacency table implementation architecture based on SW26010PRO as an embodiment in an embodiment;
[0060] Figure 4 A schematic diagram of a flow chart of an example of force analysis of a molecular dynamics simulation in one embodiment;
[0061] Figure 5 A structural block diagram of a force analysis device for molecular dynamics simulation in one embodiment;
[0062] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0064] The force analysis method for molecular dynamics simulation provided in the embodiment of the present application can be applied to the application environment corresponding to the molecular dynamics simulation process. Among them, the method is applied to a molecular force calculation system including a single main core and multiple slave cores, the main core is (Management Processing Element, referred to as MPE), the slave core is (Computation Processing Element, referred to as CPE), the main core and multiple slave cores together constitute a molecular force calculation system, wherein each slave core is used to process the atomic force results of each local atom corresponding to a group adjacency table. In another embodiment, when only a single slave core is included, the server iteratively processes the processing tasks that need to be performed by multiple slave cores through the slave core. The system can be a server. Among them, the server calculates the molecular force results of each local atom and its neighboring atoms by constructing each group of adjacency lists, avoiding the complex calculation problem of calculating the forces between a single local atom and all atoms in the simulation system, thereby improving the calculation efficiency. In the prior art, whether it is based on the construction of an adjacency list at each time step of the truncation radius r, or the construction of an adjacency list once for multiple time steps of the extended truncation radius (r+skin), the data locality of the atomic distribution in the adjacency list cannot be fully utilized, and repeated memory access leads to low calculation efficiency. However, this solution reorganizes and constructs the adjacency list of the size of the vector width into a group adjacency list, improves the data reuse rate, reduces the memory access overhead, and improves the performance of force calculation, thereby comprehensively improving the calculation efficiency of the interaction force between atoms in the molecular dynamics simulation process.
[0065] In one embodiment, Figure 1 As shown, a molecular dynamics simulation force analysis method is provided, and the method is applied to a server as an example for explanation, including the following steps:
[0066] Step S101, obtain the number of local atoms of the current process and the neighbor list corresponding to each local atom, and based on the number of local atoms of the current process, determine the number of groups of adjacency lists adapted by the current process and the allocated memory value of all groups of adjacency lists.
[0067] In this embodiment, the server detects the molecular dynamics simulation (Molecular Dynamic, referred to as MD) process through the main core, collects the number of local atoms of the current process, and the neighbor list corresponding to each local atom. Among them, the current process is the current simulation process of molecular dynamics simulation. Among them, the simulation process includes each local atom that needs to be analyzed and calculated, and the neighbor atoms adjacent to each local atom. Each local atom corresponds to a neighbor list, and the neighbor list includes a plurality of neighbor atoms. Each neighbor atom contains a neighbor atom number, which is convenient for analyzing the force relationship between each neighbor atom and the local atom. The neighbor list corresponding to each local atom is a neighbor list preset by the staff in the molecular dynamics simulation process. Then, based on the number of local atoms of the current process, the server determines the number of groups of each group of adjacency lists adapted by the current process and the allocated memory value of all groups of adjacency lists. Specifically, the server evaluates the number of local atoms of the current process through the main core (ManagementProcessing Element, referred to as MPE), and calculates the maximum number of local atoms in all processes through the collective communication operation MPI_Allreduce. Afterwards, the server pre-allocates a large block of memory for each process based on the number of groups obtained in the above manner, the maximum number of neighbors of each atom, and the product of the group factor, to store all the group adjacency lists of the process. The size of the group factor is set by the user, mainly to ensure that the group adjacency list has enough room for growth to prevent memory overflow due to too many atoms during the simulation. The maximum number of neighbors of each atom is specified by the user through an input file, which is used to pre-estimate the memory space required for the maximum number of neighbors each atom may have.
[0068] Step S102, based on the number of groups of adjacency lists adapted by the current process, each local atom is grouped to obtain each atomic group, and in each atomic group, a target atomic group and a neighbor list corresponding to each local atom in the target atomic group are randomly selected.
[0069] In this embodiment, the server groups each local atom based on the number of groups of adjacency lists adapted by the current process to obtain each atomic group. Specifically, the server groups according to the maximum number of local atoms and the vector width (i.e., the number of local atoms of double type), and calculates the number of groups of the group adjacency list accordingly. Then, the server randomly screens the target atomic group and the neighbor list corresponding to each local atom in the target atomic group in each atomic group. Specifically, after screening each target atomic group and the neighbor list corresponding to each local atom in each target atomic group, the server processes each target atomic group and the neighbor list corresponding to each local atom in each target atomic group through each slave core, i.e., step S103-step S104. By processing each atomic group separately by multiple slave cores, the efficiency of processing each atomic group is improved. In the case where the system only includes a single slave core, the server randomly screens each target atomic group, and then performs steps S103-step S104 on each target atomic group based on the slave core, thereby obtaining the molecular force results of each local atom.
[0070] Step S103, based on the neighbor lists corresponding to each local atom in the target atomic group and the allocated memory values of all group adjacency lists, the target group adjacency list is constructed through the adjacency list construction strategy, and the target atomic group is re-screened in each non-target atomic group; each atomic group can only be screened once.
[0071] In this embodiment, the server constructs the target group adjacency list through a single slave core based on the neighbor list corresponding to each local atom in the target atom group and the allocated memory value of all group adjacency lists, and re-screens the target atom group in each non-target atom group. The adjacency list construction strategy is to construct an adjacency list based on each time step of the truncation radius r, or to construct an adjacency list once based on multiple time steps of the extended truncation radius (r+skin). Figure 2 As shown in Figure 1, it is a schematic diagram of the time steps for constructing the adjacency list based on the truncation radius r and the extended truncation radius (r+skin). Figure 2 a) is based on the truncation radius r, building an adjacency list at each time step; the second ( Figure 2 b) is based on the extended cutoff radius (r+skin), and an adjacency list is constructed every multiple time steps, wherein the number of interval time steps is set by the user in the input file and stored in each slave core of the server. Among them, each atomic group can only be screened once. In another embodiment, each atomic group corresponds to a slave core, that is, each slave core processes each atomic group at the same time. After the server screens each target atomic group separately, it randomly determines the slave core corresponding to each target atomic group. The specific construction process will be described in detail later.
[0072] Step S104, returns to execute the neighbor list corresponding to each local atom in the target atom group, constructs the target group adjacency table step through the adjacency list construction strategy, obtains multiple target group adjacency lists, and calculates the molecular force results of each local atom in the current process based on each target group adjacency list, each target atom group corresponding to each target adjacency list, and the three-dimensional coordinates of each local atom.
[0073] In this embodiment, the server returns to execute the neighbor list corresponding to each local atom in the target atom group, and constructs the target group adjacency table step through the adjacency table construction strategy to obtain multiple target group adjacency tables, and calculates the molecular force results of each local atom in the current process through each slave core based on each target group adjacency table, each target atom group corresponding to each target adjacency table, and the three-dimensional coordinates of each local atom. The specific calculation process will be described in detail later, where the three-dimensional coordinates of each local atom are the three-dimensional coordinates of each local atom in the molecular dynamics simulation process obtained by the server.
[0074] Based on the above scheme, by constructing each group of adjacency lists, the molecular force results of each local atom and the neighboring atoms are calculated, avoiding the complex calculation problem of calculating the forces between a single local atom and all atoms in the simulation system, thereby improving the calculation efficiency. However, in the prior art, whether it is based on the construction of the adjacency list at each time step of the truncation radius r, or the construction of the adjacency list once for multiple time steps based on the extended truncation radius (r+skin), the data locality of the atomic distribution in the adjacency list cannot be fully utilized, and repeated memory access leads to low calculation efficiency. However, this scheme reorganizes and constructs the adjacency list of the size of the vector width into a group adjacency list, improves the data reuse rate, reduces the memory access overhead, and improves the performance of force calculation, thereby comprehensively improving the calculation efficiency of the interaction force between atoms in the molecular dynamics simulation process.
[0075] Optionally, based on the number of local atoms of the current process, determine the number of groups of adjacency lists adapted by the current process and the allocated memory value of all groups of adjacency lists, including: obtaining the maximum number of local atoms in each historical process and a preset group factor, and identifying the number of local atoms of the target atom type in each local atom of the current process; based on the maximum number of local atoms and the number of local atoms of the target atom type, calculate the number of groups of adjacency lists adapted by the current process, and based on the number of groups of each group of adjacency lists, the maximum number of neighbors of each atom, and the preset group factor, calculate the allocated memory value of all groups of adjacency lists.
[0076] In this embodiment, the server obtains the maximum number of local atoms in each historical process and the preset group factor, and identifies the number of local atoms of the target atom type in each local atom of the current process. Each historical process is a simulation process for each molecular dynamics simulation, and different historical processes have different numbers of local atoms simulated each time because the composition forms of each local atom are different. The maximum number of local atoms in each historical process is obtained by collective communication operation of the main core.
[0077] The server calculates the number of groups of adjacency lists adapted by the current process based on the maximum number of local atoms and the number of local atoms of the target atom type. The target atom type is a local atom of type double (i.e., vector width). The server calculates the ratio between the maximum number of local atoms and the number of local atoms of the target atom type to obtain the number of groups of adjacency lists adapted by the current process. Figure 3 The following figure shows the implementation architecture of each group of adjacency lists adapted to the current process, where each core group contains 8*8 slave cores (i.e., computing cores), representing the parallel granularity that a process can execute simultaneously. The number of groups of adjacency lists adapted to the current process is related to the number of slave cores started by the current process.
[0078] Finally, the server calculates the allocated memory value of all group adjacency lists based on the number of groups in each group adjacency list, the maximum number of neighbors of each atom, and the preset group factor. Specifically, the server obtains the allocated memory value of all group adjacency lists by calculating the product value between the number of groups in each group adjacency list, the maximum number of neighbors of each atom, and the preset group factor. Among them, the maximum number of neighbors of each atom and the preset group factor are data preset in the server by the staff, and the data can change with the adjustment of the staff.
[0079] Based on the above scheme, the number of groups in the group adjacency list is determined by the ratio of the maximum number of local atoms to the vector width, ensuring that all group adjacency lists can allocate all local atoms and avoid the situation where there are local atoms without corresponding group adjacency lists. The allocated memory value of all group adjacency lists is calculated by the number of groups in each group adjacency list, the preset group factor, and the maximum number of neighbors of each atom, ensuring that the allocated memory value can normally store each group adjacency list and each neighbor atom contained in each group adjacency list.
[0080] Optionally, based on the number of groups of each group adjacency list adapted by the current process, each local atom is grouped and processed to obtain each atomic group, including: identifying the architecture information of the group adjacency list, and based on the architecture information, identifying the vector width of the group adjacency list; based on the vector width, each local atom is grouped and processed to obtain each atomic group.
[0081] In this embodiment, the server identifies the architecture information of the group adjacency table through the main core, and identifies the vector width of the group adjacency table based on the architecture information. Figure 3 As shown in FIG. 1 , it is an architectural diagram of an adjacency table implementation architecture based on SW26010PRO as an embodiment. Based on the architectural diagram, it can be seen that the vector width is 8 doubles, so the grouping strategy is to divide the number of local atoms by 8. If it is not an integer, the remaining atoms are divided into a group separately. Finally, the server groups each local atom based on the vector width to obtain each atomic group.
[0082] Based on the above scheme, each atomic group is divided by the vector width of each group adjacency list to ensure that each atomic group can correspond one-to-one with the group adjacency list and ensure that all local atoms can be processed normally.
[0083] Optionally, in each atomic group, after randomly screening the target atomic group and the neighbor list corresponding to each local atom in the target atomic group, it also includes: obtaining an adjacency list construction strategy and identifying a target cutoff radius corresponding to the adjacency list construction strategy; identifying the atomic number of each neighbor atom in each neighbor list, and sorting each neighbor atom in each neighbor list in ascending order according to the atomic number of each neighbor atom, to obtain a list sequence of each neighbor list.
[0084] In this embodiment, the server obtains the adjacency list construction strategy and identifies the target truncation radius corresponding to the adjacency list construction strategy. Figure 2 As shown, there are two types of cutoff radius: Figure 2 a) is based on the truncation radius r, building an adjacency list at each time step; the second ( Figure 2 b) Based on the extended cutoff radius (r+skin), an adjacency list is constructed every multiple time steps. Each time step is preset on the server. The server identifies the atomic number of each neighbor atom in each neighbor list, and sorts each neighbor atom in each neighbor list in ascending order according to the atomic number of each neighbor atom, to obtain a list sequence for each neighbor list. The ascending list sequence can more effectively expose the locality of the data, thereby improving the utilization of the cache and helping to improve computing efficiency.
[0085] Based on the above scheme, the accuracy and efficiency of constructing the group adjacency list are ensured by arbitrarily screening the target cutoff radius and sorting each neighbor atom.
[0086] Optionally, based on the neighbor lists corresponding to each local atom in the target atomic group and the allocated memory values of all group adjacency lists, a target group adjacency list is constructed through an adjacency list construction strategy, including: for each local atom, based on the list sequence of the neighbor lists corresponding to the local atom, an integer pointer of the neighbor list corresponding to the local atom is constructed; based on the atomic positions of each local atom in the target atomic group, the starting coordinates of the group adjacency list are calculated, and based on the starting coordinates of the group adjacency list, the target memory address of the group adjacency list is filtered in the allocated memory of all group adjacency lists; based on the target memory address of the group adjacency list, the target truncation radius corresponding to the adjacency list construction strategy, and the integer pointer of the neighbor list corresponding to each local atom, through the adjacency list construction strategy, in each neighbor list, each neighbor atom stored in the group adjacency list is filtered, and the group adjacency list containing each neighbor atom is used as the target group adjacency list corresponding to the target atomic group.
[0087] In this embodiment, the server constructs an integer pointer of a neighbor list corresponding to the local atom for each local atom based on the list sequence of the neighbor list corresponding to the local atom. The integer pointer points to the first neighbor atom of each list sequence. Then, the server calculates the starting coordinates of the group adjacency list based on the atomic positions of each local atom in the target atomic group, and based on the starting coordinates of the group adjacency list, selects the target memory address of the group adjacency list in the allocated memory of all group adjacency lists. The way to calculate the starting coordinates of the group adjacency list is to calculate the coordinate values corresponding to the center point position of each atomic position to obtain the starting coordinates of the group adjacency list.
[0088] Then, based on the target memory address of the group adjacency list, the target cutoff radius corresponding to the adjacency list construction strategy, and the integer pointer of the neighbor list corresponding to each local atom, the server uses the adjacency list construction strategy to filter the neighbor atoms stored in the group adjacency list in each neighbor list, and uses the group adjacency list containing each neighbor atom as the target group adjacency list corresponding to the target atomic group.
[0089] The specific screening process is that the server sets a counter to track the number of neighbor atoms in the group adjacency table. Define a selection variable and an addition variable, and then start the loop. The specific loop is as follows:
[0090] 1) The server selects the neighbor atom with the smallest atom number from the elements pointed to by the pointers of the icnt (i.e., the number of local atoms contained in a single atom group) neighbor lists, and makes the selection variable point to the neighbor list.
[0091] 2) The server saves the selected neighbor atom with the smallest number into the added variable. If the atom number is equal to the total number of atoms, it means that all adjacency lists have been searched, and the loop is exited.
[0092] 3) The server moves the pointer of the selected neighbor atom backward to point to the next neighbor atom in the list.
[0093] 4) The server saves the current element to the current position pointed to by the group list pointer, and then moves the pointer of the group adjacency list back one position.
[0094] 5) If the counter value is 0, or the atom number in the added variable is not equal to the atom number at the counter value minus 1, the atom number in the added variable is saved in the group adjacency list, and the counter value is increased by 1. Alternatively, if the atom number in the variable is not equal to the atom number at the counter value minus 1, that is, it is different from the neighbor atom number stored in the group adjacency list, the atom number in the added variable is saved in the group adjacency list, and the counter value is increased by 1.
[0095] 6) If the counter value exceeds the length of the pre-allocated group adjacency list, exit the loop and resize the group factor.
[0096] Afterwards, the server records the number of each neighbor atom in the target group adjacency table in each iteration cycle, and determines the number of each neighbor atom in the target group adjacency table of the last iteration, which is the target number of each neighbor atom included in the target group adjacency table.
[0097] Based on the above scheme, by constructing integer pointers, setting counters, defining selection variables and adding variables, the neighbor atoms in the adjacency list of each target group are screened, which ensures the number of neighbor atoms in the adjacency list of each target group and ensures the high correlation between the screened neighbor atoms and the local atoms in the atomic group corresponding to the target group adjacency list, thereby improving the accuracy of calculating the molecular force results of each local atom.
[0098] Optionally, based on each target group adjacency list, each target atom group corresponding to each target adjacency list, and the three-dimensional coordinates of each local atom, the molecular force results of each local atom in the current process are calculated, including: for each target atom group, the three-dimensional coordinates of each local atom in the target atom group are used to generate a first set of vectors, and the atom number of each neighbor atom is obtained from the target group adjacency list corresponding to the target atom group; based on each atom number, the identified three-dimensional coordinates of the local atom corresponding to each neighbor atom are identified, and based on the identified three-dimensional coordinates of each local atom, a second set of vectors is generated, and the second set of vectors are respectively subtracted from the first set of vectors. Calculate to obtain a third group of vectors; perform square sum processing on the third group of vectors to obtain a first target vector, and generate a second target vector based on the first target vector and the target truncation radius; calculate the vector difference between the first target vector and the second target vector to obtain a mask vector, and obtain the atomic type of each local atom in the target atomic group and the potential parameters corresponding to each atomic type; based on the potential parameters of each local atom and the second target vector, calculate the incremental force result of each local atom respectively, and identify the molecular force result of each local atom based on the third group of vectors, the incremental force result of each local atom, and the mask vector.
[0099] In this embodiment, for each target atom group, the server generates a first set of vectors using the three-dimensional coordinates of each local atom in the target atom group, and obtains the atom number of each neighbor atom from the target group adjacency table corresponding to the target atom group. Specifically, after the server loads the three-dimensional coordinates of icnt local atoms into the first set of vectors vx1, vy1, vz1, the server identifies the atom number of each neighbor atom in the target group adjacency table corresponding to the target atom group.
[0100] Then, the server identifies the three-dimensional coordinates of the local atoms corresponding to each neighbor atom based on each atom number, and generates a second set of vectors based on the three-dimensional coordinates of each local atom, and calculates the difference between the second set of vectors and the first set of vectors to obtain a third set of vectors. Specifically, the server generates the second set of vectors vx based on the atom numbers of each neighbor atom obtained in the above steps and the three-dimensional coordinates of each neighbor atom. 2 , vy 2 , vz 2 . The operation method of obtaining the three-dimensional coordinates of each local atom and the three-dimensional coordinates of each neighboring atom is to obtain them through DMA operation, move them from the main memory of the current core group to the local device memory (LDM) of the slave core, and then the server loads each three-dimensional coordinate into the corresponding vector to obtain the first set of vectors and the second set of vectors. Then, the server transfers the first set of vectors vx 1 , vy1 , vz 1 From the second set of vectors vx 2 , vy 2 , vz 2 The server performs square sum processing on the third group of vectors to obtain a first target vector. The first target vector is vrsq. Then, the server generates a second target vector based on the first target vector and the target cutoff radius. The second target vector is vcut. After that, the server calculates the vector difference between the first target vector and the second target vector to obtain a mask vector, that is, the server calculates the difference between vrsq and vcut to obtain a mask vector vmask.
[0101] The server obtains the atomic type of each local atom in the target atomic group and the potential parameters corresponding to each atomic type. Then, the server calculates the incremental force result of each local atom based on the potential parameters of each local atom and the second target vector. Specifically, the server multiplies the potential parameters of each local atom by the inverse of the first target vector vrsq according to the atomic type of each local atom to obtain the incremental force result vdf.
[0102] Finally, the server identifies the molecular force results of each local atom based on the third set of vectors, the incremental force results of each local atom, and the mask vector. Specifically, the server multiplies vdf with the third set of difference vectors vdx, vdy, vdz, respectively, and multiplies it with the mask vmask to obtain the force calculation results vfx, vfy, vfz of this iteration step, and uses each force calculation result as the molecular force result of each local atom.
[0103] Based on the above scheme, the molecular force results of each local atom are calculated by constructing the group adjacency list corresponding to each local atom. While ensuring the calculation accuracy, the complex calculation problem of calculating the force between a single local atom and all the atoms in the simulation system is avoided, thereby improving the calculation efficiency.
[0104] This application also provides an example of force analysis of a molecular dynamics simulation, such as Figure 4 As shown, the specific processing process includes the following steps:
[0105] Step S401, obtaining the number of local atoms of the current process and the neighbor list corresponding to each local atom.
[0106] Step S402, obtaining the maximum number of local atoms in each historical process and a preset group factor, and identifying the number of local atoms of the target atom type in each local atom of the current process.
[0107] Step S403, based on the maximum number of local atoms and the number of local atoms of the target atom type, calculate the number of groups of adjacency lists adapted by the current process, and based on the number of groups of adjacency lists of each group, the maximum number of neighbors of each atom, and the preset group factor, calculate the allocated memory value of all groups of adjacency lists.
[0108] Step S404: identifying the architecture information of the group adjacency list, and based on the architecture information, identifying the vector width of the group adjacency list.
[0109] Step S405: based on the vector width, each local atom is grouped to obtain each atom group.
[0110] Step S406 , randomly screening the target atom group and the neighbor list corresponding to each local atom in the target atom group in each atom group.
[0111] Step S407: Obtain an adjacency list construction strategy, and identify a target cutoff radius corresponding to the adjacency list construction strategy.
[0112] Step S408 , identifying the atom number of each neighbor atom in each neighbor list, and sorting each neighbor atom in each neighbor list in ascending order according to the atom number of each neighbor atom, to obtain a list sequence of each neighbor list.
[0113] Step S409 , for each local atom, based on the list sequence of the neighbor list corresponding to the local atom, construct an integer pointer of the neighbor list corresponding to the local atom.
[0114] Step S410, based on the atomic position of each local atom in the target atomic group, calculate the starting coordinates of the group adjacency list, and based on the starting coordinates of the group adjacency list, filter the target memory address of the group adjacency list in the allocated memory of all group adjacency lists.
[0115] Step S411, based on the target memory address of the group adjacency list, the target truncation radius corresponding to the adjacency list construction strategy, and the integer pointer of the neighbor list corresponding to each local atom, through the adjacency list construction strategy, in each neighbor list, filter each neighbor atom stored in the group adjacency list, and use the group adjacency list containing each neighbor atom as the target group adjacency list corresponding to the target atomic group.
[0116] Step S412, for each target atom group, the three-dimensional coordinates of each local atom in the target atom group are used to generate a first set of vectors, and the atom number of each neighbor atom is obtained from the target group adjacency table corresponding to the target atom group.
[0117] Step S413, based on each atom number, identify the identified three-dimensional coordinates of the local atoms corresponding to each neighbor atom, and based on the identified three-dimensional coordinates of each local atom, generate a second set of vectors, and perform difference calculations on the second set of vectors and the first set of vectors to obtain a third set of vectors.
[0118] Step S414, performing square sum processing on the third group of vectors to obtain a first target vector, and generating a second target vector based on the first target vector and the target truncation radius.
[0119] Step S415, calculating the vector difference between the first target vector and the second target vector to obtain a mask vector, and obtaining the atomic type of each local atom in the target atomic group and the potential parameter corresponding to each atomic type.
[0120] Step S416, based on the potential parameters of each local atom and the second target vector, the incremental force result of each local atom is calculated respectively, and based on the third set of vectors, the incremental force result of each local atom, and the mask vector, the molecular force result of each local atom is identified.
[0121] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple interruptions, and these steps or interruptions are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or interruptions is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or interruptions in other steps.
[0122] Based on the same inventive concept, the embodiment of the present application also provides a molecular dynamics simulation force analysis device for implementing the molecular dynamics simulation force analysis method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of one or more molecular dynamics simulation force analysis devices provided below can refer to the limitations of the molecular dynamics simulation force analysis method above, and will not be repeated here.
[0123] In one embodiment, Figure 5 As shown, a force analysis device for molecular dynamics simulation is provided, comprising: an acquisition module 510, a grouping module 520, a construction module 530 and a calculation module 540, wherein:
[0124] An acquisition module 510 is used to acquire the number of local atoms of the current process and the neighbor list corresponding to each local atom, and determine the number of groups of adjacency lists adapted by the current process and the allocated memory value of all groups of adjacency lists based on the number of local atoms of the current process;
[0125] A grouping module 520 is used to group the local atoms based on the number of groups of the adjacency lists adapted by the current process to obtain atomic groups, and randomly select a target atomic group and a neighbor list corresponding to each local atom in the target atomic group in each atomic group;
[0126] A construction module 530 is used to construct a target group adjacency list based on the neighbor list corresponding to each local atom in the target atom group and the allocated memory value of all group adjacency lists through an adjacency list construction strategy, and re-screen the target atom group in each non-target atom group; each atom group can only be screened once;
[0127] The calculation module 540 is used to return to the execution of the neighbor list corresponding to each local atom in the target atom group, construct the target group adjacency table step through the adjacency table construction strategy, obtain multiple target group adjacency lists, and calculate the molecular force results of each local atom in the current process based on each target group adjacency table, each target atom group corresponding to each target adjacency table, and the three-dimensional coordinates of each local atom.
[0128] Optionally, the acquisition module 510 is specifically configured to:
[0129] Obtaining the maximum number of local atoms in each historical process and a preset group factor, and identifying the number of local atoms of the target atom type in each local atom of the current process;
[0130] Based on the maximum number of local atoms and the number of local atoms of the target atom type, the number of groups of adjacency lists adapted by the current process is calculated, and based on the number of groups of each group of adjacency lists, the maximum number of neighbors of each atom, and the preset group factor, the allocated memory value of all group adjacency lists is calculated.
[0131] Optionally, the grouping module 520 is specifically configured to:
[0132] identifying architecture information of the group adjacency list, and based on the architecture information, identifying a vector width of the group adjacency list;
[0133] Based on the vector width, the local atoms are grouped to obtain atomic groups.
[0134] Optionally, the device further comprises:
[0135] An identification module, used to obtain an adjacency list construction strategy and identify a target cutoff radius corresponding to the adjacency list construction strategy;
[0136] The sorting module is used to identify the atomic number of each neighbor atom in each neighbor list, and sort each neighbor atom in each neighbor list in ascending order according to the atomic number of each neighbor atom to obtain a list sequence of each neighbor list.
[0137] Optionally, the construction module 530 is specifically used to:
[0138] For each local atom, based on the list sequence of the neighbor list corresponding to the local atom, construct an integer pointer of the neighbor list corresponding to the local atom;
[0139] Calculating the starting coordinates of the group adjacency list based on the atomic position of each local atom in the target atomic group, and screening the target memory address of the group adjacency list from the allocated memory of all group adjacency lists based on the starting coordinates of the group adjacency list;
[0140] Based on the target memory address of the group adjacency list, the target truncation radius corresponding to the adjacency list construction strategy, and the integer pointer of the neighbor list corresponding to each of the local atoms, the adjacency list construction strategy is used to filter each of the neighbor lists stored in the group adjacency list, and the group adjacency list containing each of the neighbor atoms is used as the target group adjacency list corresponding to the target atomic group.
[0141] Optionally, the calculation module 540 is specifically used to:
[0142] For each target atom group, the three-dimensional coordinates of each local atom in the target atom group are used to generate a first set of vectors, and the atom number of each neighbor atom is obtained from the target group adjacency table corresponding to the target atom group;
[0143] Based on each of the atom numbers, identifying the three-dimensional coordinates of the local atoms corresponding to each of the neighbor atoms, and based on the three-dimensional coordinates of the local atoms, generating a second set of vectors, and performing difference calculations on the second set of vectors and the first set of vectors to obtain a third set of vectors;
[0144] Performing square sum processing on the third group of vectors to obtain a first target vector, and generating a second target vector based on the first target vector and the target cutoff radius;
[0145] Calculate the vector difference between the first target vector and the second target vector to obtain a mask vector, and obtain the atomic type of each local atom in the target atomic group and the potential parameter corresponding to each atomic type;
[0146] Based on the potential parameters of each local atom and the second target vector, the incremental force result of each local atom is calculated respectively, and based on the third group of vectors, the incremental force result of each local atom, and the mask vector, the molecular force result of each local atom is identified.
[0147] Each module in the above-mentioned molecular dynamics simulation force analysis device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0148] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external server in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a force analysis method for molecular dynamics simulation is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0149] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0150] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of any one of the methods in the first aspect are implemented.
[0151] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the methods in the first aspect are implemented.
[0152] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the steps of any one of the methods in the first aspect.
[0153] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0154] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0155] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0156] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A force analysis method for molecular dynamics simulation, characterized in that: The method comprises: Obtain the number of local atoms of the current process and the neighbor list corresponding to each local atom, and determine the number of groups of adjacency lists adapted by the current process and the allocated memory value of all groups of adjacency lists based on the number of local atoms of the current process; Based on the number of groups of the adjacency lists adapted by the current process, the local atoms are grouped to obtain atomic groups, and in each atomic group, a target atomic group and a neighbor list corresponding to each local atom in the target atomic group are randomly selected; Based on the neighbor lists corresponding to each local atom in the target atomic group and the allocated memory values of all group adjacency lists, a target group adjacency list is constructed through an adjacency list construction strategy, and the target atomic group is re-screened in each non-target atomic group; each atomic group can only be screened once; Return to execute the neighbor list corresponding to each local atom in the target atom group, construct the target group adjacency table step through the adjacency list construction strategy, obtain multiple target group adjacency lists, and calculate the molecular force results of each local atom in the current process based on each target group adjacency list, each target atom group corresponding to each target adjacency list, and the three-dimensional coordinates of each local atom.
2. The method according to claim 1, characterized in that The determining, based on the number of local atoms of the current process, the number of groups of adjacency lists adapted by the current process and the allocated memory values of all groups of adjacency lists comprises: Obtaining the maximum number of local atoms in each historical process and a preset group factor, and identifying the number of local atoms of the target atom type in each local atom of the current process; Based on the maximum number of local atoms and the number of local atoms of the target atom type, the number of groups of adjacency lists adapted by the current process is calculated, and based on the number of groups of each group of adjacency lists, the maximum number of neighbors of each atom, and the preset group factor, the allocated memory value of all group adjacency lists is calculated.
3. The method according to claim 2, characterized in that The grouping of the local atoms based on the number of groups of adjacency lists adapted by the current process to obtain the atomic groups includes: identifying architecture information of the group adjacency list, and based on the architecture information, identifying a vector width of the group adjacency list; Based on the vector width, the local atoms are grouped to obtain atomic groups.
4. The method according to claim 1, characterized in that After randomly selecting the target atom group and the neighbor list corresponding to each local atom in the target atom group in each atom group, the method further includes: Obtaining an adjacency list construction strategy, and identifying a target cutoff radius corresponding to the adjacency list construction strategy; The atom number of each neighbor atom in each neighbor list is identified, and the neighbor atoms in each neighbor list are sorted in ascending order according to the atom number of each neighbor atom to obtain a list sequence of each neighbor list.
5. The method according to claim 4, characterized in that The target group adjacency table is constructed based on the neighbor list corresponding to each local atom in the target atom group and the allocated memory value of all group adjacency tables through an adjacency table construction strategy, including: For each local atom, based on the list sequence of the neighbor list corresponding to the local atom, construct an integer pointer of the neighbor list corresponding to the local atom; Calculating the starting coordinates of the group adjacency list based on the atomic position of each local atom in the target atomic group, and screening the target memory address of the group adjacency list from the allocated memory of all group adjacency lists based on the starting coordinates of the group adjacency list; Based on the target memory address of the group adjacency list, the target truncation radius corresponding to the adjacency list construction strategy, and the integer pointer of the neighbor list corresponding to each of the local atoms, the adjacency list construction strategy is used to filter each of the neighbor lists stored in the group adjacency list, and the group adjacency list containing each of the neighbor atoms is used as the target group adjacency list corresponding to the target atomic group.
6. The method according to claim 5, characterized in that The calculating of the molecular force result of each local atom of the current process based on each target group adjacency list, each target atom group corresponding to each target adjacency list, and the three-dimensional coordinates of each local atom includes: For each target atom group, the three-dimensional coordinates of each local atom in the target atom group are used to generate a first set of vectors, and the atom number of each neighbor atom is obtained from the target group adjacency table corresponding to the target atom group; Based on each of the atom numbers, identifying the three-dimensional coordinates of the local atoms corresponding to each of the neighbor atoms, and based on the three-dimensional coordinates of the local atoms, generating a second set of vectors, and performing difference calculations on the second set of vectors and the first set of vectors to obtain a third set of vectors; Performing square sum processing on the third group of vectors to obtain a first target vector, and generating a second target vector based on the first target vector and the target cutoff radius; Calculate the vector difference between the first target vector and the second target vector to obtain a mask vector, and obtain the atomic type of each local atom in the target atomic group and the potential parameter corresponding to each atomic type; Based on the potential parameters of each local atom and the second target vector, the incremental force result of each local atom is calculated respectively, and based on the third group of vectors, the incremental force result of each local atom, and the mask vector, the molecular force result of each local atom is identified.
7. A force analysis device for molecular dynamics simulation, characterized in that: The device comprises: An acquisition module, used to acquire the number of local atoms of the current process and the neighbor list corresponding to each local atom, and determine the number of groups of adjacency lists adapted by the current process and the allocated memory value of all groups of adjacency lists based on the number of local atoms of the current process; A grouping module, for grouping the local atoms based on the number of groups of the adjacency lists adapted by the current process to obtain atomic groups, and randomly selecting a target atomic group and a neighbor list corresponding to each local atom in the target atomic group in each atomic group; A construction module, for constructing a target group adjacency list based on the neighbor list corresponding to each local atom in the target atom group and the allocated memory value of all group adjacency lists through an adjacency list construction strategy, and re-screening the target atom group in each non-target atom group; each atom group can only be screened once; A calculation module is used to return and execute a neighbor list corresponding to each local atom in the target atom group, construct a target group adjacency table step through an adjacency table construction strategy, obtain multiple target group adjacency lists, and calculate the molecular force results of each local atom in the current process based on each target group adjacency table, each target atom group corresponding to each target adjacency table, and the three-dimensional coordinates of each local atom.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
AIREBO potential optimization method and system suitable for multi-core processor
CN120375941A
AIREBO potential optimization method and system suitable for multi-core processors
CN120375941B
Molecular dynamics adjacency list construction optimization method and system and super computer platform
CN120388629A
Molecular dynamics adjacency list construction optimization method, system and supercomputer platform
CN120388629B
Atomic Tersoft potential simulation method and system for many-core architecture processor
CN120388630A
