A method and system for molecular dynamics simulation for many-core architecture processor

By reconstructing and vectorizing the algorithm for EAM potential field calculation, the problem of computational speed limitation in existing technologies has been solved, achieving efficient molecular dynamics simulation and improving the processor's computational performance.

CN121306292BActive Publication Date: 2026-02-03SHANDONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511850787.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-10
Publication Date
2026-02-03
Estimated Expiration
2045-12-10

AI Technical Summary

Technical Problem

Existing technologies in processor-oriented EAM parallel computing suffer from problems such as frequent inter-process communication, wasteful redundant computations, time-consuming table lookup operations, and slow adjacency list construction, which limit the computational processing speed.

Method used

Algorithm reconstruction and vectorized computation are employed, and the EAM potential field is calculated using a full adjacency list. The computation steps are integrated to reduce communication. A mixed precision and lookup table splicing method are used to adjust the atomic loop order and optimize the adjacency list construction process, thereby improving computational efficiency.

Benefits of technology

It significantly improves the computational efficiency of many-core architecture processors, reduces redundant computations and communication, enhances vectorization acceleration, and enables efficient molecular dynamics simulations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121306292B_ABST
    Figure CN121306292B_ABST
Patent Text Reader

Abstract

The present disclosure provides a kind of molecular dynamics simulation method and system for many-core architecture processor, it is related to molecular dynamics simulation technical field, comprising: obtaining the metal atom to be simulated, and constructs its EAM potential function;Through the calculation process of optimization EAM potential function, the acceleration calculation of metal molecular dynamics simulation is realized;Wherein, the calculation process of optimization EAM potential function is to set central atom, using vectorization loading and aggregation operation to obtain the neighbor coordinates of central atom, the distance between atoms is calculated and the neighbor within the cutoff distance is selected, and compressed to temporary array;Total electron density is calculated, and the embedding force function of embedding energy function is obtained by table lookup and interpolation;The force of each neighbor to the center atom is calculated and accumulated by combining embedding force and potential force, and the force of neighbor atom is updated by scattering operation until all atoms are traversed, and the optimization calculation process of EAM potential function is completed.The present disclosure realizes the calculation acceleration optimization on many-core architecture processor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of molecular dynamics simulation technology, specifically to a molecular dynamics simulation method and system for many-core processor architectures. Background Technology

[0002] The statements in this section are merely background information relating to this disclosure and do not necessarily constitute prior art.

[0003] LAMMPS is one of the most mainstream and widely used open-source software programs in the field of molecular dynamics simulation, especially in handling large-scale parallel computing and complex systems. Before the calculation begins, the local process obtains the necessary "ghost atom" data by communicating with neighboring processes. During the calculation, LAMMPS stores ghost atoms separately from local atoms, allowing each process to complete force calculations locally without frequent cross-process data access. After the calculation is complete, the process also needs to send the calculated forces acting on the ghost atoms back to its parent process to ensure the correct accumulation of forces and the satisfaction of Newton's third law.

[0004] In LAMMPS, the EAM (Embedded Atom Method) potential is a class of many-body potential functions specifically designed for metallic systems, particularly transition metals and alloys. In metals, the interaction between atoms depends not only on the distance between the two atoms but also strongly on the overall density of the surrounding electron cloud. Therefore, it reflects the physical nature of metallic bonds more accurately than simple two-body potentials (such as the Lennard-Jones potential). The core idea of ​​EAM is that the total energy of each atom consists of two parts: embedding energy and pair potential. The former is the energy required to place an atom into the electron density provided by its neighboring atoms. The latter represents the short-range repulsion and attraction between atoms.

[0005] In the EAM implementation of LAMMPS, spline coefficients are pre-calculated and stored: seven coefficients are stored for each function and each interval: coeff[0], coeff[1], coeff[2], coeff[3], coeff[4], coeff[5], coeff[6], where the first three coefficients are used for derivative calculation and the last four coefficients are used for function value calculation. The z2r_spline array stores the spline interpolation coefficients, and the rhor_spline array stores the derivative-related information of the electron density function.

[0006] In existing methods, the entire EAM calculation process can be divided into three steps: First, by iterating through all atom pairs, the total electron cloud density rho[i] at each atom position is calculated. Second, the embedding function fp and embedding energy are calculated. The electron density rho[i] is mapped to the lookup table index p through density normalization, and then the table index m closest to p is found. Boundary checks are performed on m to ensure that the index m is within the valid range. The embedding function fp[i] of each atom is calculated by looking up the table using quadratic spline interpolation, and the embedding energy of each atom is calculated using cubic spline interpolation. At the same time, if the density exceeds the set maximum value rhomax, a reasonable linear extrapolation is performed.

