Atomic Tersoff potential simulation method and system for many-core architecture processors
By optimizing the Tersoff potential simulation method on the multi-core architecture processor, using thread copy and vectorization processing, the complex and time-consuming problem of Tersoff potential calculation is solved, and efficient molecular dynamics simulation performance is achieved.
Patent Information
- Application Number
- CN202510883907.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2045-06-30
AI Technical Summary
In the molecular dynamics simulation, the calculation of the Tersoff potential function is complex and time-consuming, especially on the multi-core architecture processor, which cannot meet the efficient computing needs. The original algorithm fails to make full use of hardware computing power, and there are problems of waste of resources and inefficiency.
The atomic Tersoff potential simulation method of the multi-core architecture processor is adopted. By opening a thread copy instead of atomic locks, combining hardware multi-threading characteristics, atomic labels are pre-processed and adjacency tables are reconstructed, the Tersoff potential gravitational calculation is optimized, vectorization and mixed precision processing are adopted, the calculation order and fusion function are adjusted, and the calculation performance is improved.
The Tersoff potential calculation performance is significantly improved, the efficiency needs of molecular dynamics simulation are met, and the optimization effect shows significant acceleration ratio and efficient simulation speed in different atomic systems.
Smart Images

Figure CN120388630B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of molecular dynamics, and in particular relates to a method and system for simulating atomic Tersoff potential of a many-core architecture processor. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] The demand for efficient molecular dynamics (MD) simulations continues to increase. For example, the LAMMPS (Large-scale Atomic / Molecular Massively Parallel Simulator) molecular dynamics simulation software can simulate the Tersoff potential of semiconductors, as well as the related potential fields of soft materials and mesoscopic particles. The Tersoff potential formula shows that the calculation of the Tersoff potential function is very complex, and in practice, the Tersoff potential simulation process is also very time-consuming: on a top-of-the-line desktop processor, a Tersoff potential simulation for a system with 512,000 atoms can only be completed in 0.4 nanoseconds per day.
[0004] Although LAMMPS uses adjacency lists to eliminate unnecessary interactions between distant atoms, the calculations are still relatively intensive for some complex interactions with many transcendental mathematical functions, such as the Tersoff potential, which still cannot meet the efficiency requirements of molecular dynamics simulations. Summary of the Invention
[0005] In order to solve the technical problems existing in the above-mentioned background technology, the present invention provides an atomic Tersoff potential simulation method and system for a many-core architecture processor. By deeply analyzing and optimizing the atomic Tersoff potential simulation based on the hardware characteristics of the many-core architecture processor, the method can significantly improve the computational performance of the Tersoff potential in the molecular dynamics simulation software, and provide a more efficient computing platform for molecular dynamics simulation in the field of materials science.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] A first aspect of the present invention provides an atomic Tersoff potential simulation method for a many-core architecture processor.
[0008] A method for simulating atomic Tersoff potential of a many-core architecture processor, comprising:
[0009] Create a copy of each thread to replace the atomic lock, pre-process the label of the i atom corresponding to each thread and reconstruct the binding with the adjacency table;
[0010] Initialize an array of size N*N to store the N short neighbor atoms of N i atoms;
[0011] Traverse N i atoms, use the instruction set to filter out the short neighbor atoms of i atom from the adjacency list, and fill the initialized array;
[0012] Transpose the padded array. The j-th row of the transposed array represents the j-th short neighbor of N i atoms, so as to calculate the Tersoff potential attraction of N i atoms.
[0013] When the forces on the short neighbors of N i atoms are calculated, the forces on the current N i atoms are updated in a vectorized manner until the forces on all i atoms are calculated. The replica forces of each thread are reduced and the calculation ends, releasing all replica spaces. N is the number of 32-bit integer type elements that can be processed by a vector unit in a many-core architecture processor. j is a positive integer not less than 1 and not greater than N.
[0014] A second aspect of the present invention provides an atomic Tersoff potential simulation system for a many-core architecture processor.
[0015] An atomic Tersoff potential simulation system for a many-core architecture processor, comprising:
[0016] The label processing module is used to open a copy of each thread to replace the atomic lock, pre-process the label of the i atom corresponding to each thread and reconstruct the binding with the adjacency table;
[0017] An array initialization module is used to initialize an array of size N*N to store N short neighbor atoms of N i atoms;
[0018] An array filling module is used to traverse N i atoms, filter out the short neighbor atoms of i atoms from the adjacency list using the instruction set, and fill the initialized array;
[0019] A gravity calculation module is used to transpose the filled array, where the j-th row of the transposed array represents the j-th short neighbor of N i atoms, so as to perform Tersoff potential gravity calculation on the N i atoms;
[0020] The replica reduction module is used to vectorize the update of the forces of the current N i atoms after the force calculation of the N short neighbors of i atoms is completed, until the force calculation of all i atoms is completed, reduce the replica forces of each thread and end the calculation, and release all replica space; where N is the number of 32-bit integer type elements that can be processed by a vector unit in a multi-core architecture processor; j is a positive integer not less than 1 and not greater than N.
[0021] A third aspect of the present invention provides a computer program product.
[0022] A computer program product includes a computer program / instruction, which implements the steps of the atomic Tersoff potential simulation method of the many-core architecture processor when the computer program / instruction is executed by a processor.
[0023] A fourth aspect of the present invention provides a many-core architecture processor.
[0024] A many-core architecture processor includes a memory, a processor body, and a computer program stored in the memory and executable on the processor body. When the processor body executes the program, the steps of the atomic Tersoff potential simulation method for the many-core architecture processor described above are implemented.
[0025] Compared with the prior art, the present invention has the following beneficial effects:
[0026] The present invention opens up copies of each thread to replace atomic locks, combines the hardware multi-threading characteristics of the many-core architecture processor, pre-processes the atomic labels corresponding to each thread and reconstructs and binds them with the adjacency list, and performs Tersoff potential gravity calculations on multiple atoms in each thread. Finally, after the force calculations of all atoms with the same label are completed, the force of the copies of each thread is reduced and the calculation is terminated, freeing up all copy space. This significantly improves the calculation performance of the Tersoff potential in the molecular dynamics simulation software and meets the efficiency requirements of molecular dynamics simulation.
[0027] Advantages of additional aspects of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0029] Figure 1 This is a flow chart of a method for simulating atomic Tersoff potential of a many-core architecture processor according to an embodiment of the present invention;
[0030] Figure 2 1 is a schematic diagram of an atomic Tersoff potential simulation process of a many-core architecture processor according to an embodiment of the present invention;
[0031] Figure 3 Schematic diagram of atomic vectorized calculation according to an embodiment of the present invention;
[0032] Figure 4 It is the short neighbor screening of an embodiment of the present invention;
[0033] Figure 5 This is an example of the svhistcnt function in an embodiment of the present invention;
[0034] Figure 6 1 is a schematic structural diagram of an atomic Tersoff potential simulation system for a many-core architecture processor according to an embodiment of the present invention;
[0035] Figure 7 is the algorithm speedup ratio after optimization of the 4.096M atomic system in the embodiment of the present invention;
[0036] Figure 8 is the multi-process speedup ratio of the algorithm after optimization of different atomic number systems in the embodiment of the present invention;
[0037] Figure 9 This is the strong scalability of the algorithm after the 4.096M atomic system optimization of the embodiment of the present invention. DETAILED DESCRIPTION
[0038] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0039] It should be noted that the following detailed descriptions are illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which the present invention belongs.
[0040] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0041] Explanation of terms:
[0042] Tersoff potential function:
[0043] For a system with n atoms, the potential function You can write:
[0044] (1);
[0045] (2);
[0046] in, represents the potential energy of the system of n atoms; and are the repulsive and attractive terms of the potential function, is a smooth function, is the gravitational function caused by other atoms, and its form is as follows:
[0047] (3);
[0048] (4);
[0049] (5);
[0050] (6);
[0051] The calculation involving the three-body potential is as follows:
[0052] (7);
[0053] (8);
[0054] in is a vector and The angle of is a function of the bond angle, yes The smallest Value, among the parameters used in equations (1) to (8), 、 The calculation of the two-body potential is performed by atoms and Determined by the type of The calculation of the three-body potential is performed by atoms 、 and The type of and It is used in the calculation of two-body potential and three-body potential, generally by Determined by the type of atom.
[0055] In the calculation of the Tersoff potential function, the two-body potential is generally calculated first. During the two-body potential calculation, atoms that are close enough to require a three-body potential calculation are found, and then the three-body potential calculation is performed on these atoms. After the above analysis, the original algorithm has the following main problems:
[0056] The OPENMP version of the original algorithm is relatively simple and cannot fully utilize the powerful computing power of multi-core architecture processors. At the same time, in the OPENMP version, updates to atomic forces usually use atomic locks to avoid write conflicts. However, atomic locks are relatively time-consuming and inefficient.
[0057] A single thread of the original algorithm can only process the calculation of one atom i and its adjacent atoms at a time. It lacks an effective vectorized version, wastes computing resources, and has low single-thread efficiency.
[0058] The original algorithm was difficult to vectorize: 1) It required a large number of gather and scatter operations to obtain parameters, which was very time-consuming, and extensive use would make the algorithm inefficient. 2) The algorithm first screened the atoms' short neighbors, identifying atoms close enough to perform the three-body potential calculation. An atom typically had four or five short neighbors. During the three-body potential calculation, if vectorization was performed on multiple short neighbors of an atom vertically, the loop might not fill the vector bit count, resulting in low efficiency. If vectorization was performed on the same short neighbor of multiple atoms horizontally, the screening operation would be very difficult. 3) In a vectorized operation, it was possible that the x-th short neighbor of atoms a and b was both c, making the vectorized update difficult.
[0059] The original algorithm first calculated the two-body potential and then the three-body potential. The same data was repeatedly calculated in different functions. For example, in the calculation of the repulsive term and the gravitational term, the smooth function was calculated, resulting in a waste of data and computing resources.
[0060] In the original algorithm, if the adjacency list remains unchanged, each iteration will recalculate whether the atoms in the adjacency list participate in the calculation. There are a large number of judgment statements, which is not only inconvenient for vectorization but also wastes resources due to repeated calculations.
[0061] This paper builds on the existing algorithm by creating a multi-threaded replica. It also optimizes the single-threaded model by adjusting the order of repulsive and attractive force calculations, fusing functions, vectorizing multiple atomic calculations, and employing mixed precision to further improve computational efficiency. This optimizes the algorithm for many-core processors. Analysis shows that this optimization can be divided into two areas: multi-threaded optimization and single-threaded vectorization optimization.
[0062] Figure 1 A flowchart of a method for simulating atomic Tersoff potential of a many-core architecture processor according to an embodiment of the present invention is provided. The method for simulating atomic Tersoff potential of a many-core architecture processor according to an embodiment of the present invention specifically includes the following steps S101 to S105.
[0063] The following combination Figure 1 and Figure 2 The specific implementation process of steps S101 to S105 is given in detail.
[0064] S101: Create a copy of each thread to replace the atomic lock, pre-process the label of the i atom corresponding to each thread and reconstruct the binding with the adjacency table.
[0065] In this embodiment, the multi-threaded version is rewritten to use copies instead of atomic locks: wherein the copy space release and reallocation are associated with the adjacency list reconstruction.
[0066] A multi-threaded parallel strategy is used at the i-atom loop level. Each thread uses a dynamic i-atom force calculation to ensure thread load balancing. Each thread calculates the corresponding atomic force and updates the copy.
[0067] For example, for global variables such as eng_vdwl, eng_coul, virial, eatom, vatom, f of the pair class, use memory->create to open copies related to the number of threads, and point eng_vdwl_thr, eng_coul_thr, virial_thr, eatom_thr, vatom_thr, and f_thr to the first address of the copy space. The release and reallocation of the copy space are associated with the reconstruction of the adjacency list. The copy space will only be released and reallocated when neighbor->ago is equal to 0.
[0068] OMP (multi-threaded parallel strategy) is used at the i-atom loop level. Each thread performs calculations on multiple i atoms. At the same time, a dynamic strategy is adopted to ensure thread load balancing. Each thread calculates the corresponding atomic force and updates the copy.
[0069] After the i-atom loop ends, all copies are merged. Specifically, the eatom_thr, vatom_thr and f_thr copies of different i-atoms are multi-threaded, and the eng_vdwl_thr, eng_coul_thr and virial_thr copies are serially merged.
[0070] S102: Initialize an array of size N*N to store N short neighbor atoms of N i atoms.
[0071] S103: Traverse N i atoms, use the instruction set to filter out the short neighbor atoms of i atom from the adjacency list, and fill the initialized array.
[0072] S104: Transpose the filled array, where the j-th row of the transposed array represents the j-th short neighbor of the N i atoms, so as to perform Tersoff potential gravity calculation on the N i atoms.
[0073] S105: After the force calculation of N i-atom short neighbors is completed, the forces of the current N i-atom are vectorized and updated until the force calculation of all i-atom is completed. The copy forces of each thread are reduced and the calculation is ended, and all copy spaces are released. Wherein, N is the number of 32-bit integer type elements that can be processed by a vector unit in the many-core architecture processor; j is a positive integer not less than 1 and not greater than N.
[0074] It should be noted here that steps S102 to S104 are all implemented in a single thread.
[0075] After analysis, there are three nested loops in calculating the Tersoff potential. However, the vectorization efficiency is not high in the second and third layers. Therefore, it is decided to use vectorization in the outermost loop. The process includes vectorized neighbor screening and three-body potential calculation. Denote N as the number of atoms that a vectorized unit can process. Before calculation, traverse the neighbors of atom i, label the atoms participating in the calculation of the repulsive function, and associate the label array with the reconstruction of the adjacency list. Only when neighbor->ago in the reconstruction of the adjacency list is equal to 0, the label array will be processed again.
[0076] The process of calculating the attractive force of the Tersoff potential for N i atoms in a single thread is as follows:
[0077] Step a1: Initialize an array A with a size of N * N to store the N short neighbor atoms of N i atoms.
[0078] Step a2: Traverse the N i atoms, use the instruction set to effectively screen the short neighbor atoms of the i atoms, and fill the array A. The element (i, j) in this array represents the j-th short neighbor of the i-th atom. In Figure 3 , the black box represents a vector calculation unit, the blue represents the i atom, the green represents the neighbor of the i atom, and the orange represents the short neighbor of the i atom.
[0079] Step a3: Transpose the array. After transposition, the first row of the array represents the first short neighbor of N i atoms, and so on. Subsequently, the Tersoff potential of multiple i atoms is calculated.
[0080] Step a4: Load the N i atoms processed above into the vector unit as i_vec, and load the j-th short neighbor of the N i atoms into the vector unit as j_vec, with j initialized to 1.
[0081] Step a5: Load the k-th short neighbor of the N i atoms into the vector unit as k_vec, where k is not equal to j. Calculate zeta_vec through i_vec, j_vec, and k_vec, k++. Loop through all k_vec, k < N, and accumulate the zeta_vec calculated in each round.
[0082] Step a6: Determine whether the short neighbor atoms in the current j_vec participate in the repulsive calculation through the label array. The atoms participating in the calculation of the repulsive function calculate an additional part of the force in the fused function force_zeta_and_repulsive, and perform an accumulation or subtraction operation on the forces of the i_vec and j_vec atoms.
[0083] Step a7: Load the k-th short neighbor of N i atoms into the vector unit as k_vec, where k is not equal to j. Calculate attractive_vec through i_vec, j_vec, and k_vec. Update the forces on the short neighbor atoms of k_vec in a vectorized loop, and perform addition or subtraction operations on the forces on the atoms of j_vec and i_vec.
[0084] Step a8: Update the forces on the short neighbor atoms of j_vec in a vectorized loop, and sequentially loop through the remaining short neighbor atoms, j++, j < N.
[0085] Step a9: Update the forces on the short neighbor atoms of i_vec in a vectorized loop.
[0086] Step a10: End the calculation of the current N i atoms, obtain the other N i atoms, and repeat Steps a1 to a9 until the force calculations and updates for all i atoms are completed.
[0087] In some specific implementation processes, combined with Figure 4 , the process of using the instruction set to filter out the short neighbor atoms of i atoms from the adjacency list is as follows:
[0088] Step b1. Initialize the array shortcnt[N] = {0}, which is used to store the number of short neighbors of the corresponding N i atoms.
[0089] Step b2. Load the N neighbor atoms j of the i atom into a vector unit svint64_t, where inum represents the order of the currently processed i atom, inum < N.
[0090] Step b3. Vectorize the calculation of the coordinate interpolation delx, dely, delz between the neighbor atom j and the i atom, calculate the distance rsq, and compare it with the cutoff radius cutoff of the i atom to generate a predicate mask svbool_t. The position corresponding to the j atom with rsq < cutoff in the predicate mask is 1.
[0091] Step b4. Use the svcompact function to load the elements at the positions where the svbool_t is 1 in the svint64_t into a new vector svint64_t.
[0092] Step b5. Use the svcntp function to count the number of 1s in the predicate svbool_t to obtain the number numcompact of short neighbor atoms among the currently processed N j atoms.
[0093] Step b6. Use svst to store the short neighbor vector into the short neighbor array A[inum] + shortcnt[inum], and shortcnt[inum] += numcompact.
[0094] Step b7. Return to step b2 and process the neighboring atoms of atom i until all the neighboring atoms are processed. Then, traverse to the next atom i, inum++.
[0095] The original algorithm, after filtering short neighbors, performed conditional judgments before calculating the two-body potential repulsion. This conditional judgment was complex and not conducive to vectorized acceleration. Furthermore, the content of the conditional judgment depended on the properties of the atoms in the current adjacency table. If the adjacency table remained unchanged, the result of the conditional judgment for the same atoms would remain unchanged. The present invention's judgment is tied to the reconstruction of the adjacency table. It only determines whether atoms have the same properties each time the adjacency table is rebuilt and equal to 0. Atoms with the same properties are labeled, and only the labeled atoms are subsequently calculated.
[0096] In the original algorithm, after screening short neighbors, the two-body potential repulsion is calculated through conditional judgment, that is, the Repulsive function is called at the j-atom level (the second-level loop), and the three-body potential attraction is calculated among the short neighbors, that is, the k-atom loop is performed at the j-atom level (the third-level loop).
[0097] Combining the formulas (2), (6) and (7) mentioned in the background, we can find that the calculation 、 and All need to be used Item, and all atoms in the short neighborhood participate in the attractive force calculation, and some atoms participate in the repulsive force calculation, and the participating part can be controlled by svbool.
[0098] At the same time, it can be found that calculating the Repulsive function and calculating Functions are all at the j-atom level, so consider the calculation In the process, The data is recorded and the force_zeta function is called to calculate When adding the Repulsive function, the original force_zeta function is merged with the Repulsive function to reuse some data and reduce calculation and storage.
[0099] At the same time, for discontinuous data used multiple times in the vectorization process, use gather to obtain it the first time and store the obtained data in an array. Subsequently, load it directly from the array without using gather.
[0100] In the specific implementation, during the calculation of the Tersoff potential gravitational force of N i-atoms, the forces on the N i-atoms are updated in a vectorized loop. A set function is used to generate a new numerical vector to count the number of times the atom appears in the current vector.
[0101] In atomic force updates, if the same atom appears two or three times in a vector calculation unit, it is incorrect to directly add the corresponding force vector to the original force. This is corrected by using a cyclic update method:
[0102] For example, Figure 5 As shown, the svhistcnt function is used to generate a new numerical vector to count the number of times the atom appears in the current vector. The value of the corresponding position of an atom that appears once in the original vector is 1. The value of the corresponding position of an atom that appears twice in the new vector is 2. The value of the corresponding position of an atom that appears three times in the new vector is 3.
[0103] Initialize count to 1 and use the svcmpne function to generate the svbool_t predicate. The position corresponding to the number of occurrences count in the numerical vector is 1. svbool_t controls the atoms updated in the current round. Count increases by 1 each loop until the svcntp function is used to count the number of occurrences count in the numerical vector and the number of occurrences count is 0. The loop ends.
[0104] The original algorithm used double data types for calculating atomic forces and overall system energy. Based on vectorization, we plan to use mixed precision. Because atomic force data is used iteratively, this embodiment uses double precision for cumulative force calculations and float precision for direct cumulative overall energy calculations.
[0105] The mixed precision calculation steps are as follows:
[0106] Step c1: Initialize the label array.
[0107] Step c2: Change N=N*2 in the vectorization step, initialize the array A[N*2][N*2], and traverse N*2 i atoms.
[0108] Step c3: Follow the vectorization steps until the calculation of delx, dely, and delz is completed using double precision, i.e., svfloat64_t, in the short neighbor screening.
[0109] Step c4: Use the svcvt function to convert the calculated data into float precision, i.e. svfloat32_t. All subsequent calculations use svfloat32_t.
[0110] Step c5: When accumulating the force, convert svfloat32_t back to svfloat64_t through the combined functions svzip1, svzip2 and svcvt, and use svunpklo_b and svunpkhi_b to split the predicate vector to reduce the atomic iteration force error.
[0111] In this way, using mixed precision can perform calculations on N*2 atoms at a time, greatly improving computational efficiency.
[0112] Table 1 Test results (except the number of atoms, all other data units are ns / day);
[0113]
[0114] Table 2 Multi-process ns / day for different number of atoms of the optimized algorithm;
[0115]
[0116] Table 3 Timesteps / s of multiple processes with different numbers of atoms in the optimized algorithm;
[0117]
[0118] According to the experimental results in Tables 1-3, the optimized single-thread algorithm runs on a system with 32,000 atoms on a processor, and the simulation efficiency is about 4.85 times that of the original algorithm. The simulation efficiency is about 4.83 times that of the original algorithm when running on a system with about 4M atoms. The simulation efficiency is about 3.5 times that of the original algorithm when running on a system with about 4M atoms. The optimization effect is obvious. The speedup ratio of the optimized algorithm on a system with 4.096M atoms and the speedup ratio of the multi-process algorithm on systems with different numbers of atoms are shown in the figure below. Figure 7 and Figure 8 shown.
[0119] According to formula (9), the parallel efficiency of the optimized algorithm with strong expansion is calculated as follows: Figure 9 As shown in Figure 2, the data shows that when the number of processes increases to 128, the system efficiency is still above 65%, and a higher simulation speed can be achieved.
[0120] (9);
[0121] in, Indicates strong scalability of parallel efficiency; is the running time of N processes; The running time of a single process.
[0122] Figure 6 This is a schematic diagram of the structure of an atomic Tersoff potential simulation system for a multi-core architecture processor according to an embodiment of the present invention. Figure 6The atomic Tersoff potential simulation system for many-core processors includes the following modules:
[0123] The label processing module 601 is used to create a copy of each thread to replace the atomic lock, pre-process the label of the i atom corresponding to each thread and reconstruct the binding with the adjacency table;
[0124] An array initialization module 602 is used to initialize an array of size N*N to store N short neighbor atoms of N i atoms;
[0125] An array filling module 603 is used to traverse N i atoms, filter out the short neighbor atoms of i atom from the adjacency list using an instruction set, and fill the initialized array;
[0126] A gravity calculation module 604 is used to transpose the filled array, wherein the j-th row of the transposed array represents the j-th short neighbor of N i atoms, so as to perform Tersoff potential gravity calculation on the N i atoms;
[0127] The replica reduction module 605 is used to vectorize the update of the forces of the current N i atoms after the force calculation of the N short neighbors of the i atoms is completed, until the force calculation of all the i atoms is completed, reduce the replica forces of each thread and end the calculation, and release all replica spaces; wherein N is the number of 32-bit integer type elements that can be processed by a vector unit in the many-core architecture processor; j is a positive integer not less than 1 and not greater than N.
[0128] It should be noted here that the specific implementation processes of the label processing module 601, array initialization module 602, array filling module 603, gravity calculation module 604 and replica reduction module 605 in the atomic Tersoff potential simulation system of the many-core architecture processor correspond one-to-one to the various steps in the atomic Tersoff potential simulation method of the many-core architecture processor mentioned above, and their specific implementation processes are the same and will not be described in detail here.
[0129] In one or more embodiments, a multi-core architecture processor is provided, comprising a memory, a processor body, and a computer program stored in the memory and executable on the processor body, wherein when the processor body executes the program, the computer program is executed as described above. Figure 1 The steps in the atomic Tersoff potential simulation method for a many-core architecture processor are shown.
[0130] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage) containing computer-usable program code.
[0131] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts 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, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0132] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0133] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A method for simulating atomic Tersoff potential of a many-core architecture processor, characterized in that: include: Create a copy of each thread to replace the atomic lock, pre-process the label of the i atom corresponding to each thread and reconstruct the binding with the adjacency table; Initialize an array of size N*N to store the N short neighbor atoms of N i atoms; Traverse N i atoms, use the instruction set to filter out the short neighbor atoms of i atom from the adjacency list, and fill the initialized array; Transpose the padded array. The j-th row of the transposed array represents the j-th short neighbor of N i atoms, so as to calculate the Tersoff potential attraction of N i atoms. When the forces on the short neighbors of N i atoms are calculated, the forces on the current N i atoms are updated in a vectorized manner until the forces on all i atoms are calculated. The replica forces of each thread are reduced and the calculation ends, releasing all replica spaces. N is the number of 32-bit integer type elements that can be processed by a vector unit in a many-core architecture processor. j is a positive integer not less than 1 and not greater than N.
2. The atomic Tersoff potential simulation method for a many-core architecture processor according to claim 1, wherein: Each time the adjacency list is rebuilt and equal to 0, it is determined whether the atoms have the same attributes; atoms with the same attributes are labeled, and only the labeled atoms are subsequently calculated.
3. The atomic Tersoff potential simulation method for a many-core architecture processor according to claim 1, wherein: During the calculation of the Tersoff potential gravity of N i atoms, the forces acting on the N i atoms are updated in a vectorized loop.
4. The atomic Tersoff potential simulation method for a many-core architecture processor according to claim 3, wherein: Use the set function to generate a new numeric vector to count the number of times the atom appears in the current vector.
5. The atomic Tersoff potential simulation method for a many-core architecture processor according to claim 1, wherein: Double precision is used when calculating the accumulated forces, and float precision is used when directly accumulating the overall energy.
6. The atomic Tersoff potential simulation method for a many-core architecture processor according to claim 1, wherein: Associate copy space release and reallocation with adjacency list reconstruction.
7. The atomic Tersoff potential simulation method for a many-core architecture processor according to claim 1, wherein: A multi-threaded parallel strategy is used at the i-atom loop level. Each thread uses a dynamic i-atom force calculation to ensure thread load balancing. Each thread calculates the corresponding atomic force and updates the copy.
8. An atomic Tersoff potential simulation system for a many-core architecture processor, characterized in that: include: The label processing module is used to open a copy of each thread to replace the atomic lock, pre-process the label of the i atom corresponding to each thread and reconstruct the binding with the adjacency table; An array initialization module is used to initialize an array of size N*N to store N short neighbor atoms of N i atoms; An array filling module is used to traverse N i atoms, filter out the short neighbor atoms of i atoms from the adjacency list using the instruction set, and fill the initialized array; A gravity calculation module is used to transpose the filled array, where the j-th row of the transposed array represents the j-th short neighbor of N i atoms, so as to perform Tersoff potential gravity calculation on the N i atoms; The replica reduction module is used to vectorize the update of the forces of the current N i atoms after the force calculation of the N short neighbors of i atoms is completed, until the force calculation of all i atoms is completed, reduce the replica forces of each thread and end the calculation, and release all replica space; where N is the number of 32-bit integer type elements that can be processed by a vector unit in a multi-core architecture processor; j is a positive integer not less than 1 and not greater than N.
9. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the atomic Tersoff potential simulation method for a many-core architecture processor according to any one of claims 1 to 7 are implemented.
10. A many-core architecture processor comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the atomic Tersoff potential simulation method for a many-core architecture processor are implemented as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Molecular dynamics simulation acting force analysis method and device and computer equipment
CN118692576A
Method of simulating low molecule in macromolecule
JP2011123874A