AIREBO potential optimization method and system suitable for multi-core processor
By constructing a hierarchical adjacency table, pre-computing key sequence network and classifying and grouping optimization batch calculation on a multi-core processor, the problem of low computational efficiency of AIREBO potential function in the multi-core processor architecture is solved, and efficient parallel computing and overall performance improvement is achieved.
Patent Information
- Application Number
- CN202510854705.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-06-25
AI Technical Summary
The existing AIREBO potential function has low computational efficiency in multi-core processor architecture, complex adjacency table structure, large communication and synchronization overhead, making it difficult to achieve efficient parallel computing.
By constructing hierarchical adjacency tables, pre-computing key-sequence networks and classifying packets, batch calculations are optimized, and task splitting and processing are used for multi-core processors to optimize the adjacency table construction and calculation process.
It significantly improves the parallel computing efficiency of AIREBO potential, reduces computational redundancy and communication overhead, and improves the overall performance of molecular dynamics simulation, especially in large-scale simulation of carbon-based materials.
Smart Images

Figure CN120375941A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of molecular dynamics simulation, and in particular to an AIREBO potential optimization method and system applicable to multi-core processors. Background Technique
[0002] The statements in this part only provide background technical information related to the present invention and do not necessarily constitute prior art.
[0003] LAMMPS (Large-scale Atomic / Molecular Massively Parallel Simulator) is an open-source molecular dynamics simulation software for large-scale atomic / molecular systems, designed specifically for high-performance computing environments, with excellent parallel scalability and a highly modular architecture. With support for a variety of physical models and an extensible potential function library, LAMMPS can simulate various complex materials such as metals, semiconductors, polymers, and biomolecules, and has become one of the key platforms in cross-scale molecular simulation research.
[0004] Currently, LAMMPS has achieved efficient screening of short-range interactions between atoms by introducing an adjacency list mechanism, significantly improving the calculation efficiency of conventional two-body potentials. However, for the complex many-body interaction model of the AIREBO (Adaptive Intermolecular Reactive Empirical Bond Order) potential function, its calculation still faces great challenges. The AIREBO potential further introduces van der Waals interaction terms and torsional terms on the basis of the REBO potential, and needs to simultaneously simulate the multi-scale coupling process of short-range covalent bonds, long-range van der Waals forces, and four-body torsional interactions. This potential function responds to local chemical environment changes in real time through a dynamic bond order correction mechanism, involving high-frequency sampling of three-body angle distributions, conjugation effects, and four-atom configurations, and the calculation intensity is much higher than that of traditional potential functions.
[0005] In addition, the significant difference in the cut-off radii of the short-range reaction term and the long-range interaction term in the AIREBO potential makes the construction and management of the adjacency list more complex, and the communication and synchronization overheads increase. At the same time, there are a large number of nested loops, conditional judgments, and data dependencies in the force calculation, which are difficult to effectively vectorize and thread parallelize, further restricting the parallel efficiency. The existing solutions for applying the AIREBO potential to multi-core processor architectures do not fully utilize the cache structure, thread scheduling mechanism, and memory access characteristics on multi-core processors, and there is still significant room for optimization in the overall parallel scalability and calculation efficiency of the application process.
[0006] Therefore, in view of the defects in the existing AIREBO potential, such as the unreasonable construction of the adjacency list mechanism, the high computational intensity of network relationship calculation, and the complex interaction relationship between each pair of atoms, how to provide a method to improve the overall computational performance of molecular dynamics simulation has become a key technical problem urgently to be solved in this field. Summary of the Invention
[0007] Aiming at the deficiencies of the existing technology, the object of the present invention is to provide an AIREBO potential optimization method and system applicable to multi-core processors, which realizes the efficient parallel calculation of the AIREBO potential based on the multi-core processor architecture, solves the technical problems such as heavy computational load, low parallel efficiency, and bottlenecks in adjacency list construction and many-body potential function calculation in existing molecular dynamics simulation software, and aims to improve the overall molecular dynamics simulation efficiency.
[0008] To achieve the above object, the present invention is implemented through the following technical solutions: The first aspect of the present invention provides an AIREBO potential optimization method applicable to multi-core processors, including the following steps: Obtain atomic information, and construct a hierarchical adjacency list according to the cut-off radius characteristics of the AIREBO potential and the atomic information; Pre-construct a bond order network according to the connectivity information between atoms in the adjacency list, and utilize the pre-constructed bond order network when calculating the FLJ function; Classify and group according to different types of interactions between atoms, and perform batch calculation of the FREBO function according to the classification and grouping results, wherein the calculation tasks are split, and each split task is processed by a multi-core processor; Integrate the calculation results of the FLJ function and the FREBO function, and combine with the calculation result of the FTORSION function to obtain the final AIREBO potential.
[0009] Further, the specific steps of constructing a hierarchical adjacency list according to the cut-off radius characteristics of the AIREBO potential and the atomic information are as follows: Record the atomic information collected and create an index; Traverse the neighborhood grid list of each atom to obtain all atom pairs, and screen the atom pairs according to the cut-off radius characteristics; Construct a short-range adjacency list and a long-range adjacency list respectively according to the screening results.
[0010] Furthermore, the specific steps of screening atom pairs according to the cut-off radius characteristics are as follows: For each pair of atom pairs, calculate the square of the distance between the two atoms, and compare it with the square of the maximum neighbor cut-off radius to obtain candidate atom pairs; For the selected candidate atom pairs, determine whether the square of the distance between the two atoms is less than the square of the shorter cut-off radius, so as to construct a short-range adjacency list; Initialize the boolean variable to 1, and perform sorting and judgment according to the atom labels and coordinate positions, so as to construct a long-range adjacency list.
[0011] Furthermore, the specific steps for pre-constructing a bond order network according to the connectivity information between atoms in the adjacency list are as follows: Traverse the local atoms owned by the current process and initialize the bond order network structure of the atoms; Limit the search and collect adjacent atom information according to the short-range adjacency list; Construct a bond order network structure according to the atom and adjacent atom information.
[0012] Furthermore, the bond order network structure includes reserved storage spaces for storing the connection strength between atoms, the number of paths, and related parameters.
[0013] Further, the specific steps for calculating the FLJ function by using the pre-constructed bond order network are as follows: Traverse the atom pairs and perform effective link queries by using the pre-constructed bond order network; Judge the calculation attributes of the atom pairs according to the path conditions.
[0014] Further, the specific steps for classifying and grouping according to different types of interactions between atoms are as follows: Determine the interaction type according to the type identifier of the atom pair; Construct different lists according to the interaction types respectively, and perform list accumulation according to the classification and grouping results of the atom pairs, and perform batch calculation of the lists according to the set threshold.
[0015] Furthermore, different types of interactions between atoms include three types: (C-C), (C-H), and (H-H).
[0016] Furthermore, the specific steps for performing batch calculation according to the classification and grouping results are as follows: Call the vectorized FREBO for batch calculation of the kernel function in a parallel processing manner for the list that has reached the threshold; After all atom pairs have been traversed, perform vectorized calculation on the remaining tail data that is less than BLKSIZE separately.
[0017] The second aspect of the present invention provides an AIREBO potential optimization system applicable to a multi-core processor, including: An adjacency list construction module, configured to obtain atom information and construct a hierarchical adjacency list according to the cut-off radius characteristics of the AIREBO potential and the atom information; A pre-computed bond order network module, configured to pre-construct a bond order network according to the connectivity information between atoms in the adjacency list, and utilize the pre-constructed bond order network when calculating the FLJ function; A classification and grouping multi-core processing module, configured to classify and group according to different types of interactions between atoms, and perform batch calculation of the FREBO function according to the classification and grouping results. Among them, the calculation tasks are split, and each split task is processed by a multi-core processor; An integrated calculation module, configured to integrate the calculation results of the FLJ function and the FREBO function, and combine the calculation results of the FTORSION function to obtain the final AIREBO potential.
[0018] The above one or more technical solutions have the following beneficial effects: The present invention discloses an AIREBO potential optimization method and system applicable to a multi-core processor. Based on the multi-core processor architecture, it realizes the efficient parallel calculation of the AIREBO potential by optimizing the adjacency list construction, pre-computing the bond order network, and classifying and grouping to optimize batch calculation. It can significantly improve the parallel efficiency and calculation performance of the AIREBO potential calculation, reduce calculation redundancy and communication overhead, make the molecular dynamics simulation more efficient under the multi-core processor architecture, and greatly improve the calculation ability of large-scale simulation of carbon-based materials.
[0019] The present invention uses an optimization strategy of multi-cutoff radius judgment and hierarchical adjacency list structure to divide neighbor atoms into short-range and long-range categories for separate storage. It not only improves the data access efficiency but also reduces unnecessary conditional judgments and branches in subsequent calculations, greatly improving the efficiency of the adjacency list construction stage. At the same time, it explicitly processes the different logics of local and ghost atoms, further ensuring the accuracy and uniqueness of atom pairs in the subsequent force calculation process, effectively narrowing the set of atoms involved in the force field calculation, and laying a foundation for the improvement of the overall parallel efficiency.
[0020] The present invention adopts the method of pre-computing the bond order network to establish the connectivity information between atoms in advance, avoiding redundant path search operations in each iteration. It not only significantly reduces the calculation time but also provides a good data basis for subsequent vectorization processing. During the calculation process, it directly queries using the pre-constructed bond order network structure to quickly judge whether there is an effective connection path between atoms and decide whether to participate in the calculation of the interaction force accordingly. This optimization effectively avoids the redundant operations of real-time recursive path search in the original implementation, and significantly reduces the time complexity and improves the calculation efficiency in simulation scenarios with a large system structure or a large number of iteration steps.
[0021] The present invention proposes a classification and grouping processing strategy, which combines batch vectorization calculation and optimizes different types of interactions between atoms (C-C, C-H, H-H). By storing different types of atom pairs into corresponding lists respectively and triggering batch vectorization calculation when the counter reaches the preset vector length threshold, unnecessary calculations and gather operations in vector instructions are reduced. At the same time, vectorization optimization is also performed on the bondorder function. A multi-atom parallel neighbor traversal mechanism is adopted to dynamically construct a mask vector to shield invalid calculation branches, effectively avoiding unnecessary floating-point calculations and memory access operations, and further improving the vectorization efficiency and overall calculation performance.
[0022] Advantages of additional aspects of the present invention will be partly given in the following description, partly become obvious from the following description, or be understood through the practice of the present invention. Brief Description of the Drawings
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0024] Figure 1 It is a schematic diagram of the distribution of ghost atoms and local atoms in the process in the first embodiment of the present invention; Figure 2 It is a flowchart of the functions and neighbor classification storage of local atoms and ghost atoms in the construction of a multi-cutoff radius adjacency list in the first embodiment of the present invention; Figure 3 It is a flow comparison diagram of the pre-computed bond order network in the FLJ function in the first embodiment of the present invention; Figure 4 It is a schematic diagram of the classification and processing of atom pair interactions in the FREBO function in the first embodiment of the present invention; Figure 5 It is a schematic diagram of the overall calculation performance of the AIREBO potential with a scale of 2.089M before and after optimization in the first embodiment of the present invention; Figure 6 It is a schematic diagram of the weak scalability of the AIREBO potential with different scales after optimization in the first embodiment of the present invention; Figure 7 It is a schematic diagram of the strong scalability of the AIREBO potential with different scales after optimization in the first embodiment of the present invention. Detailed Embodiments
[0025] It should be noted that the following detailed description is exemplary and is 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 of ordinary skill in the technical field to which the present invention belongs.
[0026] 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 also intended to include the plural form. In addition, 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; The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the scope of protection of the present application.
[0027] Embodiment 1: Embodiment 1 of the present invention provides an AIREBO potential optimization method applicable to a multi-core processor. The AIREBO potential is composed of an FLJ function, a FREBO function, and an FTORSION function. That is: AIREBO potential = FLJ + FREBO + FTORSION.
[0028] The FLJ function, the FREBO function, and the FTORSION function are respectively part of the AIREBO potential. The calculation significance of the FLJ function is to handle the van der Waals force between non-bonded atom pairs and is a part of the AIREBO potential used to supplement the deficiency of the short-range REBO bonding potential. Since the calculation time of the FTORSION function accounts for a relatively low proportion, in this embodiment, only the calculation processes of the FLJ function and the FREBO function are optimized, and the original method is used for the calculation of the FTORSION function, so as to improve the overall calculation efficiency of the AIREBO potential. In this embodiment, for the FLJ function, a pre-constructed bond order network is used, which can reduce a lot of redundant calculations and thus improve the efficiency. For the FREBO function, after classification, the vector utilization rate can be improved, and at the same time, the variables are converted into constants to improve the efficiency. The optimization of the FLJ function focuses on eliminating redundant calculations, and the optimization of the FREBO function focuses on structure grouping and vector efficiency, jointly improving the overall simulation performance and parallel scalability of the AIREBO potential.
[0029] Specifically, it includes the following steps: Step 1: Obtain atomic information and construct a hierarchical adjacency list according to the truncation radius characteristics of the AIREBO potential and the atomic information.
[0030] To improve the calculation efficiency of the AIREBO force field, the adjacency list construction part adopts an optimization strategy of multi-truncation radius judgment and hierarchical adjacency list structure, and explicitly processes the different logics of local and ghost atoms. Among them, local atoms refer to the atoms directly owned by the current MPI process and responsible for updating positions and calculating interactions; ghost atoms are read-only copies from adjacent processes for boundary interaction calculations, participating in the transfer of forces but not storing the final results. Figure 1 Shows the distribution of ghost atoms and local atoms in multiple processes. As Figure 2 shown, the specific process is as follows: Step 1.1: Record the atomic information collected and create an index.
[0031] In a specific implementation, initialize the atomic information. Collect the coordinates (x, y, z), types (used to determine interaction parameters), and global unique tags (tags) of all atoms from the system. Create a complete atomic index glist, including all local and ghost atoms locally, and record the start and end positions of atoms in each spatial grid. For local atoms, record their index as ilist, which is specifically used for traversal later.
[0032] Step 1.2: Traverse the neighborhood grid list of each atom to obtain all atom pairs, and filter the atom pairs according to the truncation radius characteristics.
[0033] Step 1.2.1: For each local atom i, calculate the grid number ibin where it is located according to the coordinates of atom i, and use the predefined nstencil structure to obtain its neighborhood grid list. Traverse all atoms j in these grids. Atoms j include local and ghost atoms, forming atom pairs (i, j). Among them, the nstencil structure is a preset template for the neighborhood grid list, which is convenient for direct call during neighbor search.
[0034] Step 1.2.2: For each atom pair (i, j), calculate the square of the distance rsq between the two atoms, and compare it with the square of the maximum neighbor truncation radius cutneighsq[itype][jtype]. Among them, the square of the maximum neighbor truncation radius is determined by the types of atoms i and j. Specifically, it is determined according to the square of the preset maximum interaction truncation distance in the force field parameters corresponding to the two atom types. If rsq is greater than cutneighsq[itype][jtype], it means that atom j is outside the neighbor range, and this atom pair is directly skipped. The filtered atom pairs are used as candidate atom pairs.
[0035] Step 1.3: Construct a short-range adjacency list and a long-range adjacency list respectively according to the screening results.
[0036] Step 1.3.1: For the candidate atom pairs screened by Step 1.2, judge whether rsq is less than the square of the shorter cut-off radius rcmax_skin, so as to construct a short-range adjacency list. Specifically, if the condition is satisfied, add the index of atom j to the short-range adjacency list bufptr for subsequent short-range interaction calculations, that is, the subsequent FREBO function and FTORSION function (although the FTORSION function is not specially optimized in this embodiment, by adopting the short-range adjacency list method, its calculation efficiency is improved to a certain extent). Among them, the square of the shorter cut-off radius is based on the cut-off radius between all atom types plus the buffer distance (skin), and a smaller value that can ensure the complete coverage of short-range interactions is selected as the threshold, that is, the square of the shorter cut-off radius, for efficiently constructing the short-range adjacency list.
[0037] Step 1.3.2: Initialize the boolean variable jflag to 1, and perform sorting judgment according to the atom tags tag[i] and tag[j] and the coordinate positions to ensure the uniqueness of the atom pairs, so as to construct a long-range adjacency list. Specifically, if jflag is set to 0 subsequently, skip the subsequent steps. If jflag is 1, add the index of atom j to the long-range adjacency list neighptr for long-range interaction calculations, that is, the subsequent calculation of the FLJ function. Among them, the boolean variable is a data type with only two values, usually representing "true" (1 or true) or "false" (0 or false). Here, jflag is used as a flag bit to judge and ensure that each pair of atoms (i, j) appears only once in the long-range adjacency list, avoiding repeated calculations.
[0038] According to the cut-off radius characteristics of the AIREBO potential, optimize the construction of the adjacency list, store the neighbor atoms in two categories: short-range and long-range, respectively, to improve the data access efficiency. Set pre-screening conditions in the adjacency list construction stage to reduce unnecessary conditional judgments and branches in subsequent calculations and improve the calculation speed. After this operation, the efficiency of the adjacency list construction stage can be improved, and the accuracy and uniqueness of atom pairs in the subsequent force calculation process can be guaranteed. Especially in complex potential functions such as AIREBO, it can effectively reduce the set of atoms involved in the force field calculation and improve the overall parallel efficiency.
[0039] Step 2: Pre-construct a bond order network according to the connectivity information between atoms in the adjacency list, and utilize the pre-constructed bond order network when calculating the FLJ function.
[0040] In the AIREBO potential function, the FLJ function is a key component used to describe the interaction between atoms. Specifically, the FLJ function in the AIREBO potential function is used to adjust the interaction strength between atoms, especially when dealing with long-range interactions (such as van der Waals forces). The FLJ (switching function) combines van der Waals interaction modeling with a switching function mechanism to smoothly adjust the interaction strength between non-bonded atom pairs within a specific distance range.
[0041] In the context of the AIREBO potential function, the specific form and role of the FLJ function are as follows: The FLJ function is used to adjust the contribution of the Lennard-Jones (LJ) term. The LJ term is used to describe the van der Waals forces between atoms, and the FLJ function ensures that this interaction only takes effect within an appropriate distance range.
[0042] The specific form of the FLJ function may vary depending on the specific implementation, but its core role is to smoothly adjust the contribution of the LJ term to avoid conflicts with covalent bond interactions at short-range distances.
[0043] In this embodiment, the network relationship of the bond order in the FLJ function is pre-computed. By establishing the atomic connectivity information in advance before the force field calculation, redundant path search operations in each iteration are avoided, significantly reducing the calculation time and laying a data foundation for subsequent vectorization processing. The specific steps are as follows: Step 2.1: Pre-construct the bond order network according to the atomic connectivity information in the adjacency list.
[0044] Step 2.1.1: Traverse the local atoms owned by the current process and initialize the bond order network structure of the atoms.
[0045] In a specific implementation, after completing the construction of the short-range adjacency list, each local atom i owned by the current process is traversed one by one to establish its corresponding bond order network structure. For each atom i, its bond order network structure is initialized. The bond order network structure includes reserved storage spaces for storing the connection strength between atoms, the number of paths, and related parameters to ensure the complete preservation and efficient access of subsequent information.
[0046] Step 2.1.2: Limit the search and collection of adjacent atom information according to the short-range adjacency list.
[0047] In a specific implementation, starting from atom i, all directly and indirectly connected atoms in its short-range adjacency list are traversed in sequence to systematically collect its network topology information.
[0048] It should be noted specifically that as Figure 3As shown, in the original algorithm, atom j is traversed first, then atoms that are two chemical bond connections away from atom i are searched, and it is determined whether j is connected to i, and then subsequent calculations are performed. When the original algorithm judges the connectivity of atom pairs, it often performs path search through an adjacency list, but does not effectively control the path depth and the access of intermediate atoms, and it is easy to have redundant calculations such as traversing multiple paths repeatedly or accessing the same intermediate atoms, resulting in a significant increase in the amount of calculation and a decrease in efficiency. In this embodiment, the search depth is limited to no more than three layers, that is, the number of intermediate atoms allowed to pass through the path is no more than two. During this period, the shortest path weight from atom i to each reachable atom j and the corresponding number of paths npath are recorded, and this information provides a key basis for judging the interaction between atoms. After searching for and storing atoms that are three chemical bond connections away from atom i, atom j is traversed, and it is further determined whether atom j belongs to the three-layer bonded neighbors of atom i, and then subsequent calculations are performed. In contrast, in this embodiment, by limiting the search depth to no more than three layers and recording the shortest path weight and the number of paths in real time during the traversal process, repeated access and redundant calculations are effectively avoided, and the calculation efficiency and memory utilization rate are improved.
[0049] Step 2.1.3: Construct a bond order network structure according to the atom and adjacent atom information.
[0050] In a specific implementation manner, the connection information between atom i and all atoms j that meet the path conditions is stored in the bond order network structure corresponding to i, including path coefficients, connection labels, etc.
[0051] Step 2.2: Utilize the pre-constructed bond order network when calculating the FLJ function.
[0052] Step 2.2.1: Traverse atom pairs and perform effective link query using the pre-constructed bond order network.
[0053] In a specific implementation manner, during the calculation process of executing the FLJ function, when traversing atom pairs (i, j), instead of using the original real-time path search operation, the pre-constructed bond order network structure is directly used for query. By querying the bond order network structure of atom i, it is determined whether there is an effective connection path for atom j, and then it is decided whether to participate in subsequent interaction force calculations.
[0054] Step 2.2.2: Judge the calculation attributes of atom pairs according to the path conditions.
[0055] In a specific implementation manner, if the query result shows that there is a connection path, the pre-stored path parameters are directly extracted, including connection weight w, path length npath, etc., to determine whether to apply van der Waals interaction; When the path meets the LJ exclusion condition, the value of the corresponding interaction function is set to zero, indicating that this atom pair does not participate in the calculation of the LJ interaction, so as to avoid calculation redundancy.
[0056] Otherwise, retain this atom pair for subsequent calculation of the LJ force, and the coefficients (such as cij) extracted from the path information will participate in the calculation as the interaction strength factor.
[0057] In this embodiment, by pre-computing the bond order network information, the redundant operation of real-time recursive search for paths for each atom pair in the original AIREBO implementation is effectively avoided, and the time complexity can be significantly reduced especially in simulation scenarios with a larger system structure or a larger number of iteration steps.
[0058] Step 3: Classify and group according to different types of interactions between atoms, and perform batch calculation of the FREBO function according to the classification and grouping results.
[0059] In this embodiment, the atom pair interactions of the FREBO function are classified and batch-processed by type to optimize the vectorized calculation performance. And based on the multi-core processor architecture, the calculation tasks are split, the calculation tasks are reasonably split and distributed to each core, and the multi-core processor is used to process each split task to ensure load balancing and efficient parallel execution. The specific steps are as follows: Step 3.1: Classify and group according to different types of interactions between atoms.
[0060] Step 3.1.1: Determine the interaction type according to the type identifier of the atom pair.
[0061] In a specific implementation manner, traverse the local atoms i owned by the current process, and visit and process each neighbor atom j included in the REBO (Reactive Empirical Bond Order) short-range adjacency list of atom i one by one. According to the type identifiers (type[i] and type[j]) of atom i and atom j, determine the interaction type formed by the atom pair (i, j). Different types of interactions between atoms include three categories: (C-C), (C-H), and (H-H).
[0062] Step 3.1.2: Construct different lists according to the interaction types respectively, and perform list accumulation according to the classification and grouping results of the atom pairs, and perform batch calculation of the lists according to the set threshold.
[0063] In a specific implementation, store atom pairs of the C-H type into the CH_list list, store atom pairs of the C-C type into the CC_list, and store atom pairs of the H-H type into the HH_list. Maintain independent counter variables for each type of atom pair list: CH_count, CC_count, and HH_count. When the value of any counter reaches the preset vector length threshold BLKSIZE (i.e., the maximum capacity for batch vector processing), immediately trigger the batch vectorization calculation process for the corresponding type of atom pair. After completing the current batch calculation, promptly empty the corresponding list and its count.
[0064] Step 3.2: Perform batch calculations based on the classification grouping results.
[0065] Step 3.2.1: For the list that has accumulated to the threshold, call the vectorized FREBO (Force from REBO potential, REBO bonding force term) to batch calculate the kernel function in a parallel processing manner; In a specific implementation, for each list of accumulated atom pair types, call the specially designed vectorized FREBO calculation kernel function (FREBO_calc), and for each type of atom pair, batch process multiple atom pairs in parallel in the corresponding adjacency information.
[0066] It should be noted specifically that during the execution process, try to convert the data items that need to be gathered into constant forms as much as possible to reduce the memory access overhead brought by the gather instruction.
[0067] Step 3.2.2: After all atom pairs have been traversed, separately call vectorized calculation for the remaining tail data that is less than BLKSIZE (block size) to ensure that all atom pairs are processed.
[0068] At the same time, corresponding vectorization optimizations are made for the bondorder function. Among them, the bondorder function is used to calculate the bond order between two atoms and is used to reflect the strength and multiplicity of the chemical bond between atoms.
[0069] During the bondorder calculation process, adopt the mechanism of parallel neighbor traversal of multiple atoms i, that is, simultaneously traverse the adjacency lists of multiple atoms i in parallel to achieve a higher instruction concurrency; on this basis, by comparing the index value of the currently traversed neighbor atom k with the index value of the target atom j, dynamically construct a mask vector to mask invalid calculation branches. When the mask values of all adjacent atoms in the current vector register are False (i.e., there are no valid neighbor pairs participating in the calculation), call vectorized conditional judgment instructions such as svptest_any() to quickly skip the calculation process of the current vector segment and effectively avoid unnecessary floating-point calculations and memory access operations.
[0070] In this embodiment, to further improve the computational performance of the FREBO part in the AIREBO potential function, a classification and grouping processing strategy is adopted for different types of interactions between atoms (C-C, C-H, H-H). Combined with batch vectorization calculation, it effectively reduces unnecessary calculations and the gather operations in vector instructions, thereby improving the vectorization efficiency and overall computational performance.
[0071] To better illustrate the excellent effect of the method in this embodiment, the method in this embodiment is compared with the computational performance of the traditional AIREBO potential. As Figure 5 shown, the optimized method in this embodiment has an acceleration ratio of about 2 times compared with the original version. As Figure 6 shown, the optimized method in this embodiment shows good weak scalability at multiple computational scales, remaining above 70%, indicating that this optimization method has a significant effect in improving the parallel efficiency and has good scalability and practical value. As Figure 7 shown, the optimized method in this embodiment maintains a strong scalability of about 80% under multiple parallel core configurations, indicating that this optimization strategy has a significant effect in improving the parallel computing efficiency and has good load balancing and scalability.
[0072] Step 4: Combine the calculation results of the FLJ function and the FREBO function, and combine the calculation result of the FTORSION function to obtain the final AIREBO potential.
[0073] Embodiment 2: Embodiment 2 of the present invention provides an AIREBO potential optimization system applicable to a multi-core processor, including: An adjacency list construction module, configured to obtain atomic information and construct a hierarchical adjacency list according to the truncation radius characteristics of the AIREBO potential and the atomic information; A pre-computed bond order network module, configured to pre-construct a bond order network according to the connectivity information between atoms in the adjacency list and utilize the pre-constructed bond order network when calculating the FLJ function; A classification and grouping multi-core processing module, configured to classify and group according to different types of interactions between atoms and perform batch calculation of the FREBO function according to the classification and grouping results. Among them, the calculation tasks are split, and each split task is processed by a multi-core processor; A comprehensive calculation module, configured to combine the calculation results of the FLJ function and the FREBO function, and combine the calculation result of the FTORSION function to obtain the final AIREBO potential.
[0074] Each step involved in Embodiment 2 above corresponds to that in Method Embodiment 1, and the specific implementation manner can refer to the relevant description part of Embodiment 1.
[0075] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application. In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of this application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access or a data processing device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc. The above description is only a specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any technician familiar with the technical field of this application can easily think of changes or substitutions within the technical scope disclosed in this application, and all should be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims
1. An AIREBO potential optimization method applicable to multi-core processors, characterized in that, It includes the following steps: Obtain atomic information, and construct a hierarchical adjacency list according to the cut-off radius characteristics of the AIREBO potential and the atomic information; Pre-construct a bond order network according to the connectivity information between atoms in the adjacency list, and utilize the pre-constructed bond order network when calculating the FLJ function; Classify and group according to different types of interactions between atoms, and batch-calculate the FREBO function according to the classification and grouping results. Among them, split the calculation tasks and utilize a multi-core processor to process each split task; Integrate the calculation results of the FLJ function and the FREBO function, and combine with the calculation result of the FTORSION function to obtain the final AIREBO potential.
2. The AIREBO potential optimization method applicable to a multi-core processor according to claim 1, characterized in that, The specific steps for constructing a hierarchical adjacency list according to the cut-off radius characteristics of the AIREBO potential and the atomic information are as follows: Record the atomic information collected and create an index; Traverse the neighborhood grid list of each atom to obtain all atom pairs, and screen the atom pairs according to the cut-off radius characteristics; Construct a short-range adjacency list and a long-range adjacency list respectively according to the screening results.
3. The AIREBO potential optimization method applicable to a multi-core processor according to claim 2, characterized in that, The specific steps for screening atom pairs according to the cut-off radius characteristics are as follows: For each pair of atom pairs, calculate the square of the distance between the two atoms, and compare it with the square of the maximum neighbor cut-off radius to obtain candidate atom pairs; For the screened candidate atom pairs, judge whether the square of the distance between the two atoms is less than the square of the shorter cut-off radius, so as to construct a short-range adjacency list; Initialize the Boolean variable to 1, and perform sorting and judgment according to the atomic label and coordinate position, so as to construct a long-range adjacency list.
4. The AIREBO potential optimization method applicable to a multi-core processor according to claim 2, characterized in that The specific steps for pre-constructing a bond order network according to the connectivity information between atoms in the adjacency list are as follows: Traverse the local atoms owned by the current process and initialize the bond order network structure of the atoms; Limit the search and collect the adjacency atom information according to the short-range adjacency list; Construct a bond order network structure according to the atom and the adjacency atom information.
5. The AIREBO potential optimization method applicable to a multi-core processor according to claim 4, characterized in that, The bond order network structure includes reserved storage spaces for storing the connection strength, the number of paths, and related parameters between atoms.
6. The AIREBO potential optimization method applicable to a multi-core processor according to claim 1, wherein The specific steps for utilizing the pre-constructed bond order network when calculating the FLJ function are as follows: Traverse the atom pairs and perform an effective link query by using the pre-constructed bond order network; Judge the calculation attributes of the atom pairs according to the path conditions.
7. The AIREBO potential optimization method applicable to a multi-core processor according to claim 1, characterized in that The specific steps for classifying and grouping according to different types of interactions between atoms are as follows: Determine the interaction type according to the type identifier of the atom pair; Construct different lists respectively according to the interaction type, and perform list accumulation according to the classification and grouping results of the atom pairs, and perform batch calculation of the lists according to the set threshold.
8. The AIREBO potential optimization method applicable to a multi-core processor according to claim 7, characterized in that, The different types of interactions between atoms include three types: C-C, C-H, and H-H.
9. The AIREBO potential optimization method applicable to a multi-core processor according to claim 7, wherein, The specific steps for batch calculation according to the classification and grouping results are as follows: Call the vectorized FREBO for batch calculation of the kernel function in a parallel processing manner for the list that has accumulated to the threshold; After all atom pairs are traversed, separately call vectorized calculation for the remaining tail data that is less than BLKSIZE.
10. An AIREBO potential optimization system applicable to multi-core processors, characterized in that, It includes: An adjacency list construction module, configured to obtain atomic information and construct a hierarchical adjacency list according to the cut-off radius characteristics of the AIREBO potential and the atomic information; The pre-computed bond order network module is configured to pre-construct a bond order network based on the connectivity information between atoms in the adjacency list, and utilize the pre-constructed bond order network when calculating the FLJ function; The classification and grouping multi-core processing module is configured to classify and group according to different types of interactions between atoms, and perform batch calculation of the FREBO function based on the classification and grouping results. Among them, the calculation tasks are split, and a multi-core processor is used to process each split task; The comprehensive calculation module is configured to comprehensively calculate the results of the FLJ function and the FREBO function, and combine the calculation results of the FTORSION function to obtain the final AIREBO potential.
Citation Information
Patent Citations
A parallel molecular dynamics simulation method and system
CN109885917A
Molecular dynamics simulation short range force parallel optimization method on super-computer platform
CN111429974A
Molecular dynamics simulation acting force analysis method and device and computer equipment
CN118692576A
Molecular dynamics simulation parallel computing method of TIP4P water model
CN118862602A
Cited By
Molecular dynamics simulation method and system for many-core architecture processor
CN121306292A
A method and system for molecular dynamics simulation for many-core architecture processor
CN121306292B
Molecular dynamics rapid simulation method and system for lithium-silicon alloy
CN122369625A