[0007] The third step is to calculate the interatomic forces and potential energy. By iterating through all atomic pairs again, using the previously calculated rho and fp arrays, and combining the lookup table rhor_spline and z2r_spline spline interpolation, the embedded force fp[i]*rhojp + fp[j]*rhoip and the opposing force phip are calculated and updated in the global F array.

[0008] However, existing parallel computing in processor-oriented EAM still has the following limitations:

[0009] (1) The existing method uses Newton's third law (newton_pair = 1) and a semi-adjacency list, which requires inter-process communication. In the first part, the electron cloud density contributed by the ghost atom needs to be accumulated onto the corresponding local atom to ensure that rho[i] of each local atom is globally complete. In the second part, inter-process communication is also required to update the global array fp after the calculation is completed. The number of communication operations during the calculation is too many, which is not conducive to the overall parallel acceleration and greatly reduces the processor's calculation speed.

[0010] (2) In the calculations of the first and third parts, the rhor_spline array is used to perform some of the same calculations. The repeated calculations waste processor resources and occupy a lot of storage space.

[0011] (3) The simulation calculation process requires a large number of table lookup operations, which will be converted into a large number of gather operations in the vectorization acceleration method. Gather operations are relatively time-consuming operations, so they are not computationally intensive tasks. The vectorization acceleration is slow, which also slows down the processor's calculation speed.

[0012] (4) The adjacency list is slow to construct during processor process calculation. Each loop only performs neighbor filtering on a single local atom and has strong universality. Different parameters need to be adopted according to the atom's properties, resulting in a large number of branch judgment statements. In contrast, the EAM potential field only calculates for metal atoms and has fewer atom types. Summary of the Invention

[0013] To address the aforementioned issues, this disclosure proposes a molecular dynamics simulation method and system for many-core processor architectures. In the simulation calculation of metal atom interaction forces, the EAM potential field calculation between atoms is reconstructed and vectorized to improve the processor's computational efficiency. During the adjacency list construction process, the order of atomic cycles is adjusted and a mixed-precision method is used to accelerate the processor's computation, thus optimizing the simulation calculation on many-core processor architectures.

[0014] According to some embodiments, the present disclosure adopts the following technical solutions:

[0015] A molecular dynamics simulation method for many-core processor architectures includes:

[0016] Obtain the metal atoms to be simulated and construct their EAM potential function;

[0017] By optimizing the calculation process of the EAM potential function, accelerated calculations for metal molecular dynamics simulations are achieved.

[0018] The calculation process for the optimized EAM potential function includes:

[0019] Set a central atom, use vectorized loading and aggregation operations to obtain the coordinates of the central atom's neighbors, calculate the distance between atoms and filter out the neighbors within the truncation distance, and compress and store them into a temporary array;

[0020] For the selected neighbors, vector interpolation is used to calculate the contribution of each neighbor to the electron density, and the total electron density is obtained by accumulating the contribution values.

[0021] Based on the total electron density, the embedding force of the embedding energy function is obtained by looking up a table and interpolation; combining the embedding force and the opposing force, the force of each neighboring atom on the central atom is calculated and accumulated, and the force of the neighboring atoms is updated by scattering operation;

[0022] The process continues until all atoms have been traversed, completing the optimized iterative calculation of the EAM potential function.

[0023] According to some embodiments, the present disclosure adopts the following technical solutions:

[0024] A molecular dynamics simulation system for many-core processor architectures includes:

[0025] The potential function construction module is used to obtain the metal atoms to be simulated and construct their EAM potential functions;

[0026] The optimized loop calculation module is used to accelerate the calculation of metal molecular dynamics simulations by optimizing the calculation process of the EAM potential function.

[0027] The calculation process for the optimized EAM potential function includes:

[0028] Set a central atom, use vectorized loading and aggregation operations to obtain the coordinates of the central atom's neighbors, calculate the distance between atoms and filter out the neighbors within the truncation distance, and compress and store them into a temporary array;

[0029] For the selected neighbors, vector interpolation is used to calculate the contribution of each neighbor to the electron density, and the total electron density is obtained by accumulating the contribution values.

[0030] Based on the total electron density, the embedding force of the embedding energy function is obtained by looking up a table and interpolation; combining the embedding force and the opposing force, the force of each neighboring atom on the central atom is calculated and accumulated, and the force of the neighboring atoms is updated by scattering operation;

[0031] The process continues until all atoms have been traversed, completing the optimized iterative calculation of the EAM potential function.

[0032] According to some embodiments, the present disclosure adopts the following technical solutions:

[0033] A computer program product includes a computer program that, when executed by a processor, implements the molecular dynamics simulation method for many-core architecture processors.

[0034] According to some embodiments, the present disclosure adopts the following technical solutions:

[0035] A non-transitory computer-readable storage medium is provided for storing computer instructions, which, when executed by a processor, implement the aforementioned molecular dynamics simulation method for many-core architecture processors.

[0036] According to some embodiments, the present disclosure adopts the following technical solutions:

[0037] An electronic device includes a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to perform a molecular dynamics simulation method for a many-core architecture processor.

[0038] Compared with the prior art, the beneficial effects of this disclosure are as follows:

[0039] This disclosure presents a molecular dynamics simulation method for many-core architecture processors. The method reconstructs the EAM potential field calculation algorithm in many-core architecture processors, performs vectorized calculation, and adopts mixed precision to further improve the computational efficiency. At the same time, it adopts methods such as table lookup and splicing, parameter packing and splitting to address the gather problem in vectorization. The computational pipeline is adjusted through prefetching. In the process of adjacency list construction, the order of atomic loops is adjusted and mixed precision is used to further accelerate the calculation, thus completing the optimization of the algorithm on many-core architecture processors.

[0040] This disclosure presents a molecular dynamics simulation method for many-core architecture processors. It reconstructs the EAM potential field calculation process in the original many-core architecture processor, using a full adjacency list to calculate the EAM potential field. When calculating the rho array in the first part, the calculation of rho[j] is no longer needed; furthermore, communication between the three parts is eliminated; and the calculation of the third part is integrated into the first part, with the results stored. The third part only performs force accumulation, reducing redundant calculations and parameter readings. Considering that the reconstructed algorithm uses a full adjacency list, increasing the number of neighboring atoms for each atom, and reducing the calculation of atom i, the method is chosen to... j The layered loop performs vectorization processing on the calculation of EAM. To further accelerate the vectorization efficiency, a mixed-precision algorithm is used to complete 16 calculations at once. j Atomic calculations. Attached Figure Description

[0041] The accompanying drawings, which form part of this disclosure, are used to provide a further understanding of this disclosure. The illustrative embodiments of this disclosure and their descriptions are used to explain this disclosure and do not constitute an undue limitation of this disclosure.

[0042] Figure 1 A schematic diagram of 8-process MPI parallel two-dimensional partitioning;

[0043] Figure 2 This is a schematic diagram of the lookup table splicing method based on gather64 in an embodiment of this disclosure;

[0044] Figure 3 This is a schematic diagram of the prefetch instruction pipeline according to an embodiment of the present disclosure;

[0045] Figure 4 This is a schematic flowchart illustrating the calculation process of the optimized EAM potential function in a molecular dynamics simulation method for many-core architecture processors according to an embodiment of this disclosure.

[0046] Figure 5 This is a schematic diagram showing the optimized speedup ratio of the 32000-atom system according to an embodiment of this disclosure;

[0047] Figure 6The multi-process speedup ratio optimized for different atomic number systems in embodiments of this disclosure;

[0048] Figure 7 The algorithm is optimized for the 4.096M atomic system of this disclosure embodiment, resulting in strong scalability. Detailed Implementation

[0049] The present disclosure will be further described below with reference to the accompanying drawings and embodiments.

[0050] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of this disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains.

[0051] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments according to this disclosure. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms “comprising” and / or “including” are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0052] Example 1

[0053] One embodiment of this disclosure provides a molecular dynamics simulation method for many-core processor architectures, the method steps of which include:

[0054] Step 1: Obtain the metal atoms to be simulated and construct their EAM potential function;

[0055] Step 2: Accelerate the calculation of metal molecular dynamics simulations by optimizing the calculation process of the EAM potential function;

[0056] The calculation process for the optimized EAM potential function includes:

[0057] Set a central atom, use vectorized loading and aggregation operations to obtain the coordinates of the central atom's neighbors, calculate the distance between atoms and filter out the neighbors within the truncation distance, and compress and store them into a temporary array;

[0058] For the selected neighbors, vector interpolation is used to calculate the contribution of each neighbor to the electron density, and the total electron density is obtained by accumulating the contribution values.

[0059] Based on the total electron density, the embedding force of the embedding energy function is obtained by looking up a table and interpolation; combining the embedding force and the opposing force, the force of each neighboring atom on the central atom is calculated and accumulated, and the force of the neighboring atoms is updated by scattering operation;

[0060] The process continues until all atoms have been traversed, completing the optimized iterative calculation of the EAM potential function.

[0061] As one embodiment, this disclosure presents a molecular dynamics simulation method for many-core processor architectures. The method reconstructs the EAM potential field calculation algorithm, vectorizes the calculation, and employs mixed precision to further improve computational efficiency. It also addresses the gather problem in vectorization by using table lookup and parameter packing / splitting methods, adjusts the computational pipeline through prefetching, and optimizes the algorithm for many-core processor architectures by adjusting the order of atomic loops and employing mixed precision during adjacency list construction. The specific implementation process is as follows:

[0062] Step 1: Obtain the metal atoms to be simulated and construct their EAM potential function;

[0063] First, we introduce the parallelization process of LAMMPS and the EAM potential. In the field of molecular dynamics simulations, LAMMPS parallelization uses an MPI strategy based on spatial domain decomposition. The basic idea is to divide the entire simulation domain into several subdomains and assign each subdomain to an MPI process. For example... Figure 1 As shown, when using 8 processes, the simulation region is divided into a 2×2×2 three-dimensional mesh. At each time step, the processes need to exchange atomic information (such as position, type, etc.) of the boundary regions with neighboring subdomains. These boundary atoms passed from neighboring processes are called ghost atoms.

[0064] Before computation begins, the local process acquires necessary "ghost atom" data by communicating with neighboring processes. During computation, LAMMPS stores ghost atoms separately from local atoms, allowing each process to perform force calculations locally without frequent cross-process data access. After computation, the process also needs to send the calculated forces acting on the ghost atoms back to its parent process to ensure correct force accumulation and the satisfaction of Newton's third law.

[0065] In LAMMPS, the EAM (Embedded Atom Method) potential is a class of many-body potential functions specifically designed for metallic systems, particularly transition metals and alloys. In metals, the interaction between atoms depends not only on the distance between them but also strongly on the overall density of the surrounding electron cloud. Therefore, it reflects the physical nature of metallic bonds more accurately than simple two-body potentials (such as the Lennard-Jones potential). The core idea of ​​EAM is that the total energy of each atom consists of two parts: embedding energy and pair potential. The former is the energy required to place an atom into the electron density provided by its neighboring atoms. The latter represents the short-range repulsion and attraction between atoms. Therefore, the total energy of the system can be written as:

[0066] (1)

[0067] in, It is the many-body term of the EAM potential, representing the atoms. The embedding energy reflects the many-body effect of the surrounding atoms on the central atom. It is the sum of electron densities from the surrounding atoms. It is a traditional two-body term, representing atoms. and atoms The potential energy of the two-body interaction. This is to avoid calculating twice when summing all atom pairs. This represents the distance between two atoms. In the calculation of the EAM potential function, we can know... Therefore, the potential function of the two forces (embedded force and opposing force) can be written as:

[0068] (2)

[0069] (3)

[0070] For the calculation of the two-body term (3), let Differentiating each yields... Organized Therefore, the magnitude of the force is: .

[0071] Potential function EAM , , These are all complex nonlinear functions. To improve computational efficiency, instead of calculating the complex function every time a function value is needed, a small amount of pre-computation and fast interpolation are used to replace the very expensive function calculation each time, which greatly improves the speed.

[0072] Interpolation is a mathematical method that estimates the value of an unknown point using known discrete data points. Its basic idea is to use known discrete data points... We want to estimate the value of y at x, where Common interpolation methods include linear interpolation, polynomial interpolation, and spline interpolation. The basic concept of spline interpolation is to divide the entire interval into several small segments, fit each segment with a low-order polynomial, and ensure smooth transitions at the junctions.

[0073] Furthermore, an example of third-order spline interpolation is given, in the interval... Above, known and Using cubic polynomial fitting And using an evenly spaced grid with constant spacing, the formula is as follows:

[0074] (4)

[0075] (5)

[0076] For derivative estimation, first estimate the reciprocals of the endpoints, and then the left endpoint. Forward difference ,

[0077] The second point Central difference is divided into right endpoint Backward difference The second to last point Central difference is divided into For interior points Using five-point central difference ,

[0078] make Then the coefficients in formula (4) can be solved as follows:

[0079] Substituting the endpoint values ​​into the solution yields the fitted value for any point within the interval.

[0080] Step 2: Accelerate the calculation of metal molecular dynamics simulations by optimizing the calculation process of the EAM potential function;

[0081] Furthermore, in the LAMMPS EAM function calculation implementation, the spline coefficients are pre-calculated and stored:

[0082] For each function and each interval, store 7 coefficients: coeff[0], coeff[1], coeff[2], coeff[3],

[0083] coeff[4], coeff[5], coeff[6], where coeff[0], coeff[1], coeff[2] are used for derivative calculation, and the last four coefficients coeff[3], coeff[4], coeff[5], coeff[6] are used for function value calculation. The z2r_spline array stores the spline interpolation coefficients, and the rhor_spline array stores the derivative-related information of the electron density function.

[0084] Furthermore, the entire processor computation process of the traditional EAM function can be divided into three steps:

[0085] Step 1: By iterating through all metal atom pairs, calculate the total electron cloud density rho[i] at each atom position. ;

[0086] Step 2: Calculate the embedding force function fp and the embedding energy. Map the electron density rho[i] to the lookup table index p through density normalization, find the table index m closest to p, and perform boundary checks on m to ensure that index m is within the valid range. Use quadratic spline interpolation to look up the table to calculate the embedding function fp[i] of each atom, and use cubic spline interpolation to calculate the embedding energy of each atom. At the same time, if the density exceeds the set maximum value rhomax, perform reasonable linear extrapolation.

[0087] Step 3: Calculate the interatomic forces and potential energy. By iterating through all atomic pairs again, using the previously calculated rho and fp arrays, and combining the lookup table rhor_spline and z2r_spline spline interpolation, calculate the embedding force fp[i]*rhojp + fp[j]*rhoip and the opposing force phip, and update it to the global F array.

[0088] As one embodiment, this disclosure improves and optimizes the calculation process of the EAM potential function based on the traditional three-step calculation algorithm of the EAM function. The calculation process involves algorithm reconstruction, vectorization, and mixed precision to further improve computational efficiency. Simultaneously, for the gather problem in vectorization, methods such as table lookup and parameter packing and splitting are employed. The computational pipeline is adjusted through prefetching. During the adjacency list construction process, the order of atomic loops is adjusted, and mixed precision is used to further accelerate computation, thus optimizing the algorithm on many-core architecture processors. The idea of ​​this disclosure based on SVE vectorization reconstruction is as follows:

[0089] This disclosure reconstructs the original algorithm, using a full adjacency list to calculate the EAM potential. The reconstruction's core idea is that the calculation of rho[j] is no longer needed when calculating the rho array in the first step; and communication between the three steps is eliminated. Furthermore, the third step is integrated into the first step, with the calculation result stored. The third step only accumulates the forces, reducing redundant calculations and parameter readings. However, considering that the reconstructed algorithm uses a full adjacency list, the number of neighboring atoms for each atom increases, and the reconstructed algorithm... i The number of atomic calculations is reduced, therefore, it is chosen to be in j The layered loop performs vectorization processing on the calculation of EAM. To further accelerate the vectorization efficiency, a mixed-precision algorithm is used to complete 16 calculations at once. j Atomic calculations.

[0090] As one embodiment, the calculation process of the reconstructed EAM potential function in this disclosure is as follows:

[0091] Step (1): Set the central atom, use vectorized loading and aggregation operations to obtain the coordinates of the central atom's neighbors, calculate the distance between atoms and filter out the neighbors within the truncation distance, and compress and store them into a temporary array;

[0092] Specifically, the process iterates through the central atom, uses vectorized loading and aggregation operations to obtain the numbers and coordinates of multiple neighboring atoms of the central atom, so that one central atom corresponds to multiple neighboring atoms during the calculation. The process uses mixed-precision vectorization to calculate the distance between the central atom and its neighboring atoms and filters out the neighbors within the cutoff radius. The filtered neighboring atom numbers, coordinate differences, etc. are compressed and stored in a temporary array.

[0093] Step (2): For the filtered neighbors, use vector interpolation to calculate the contribution of each neighbor to the electron density, and accumulate the contribution values ​​to obtain the total electron density;

[0094] Specifically, for the filtered neighbors, a vectorized interpolation fitting parameter acquisition method based on table lookup and splicing is used to calculate the contribution of each neighbor to the electron density. Based on prefetching, the loop calculation pipeline is adjusted, and the total electron density is obtained by accumulating the contribution value. At the same time, in order to reduce redundant calculations, some extra calculated interpolation parameter indices and force calculation factors are stored in a temporary array.

[0095] Step (3): Based on the total electron density, the embedding force of the embedding energy function is obtained by looking up a table and interpolation; combining the embedding force and the opposing force, the force of each neighboring atom on the central atom is calculated and accumulated, and the force of the neighboring atoms is updated by scattering operation;

[0096] Specifically, based on the total electron density, the embedding force of the embedding energy function is obtained by looking up a table and interpolation, and the system energy is updated at the same time; combined with the force calculation factor and other data stored in step (2), the force of each neighbor on the central atom is calculated and accumulated, and the force of the neighboring atoms is updated by scattering operation, and the system energy is updated.

[0097] Step (4): Continue iterating through all atoms to complete the optimized iterative calculation process of the EAM potential function.

[0098] Specifically, the forces acting on the central atom are updated until all central atoms have been traversed, completing the optimized iterative calculation process of the EAM potential function.

[0099] Furthermore, during the vectorized loading and aggregation operation in step (1), this disclosure considers that the calculation of the rho[i] array requires indexing based on the properties of the central atom and adjacent atoms, as well as the parameter m calculated through certain calculations. It uses 7 gathers to obtain the parameters coeff_rho[0], coeff_rho[1], coeff_rho[2], coeff_rho[3], and coeff_rho[4] from the rhor_spline array.

[0100] coeff_rho[5], coeff_rho[6], but the three parameters coeff_rho[0], coeff_rho[1], coeff_rho[2] can be obtained directly by some calculations using coeff_rho[3], coeff_rho[4], coeff_rho[5]. Therefore, this disclosure only needs to obtain coeff_rho[3], coeff_rho[4], coeff_rho[5], coeff_rho[6]. For z2r_spline numbers The group only needs to obtain coeff_z[3], coeff_z[4], coeff_z[5], coeff_z[6]. The two arrays need to obtain a total of 8 parameters. In order to make full use of the vector width and reduce the use of gather, this disclosure considers concatenating the array rhor_spline with the array z2r_spline, that is, coeff_rho[3], coeff_rho[4], coeff_rho[5], coeff_rho[6] with coeff_z[3], coeff_z[4],

[0101] coeff_z[5] and coeff_z[6] are concatenated to form an array floatpar_z_rho_float [type_num*type_num*nr][8] that is only related to atomic properties and m, which facilitates the gathering operation.

[0102] Furthermore, considering the use of registers, the vectorized gather acquisition method disclosed in this paper is transformed from the simple offset0, offset1, offset2, offset3, offset4, offset5, offset6, offset7 plus array start position *(double*)&par_z_rho_float[0][0] to the method that only uses offset0, offset1 plus array start position *(double*)&par_z_rho_float[0][0], *(double*)&par_z_rho_float[0][2], *(double*)&par_z_rho_float[0][4], *(double *)&par_z_rho_float[0][6], reducing the number of registers from the original 9 to 6, thereby improving gather efficiency.

[0103] To further improve the efficiency of gathering, considering that gathering64 is more efficient than gathering32, the original method of using gathering32 to obtain parameters after mixing is changed to using gathering64 to obtain parameters. The obtained parameters are then interpreted bit by bit by svreinterpret_u32_f64, and float-precision parameters are obtained by using svuzp1_u32 and svuzp2_u32.

[0104] Specifically, such as Figure 2 As shown, this disclosure directly concatenates the array rhor_spline with the array z2r_spline, that is, concatenates coeff_rho[3], coeff_rho[4], coeff_rho[5], coeff_rho[6] with coeff_z[3], coeff_z[4], coeff_z[5], coeff_z[6] to form an array float par_z_rho_float [type_num*type_num*nr][8] that is only related to atomic properties and m. Then, gather64 is used to obtain the parameters, and the obtained parameters are interpreted bit by bit by the svreinterpret_u32_f64 function. The float precision parameters are obtained by svuzp1_u32 and svuzp2_u32, and the same result is obtained as that obtained by gathering32.

[0105] Furthermore, considering that the gathering operation remains a bottleneck and a key factor limiting efficiency, this disclosure rearranges the pipeline, effectively utilizing a prefetching mechanism. The loop computation is divided into two parts: parameter acquisition and parameter calculation. The parameter acquisition for the first loop and the parameter calculation for the last loop are extracted outside the loop, thus rearranging the computation pipeline as follows:

[0106] The first calculation outside the loop continues until the parameters are prefetched using `svprfb_gather_s64offset`. Inside the loop, the first half performs normal calculations and prefetches parameters for the next iteration. The second half retrieves the prefetched parameters from the previous loop and performs calculations. This process continues until the loop terminates. The final parameter calculation is then performed outside the loop. By inserting some calculations between the prefetch and the actual `gather` operation, the pipeline is re-executed, effectively improving `gather` efficiency.

[0107] Furthermore, in the process of calculating the distance between atoms, filtering out neighbors within the truncation distance, and compressing and storing them in a temporary array, a bin loop-based adjacency list construction method is proposed. This disclosure specifically adjusts the `build` method for adjacency list construction to be dedicated to EAM, removing multiple `if` statements, making it only applicable to dedicated EAM fields. The overall method adjusts the loop approach; the original adjacency list construction involved traversing... i Atoms, Acquisition i The process involves traversing the bin containing the atom and its adjacent bins, calculating the distance between atom pairs, and filling the adjacency list of atom i with atoms whose distances are less than the truncation radius. To reuse atoms in adjacent bins, this disclosure adjusts the loop to traverse the central cell, which is the bin containing the central atom. The comparison of a single atom pair is abstracted into a comparison of the entire bin with other bins. First, the central cell is filtered. If all atoms in the current central cell are ghost atoms, the current cell is skipped, and the next cell is processed. If not all are ghost atoms, for vectorized calculation, all atoms in the adjacent bins corresponding to the current cell are imported into a large array. Atoms are retrieved from the array, and the distance between atom pairs is calculated using mixed-precision vectorization for further filtering.

[0108] This disclosure addresses the optimized splicing table construction method by adjusting the input file in.eam, setting the skindistance to 1.5 bins, and adding a sort command to force the atoms to be sorted at each time step.

[0109] Experimental verification

[0110] This disclosure utilizes the reconstructed computational process for experimental verification. Experiments show that the optimized algorithm achieves approximately 2.59 times the simulation efficiency of the original algorithm when running a system with 32,000 atoms on a processor, and approximately 2.5 times the simulation efficiency when running a system with approximately 2M atoms, demonstrating a significant optimization effect. Table 1 shows the test results using different algorithms when the system has 32,000 and 2.048M atoms, Table 2 shows the multi-process simulation of the optimized algorithm with different atom counts, and Table 3 shows the multi-process simulation of the optimized algorithm with different atom counts.

[0111] Table 1 Test results (except for the number of atoms, all other data are in ns / day)

[0112]

[0113] Table 2. Multiprocessing in ns / day with different numbers of atoms in the optimized algorithm.

[0114]

[0115] Table 3. Optimized Algorithm with Different Number of Atoms in Multiprocessing Timesteps / s

[0116]

[0117] Based on equation (6), the parallel efficiency of the optimized algorithm with strong expansion was calculated as follows: Figure 7 As shown, the data indicates that when the number of processes increases to 128, the system efficiency remains above 98%, achieving a high simulation speed.

[0118] (6)

[0119] in, T N for N Process runtime N For processes.

[0120] Example 2

[0121] One embodiment of this disclosure provides a molecular dynamics simulation system for many-core processor architectures, comprising:

[0122] The potential function construction module is used to obtain the metal atoms to be simulated and construct their EAM potential functions;

[0123] The optimized loop calculation module is used to accelerate the calculation of metal molecular dynamics simulations by optimizing the calculation process of the EAM potential function.

[0124] The calculation process for the optimized EAM potential function includes:

[0125] Set a central atom, use vectorized loading and aggregation operations to obtain the coordinates of the central atom's neighbors, calculate the distance between atoms and filter out the neighbors within the truncation distance, and compress and store them into a temporary array;

[0126] For the selected neighbors, vector interpolation is used to calculate the contribution of each neighbor to the electron density, and the total electron density is obtained by accumulating the contribution values.

[0127] Based on the total electron density, the embedding force of the embedding energy function is obtained by looking up a table and interpolation; combining the embedding force and the opposing force, the force of each neighboring atom on the central atom is calculated and accumulated, and the force of the neighboring atoms is updated by scattering operation;

[0128] The process continues until all atoms have been traversed, completing the optimized iterative calculation of the EAM potential function.

[0129] Example 3

[0130] One embodiment of this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the aforementioned molecular dynamics simulation method for many-core architecture processors.

[0131] Example 4

[0132] One embodiment of this disclosure provides a non-transitory computer-readable storage medium for storing computer instructions, which, when executed by a processor, implement the molecular dynamics simulation method for many-core architecture processors.

[0133] Example 5

[0134] One embodiment of this disclosure provides an electronic device, including: a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to perform a molecular dynamics simulation method for a many-core architecture processor.

[0135] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0136] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0137] While the specific embodiments of this disclosure have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of this disclosure. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of this disclosure are still within the scope of protection of this disclosure.

Claims

1. A molecular dynamics simulation method for many-core processor architectures, characterized in that, include: Obtain the metal atoms to be simulated and construct their EAM potential function; By optimizing the calculation process of the EAM potential function, accelerated calculations for metal molecular dynamics simulations are achieved. The calculation process for the optimized EAM potential function includes: Set a central atom, use vectorized loading and aggregation operations to obtain the coordinates of the central atom's neighbors, calculate the distance between atoms and filter out the neighbors within the truncation distance, and compress and store them into a temporary array; For the selected neighbors, vector interpolation is used to calculate the contribution of each neighbor to the electron density, and the total electron density is obtained by accumulating the contribution values. Based on the total electron density, the embedding force of the embedding energy function is obtained by looking up a table and interpolation; combining the embedding force and the opposing force, the force of each neighboring atom on the central atom is calculated and accumulated, and the force of the neighboring atoms is updated by scattering operation; The process continues until all atoms have been traversed, completing the optimized iterative calculation of the EAM potential function.

2. The molecular dynamics simulation method for many-core processor architecture as described in claim 1, characterized in that, The EAM potential is a many-body potential function. In metals, the interaction between atoms depends not only on the distance between the two atoms, but also strongly on the overall density of the surrounding electron cloud. The EAM potential reflects the physical nature of metallic bonds. The total energy of each atom consists of the embedding energy and the pair potential energy of the two-body interaction. The embedding energy is the energy required to insert an atom into the electron density provided by its neighboring atoms, while the pair potential energy represents the short-range repulsion and attraction between atoms.

3. The molecular dynamics simulation method for many-core processor architecture as described in claim 1, characterized in that, In the implementation of EAM potential function calculation, spline coefficients are pre-calculated and stored: for each function and each interval, 7 coefficients are stored, namely coeff[0], coeff[1], coeff[2], coeff[3], coeff[4], ... coeff[5],coeff[6], where coeff[0],coeff[1],coeff[2] are used for derivative calculation, coeff[3],coeff[4], coeff[5] and coeff[6] are used for function value calculation. The spline interpolation coefficients are stored in the z2r_spline array, and the derivative information of the electron density function is stored in the rhor_spline array.

4. The molecular dynamics simulation method for many-core processor architecture as described in claim 1, characterized in that, During the gather operation, the array rhor_spline is concatenated with the array z2r_spline. The following are related to coeff_rho[3], coeff_rho[4], coeff_rho[5], coeff_rho[6] and coeff_z[3], coeff_z[4], The coeff_z[5] and coeff_z[6] are concatenated to form an array floatpar_z_rho_float [type_num*type_num*nr][8] that is only related to atomic properties and m.

5. The molecular dynamics simulation method for many-core processor architecture as described in claim 1, characterized in that, The vectorized loading method for obtaining gather is as follows: Only use offset0, offset1 plus array start position *(double *)&par_z_rho_float[0][0], The method of using *(double*)&par_z_rho_float[0][2],*(double*)&par_z_rho_float[0][4],*(double *)&par_z_rho_float[0][6] reduces the use of registers.

6. The molecular dynamics simulation method for many-core processor architecture as described in claim 1, characterized in that, The optimized EAM potential function calculation loop is divided into two parts: parameter acquisition and parameter calculation. The parameter acquisition in the first loop and the parameter calculation in the last loop are extracted outside the loop. The calculation pipeline is rearranged as follows: outside the loop, the first calculation continues until the parameters are prefetched using svprfb_gather_s64offset. Then, the loop is entered. Inside the loop, the upper half is for normal calculation and parameter prefetching for the next loop. The lower half is for acquiring the parameters prefetched in the previous loop and performing calculations until the loop ends and exits. The last parameter calculation is performed outside the loop.

7. A molecular dynamics simulation system for many-core processor architectures, characterized in that, include: The potential function construction module is used to obtain the metal atoms to be simulated and construct their EAM potential functions; The optimized loop calculation module is used to accelerate the calculation of metal molecular dynamics simulations by optimizing the calculation process of the EAM potential function. The calculation process for the optimized EAM potential function includes: Set a central atom, use vectorized loading and aggregation operations to obtain the coordinates of the central atom's neighbors, calculate the distance between atoms and filter out the neighbors within the truncation distance, and compress and store them into a temporary array; For the selected neighbors, vector interpolation is used to calculate the contribution of each neighbor to the electron density, and the total electron density is obtained by accumulating the contribution values. Based on the total electron density, the embedding force of the embedding energy function is obtained by looking up a table and interpolation; combining the embedding force and the opposing force, the force of each neighboring atom on the central atom is calculated and accumulated, and the force of the neighboring atoms is updated by scattering operation; The process continues until all atoms have been traversed, completing the optimized iterative calculation of the EAM potential function.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the molecular dynamics simulation method for many-core architecture processors as described in any one of claims 1-6.

9. A non-transitory computer-readable storage medium, characterized in that, The non-transitory computer-readable storage medium is used to store computer instructions, which, when executed by a processor, implement a molecular dynamics simulation method for a many-core architecture processor as described in any one of claims 1-6.

10. An electronic device, characterized in that, include: The device includes a processor, a memory, and a computer program; wherein the processor is connected to the memory, the computer program is stored in the memory, and when the electronic device is running, the processor executes the computer program stored in the memory to enable the electronic device to perform a molecular dynamics simulation method for a many-core architecture processor as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Atomic scale MD-KMC parallel simulation unified modeling method and system

    CN119694419A

  • AIREBO potential optimization method and system suitable for multi-core processor

    CN120375941A