AIREBO potential optimization method and system suitable for multi-core processors
By constructing a hierarchical adjacency table, pre-calculated key sequence network and classifying and grouping optimization batch calculation on a multi-core processor, the problem of low load load and parallel efficiency of AIREBO potential calculation on a multi-core processor is solved, and efficient parallel calculation of AIREBO potential is achieved, improving the overall performance of molecular dynamics simulation.
Patent Information
- Application Number
- CN202510854705.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-06-25
AI Technical Summary
The existing AIREBO potential calculation load weight on multi-core processors and the parallel efficiency is low. The adjacency table structure and multi-body potential function calculation bottlenecks are not fully optimized, making it difficult to effectively utilize the cache structure and thread scheduling mechanism of multi-core processors.
By constructing hierarchical adjacency tables, pre-computed key-sequence networks and classifying grouping optimization batch calculations, the parallel computing efficiency of AIREBO potential is improved, and a multi-core processor architecture is used for efficient calculations, including multi-truncation radius judgment, hierarchical adjacency table structure, pre-computed key-sequence networks and classifying grouping processing strategies.
It significantly improves the parallel computing performance of AIREBO potential, reduces computational redundancy and communication overhead, improves the computing power of large-scale simulation of carbon-based materials, and improves the overall molecular dynamics simulation efficiency.
Smart Images

Figure CN120375941B_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 suitable for a multi-core 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] LAMMPS (Large-scale Atomic / Molecular Massively Parallel Simulator) is an open-source molecular dynamics simulation software for large-scale atomic / molecular systems. Designed for high-performance computing environments, it features excellent parallel scalability and a highly modular architecture. With support for a wide range of physical models and an extensible potential function library, LAMMPS is capable of simulating a wide range of complex materials, including metals, semiconductors, polymers, and biomolecules. It has become a key platform for 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 computational efficiency of conventional two-body potentials. However, the calculation of the AIREBO (Adaptive Intermolecular Reactive Empirical Bond Order) potential function, a complex multi-body interaction model, still faces significant challenges. Based on the REBO potential, the AIREBO potential further introduces van der Waals and torsion terms, requiring the simultaneous simulation of the multi-scale coupling process of short-range covalent bonds, long-range van der Waals forces, and four-body torsion. This potential function responds to changes in the local chemical environment 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 its computational intensity is much higher than that of traditional potential functions.
[0005] Furthermore, the significant difference in cutoff radius between the short-range reaction term and the long-range interaction term in the AIREBO potential complicates the construction and management of adjacency lists and increases communication and synchronization overhead. Furthermore, the numerous nested loops, conditional judgments, and data dependencies in force calculations make effective vectorization and thread parallelization difficult, further limiting parallel efficiency. Existing approaches to applying the AIREBO potential to multi-core processor architectures fail to fully utilize the cache structure, thread scheduling mechanism, and memory access characteristics of multi-core processors, leaving significant room for improvement in the overall parallel scalability and computational efficiency of these applications.
[0006] Therefore, in view of the defects of the existing AIREBO potential, such as the unreasonable construction of the adjacency table mechanism, the high computational intensity of network relationships, and the complex interaction relationships between atomic pairs, how to provide a method to improve the overall computational performance of molecular dynamics simulation has become a key technical problem that needs to be solved urgently in this field. Summary of the Invention
[0007] In view of the shortcomings of the existing technology, the purpose of the present invention is to provide an AIREBO potential optimization method and system suitable for multi-core processors, which realizes efficient parallel calculation of AIREBO potential based on the multi-core processor architecture, and solves the technical problems of heavy AIREBO potential calculation load, low parallel efficiency, adjacency list construction and multi-body potential function calculation bottlenecks in existing molecular dynamics simulation software, aiming to improve the overall molecular dynamics simulation efficiency.
[0008] In order to achieve the above object, the present invention is implemented through the following technical solutions:
[0009] A first aspect of the present invention provides an AIREBO potential optimization method applicable to a multi-core processor, comprising the following steps:
[0010] Obtain atomic information and construct a hierarchical adjacency list based on the cutoff radius characteristics of the AIREBO potential and the atomic information;
[0011] A bond order network is pre-constructed based on the connectivity information between atoms in the adjacency table, and the pre-constructed bond order network is used when calculating the FLJ function;
[0012] Classify and group different types of interactions between atoms, and perform batch calculations of FREBO functions based on the classification and grouping results. The computational tasks are split and processed using multi-core processors.
[0013] The final AIREBO potential is obtained by combining the calculation results of the FLJ function and the FREBO function with the calculation results of the FTORSION function.
[0014] Furthermore, the specific steps for constructing a hierarchical adjacency list based on the cutoff radius characteristics of the AIREBO potential and atomic information are as follows:
[0015] Record and index the collected atomic information;
[0016] Traverse the neighborhood grid list of each atom to obtain all atom pairs, and screen the atom pairs according to the cutoff radius characteristics;
[0017] According to the screening results, short-range adjacency list and long-range adjacency list are constructed respectively.
[0018] Furthermore, the specific steps for screening atom pairs according to the cutoff radius characteristics are as follows:
[0019] For each atom pair, the square of the distance between the two atoms is calculated and compared with the square of the maximum neighbor cutoff radius to obtain the candidate atom pair;
[0020] 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 cutoff radius, thereby constructing a short-range adjacency list;
[0021] Initialize the Boolean variable to 1, and perform sorting and judgment based on the atomic labels and coordinate positions to construct a long-range adjacency list.
[0022] Furthermore, the specific steps for pre-constructing the bond order network based on the connectivity information between atoms in the adjacency table are as follows:
[0023] Traverse the local atoms owned by the current process and initialize the bond order network structure of the atoms;
[0024] Limit the search and collect neighboring atom information based on the short-range adjacency table;
[0025] The bond order network structure is constructed based on the information of atoms and adjacent atoms.
[0026] Furthermore, the bond order network structure includes a reserved storage space for storing the interatomic connection strength, the number of paths and related parameters.
[0027] Furthermore, the specific steps for calculating the FLJ function using the pre-built bond order network are as follows:
[0028] Traverse atom pairs and use the pre-built bond order network to perform valid link queries;
[0029] Determine the computational properties of the atom pair based on the path conditions.
[0030] Furthermore, the specific steps for classifying and grouping different types of interactions between atoms are as follows:
[0031] Determine the interaction type based on the type identification of the atom pair;
[0032] Different lists are constructed according to the interaction type, and the lists are accumulated according to the classification and grouping results of the atomic pairs, and batch calculations of the lists are performed according to the set threshold.
[0033] Furthermore, different types of interactions between atoms include (CC), (CH) and (HH).
[0034] Furthermore, the specific steps for batch calculation based on the classification and grouping results are as follows:
[0035] Call vectorized FREBO on the list that reaches the cumulative threshold and use parallel processing to batch calculate the kernel function;
[0036] After all atom pairs are traversed, vectorized calculation is called separately for the remaining tail data that is less than BLKSIZE.
[0037] A second aspect of the present invention provides an AIREBO potential optimization system applicable to a multi-core processor, comprising:
[0038] an adjacency list construction module, configured to obtain atomic information and construct a hierarchical adjacency list according to the cutoff radius characteristics of the AIREBO potential and the atomic information;
[0039] A pre-calculated bond order network module is configured to pre-build a bond order network based on connectivity information between atoms in an adjacency table, and utilize the pre-built bond order network when calculating the FLJ function;
[0040] A classification and grouping multi-core processing module is configured to classify and group different types of interactions between atoms, and perform batch calculations of FREBO functions based on the classification and grouping results, wherein the computational tasks are split and each split task is processed using a multi-core processor;
[0041] The comprehensive calculation module is configured to integrate the calculation results of the FLJ function and the FREBO function, and combine them with the calculation results of the FTORSION function to obtain the final AIREBO potential.
[0042] One or more of the above technical solutions have the following beneficial effects:
[0043] The present invention discloses an AIREBO potential optimization method and system suitable for multi-core processors. Based on the multi-core processor architecture, efficient parallel calculation of AIREBO potential is achieved by optimizing the adjacency list construction, pre-calculating the bond order network, and optimizing batch calculation by classification and grouping. This method can significantly improve the parallel efficiency and computing performance of AIREBO potential calculation, reduce computing redundancy and communication overhead, make molecular dynamics simulation more efficient under the multi-core processor architecture, and greatly enhance the computing power of large-scale simulation of carbon-based materials.
[0044] This paper uses an optimization strategy based on multiple cutoff radius judgments and a hierarchical adjacency list structure to store neighbor atoms separately, namely short-range and long-range. This not only improves data access efficiency but also reduces unnecessary conditional judgments and branches in subsequent calculations, significantly increasing the efficiency of the adjacency list construction phase. Furthermore, the different logics of local and ghost atoms are explicitly handled, further ensuring the accuracy and uniqueness of atom pairs in subsequent force calculations. This effectively reduces the set of atoms involved in force field calculations and lays the foundation for improving overall parallel efficiency.
[0045] The present invention adopts a method of pre-calculating the bond order network to establish the connectivity information between atoms in advance, avoiding redundant path search operations in each round of iteration. This not only significantly reduces the calculation time, but also provides a good data foundation for subsequent vectorized processing. During the calculation process, the pre-built bond order network structure is directly used for querying, quickly determining whether there is a valid connection path between atoms, and based on this, deciding whether to participate in the interaction force calculation. This optimization effectively avoids the redundant operations of the real-time recursive search path in the original implementation, and greatly reduces the time complexity and improves the computational efficiency in simulation scenarios with larger architectures or more iteration steps.
[0046] This paper proposes a classification and grouping processing strategy, combined with batch vectorized computation, to optimize different types of interatomic interactions (CC, CH, and HH). By storing different types of atom pairs in corresponding lists and triggering batch vectorized computation when a counter reaches a preset vector length threshold, this reduces unnecessary computations and gather operations in vector instructions. Furthermore, vectorized optimizations have been implemented for the bondorder function, using a multi-atom parallel neighbor traversal mechanism and dynamically constructing mask vectors to shield invalid computation branches. This effectively avoids unnecessary floating-point calculations and memory accesses, further improving vectorization efficiency and overall computational performance.
[0047] 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
[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0049] Figure 1 Schematic diagram of the distribution of ghost atoms and local atoms in a process in the first embodiment of the present invention;
[0050] Figure 2 This is a flowchart of the role of local atoms and ghost atoms in the construction of a multi-cutoff radius adjacency list and the neighbor classification storage in the first embodiment of the present invention;
[0051] Figure 3 This is a comparison diagram of the process of pre-calculating the bond sequence network in the FLJ function in Example 1 of the present invention;
[0052] Figure 4Schematic diagram of the classification processing of atom pair interactions in the FREBO function in Example 1 of the present invention;
[0053] Figure 5 Schematic diagram of the overall performance of AIREBO potential 2.089M calculation before and after optimization in Example 1 of the present invention;
[0054] Figure 6 Schematic diagram of weak scalability of AIREBO potential at different scales after optimization in Example 1 of the present invention;
[0055] Figure 7 Schematic diagram of the strong scalability of the optimized AIREBO potential at different scales in the first embodiment of the present invention. DETAILED DESCRIPTION
[0056] It should be noted that the following detailed descriptions are exemplary 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.
[0057] 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 their combinations;
[0058] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0059] Example 1:
[0060] The first embodiment of the present invention provides an AIREBO potential optimization method applicable to multi-core processors. The AIREBO potential is composed of the FLJ function, the FREBO function, and the FTORSION function. That is:
[0061] AIREBO potential=FLJ+FREBO+FTORSION.
[0062] The FLJ function, FREBO function, and FTORSION function are each part of the AIREBO potential. The computational significance of the FLJ function lies in processing the van der Waals forces between non-bonded atomic pairs. It is a part of the AIREBO potential used to supplement the insufficient short-range REBO bonding potential. Since the calculation time of the FTORSION function accounts for a relatively low proportion, this embodiment only chooses to optimize the calculation process of the FLJ function and the FREBO function, and uses the original method to calculate the FTORSION function, thereby achieving an improvement in the overall computational efficiency of the AIREBO potential. In this embodiment, for the FLJ function, a pre-built bond order network is used to reduce a lot of redundant calculations and thus improve efficiency. For the FREBO function, after classification, the vector utilization rate can be improved, and the variables can be converted into constants to improve efficiency. The optimization of the FLJ function focuses on eliminating redundant calculations, and the optimization of the FREBO function focuses on structural grouping and vector efficiency, which together improve the overall simulation performance and parallel scalability of the AIREBO potential.
[0063] The specific steps include:
[0064] Step 1: Obtain atomic information and construct a hierarchical adjacency list based on the cutoff radius characteristics of the AIREBO potential and the atomic information.
[0065] To improve the efficiency of AIREBO force field calculations, the adjacency list construction part adopts an optimization strategy of multiple cutoff radius judgment and hierarchical adjacency list structure, and explicitly handles the different logics of local and ghost atoms. Among them, local atoms refer to atoms that are directly owned by the current MPI process and are responsible for updating positions and calculating interactions; ghost atoms are read-only copies from adjacent processes used for boundary interaction calculations. They participate in force transmission but do not store the final results. Figure 1 This shows the distribution of ghost atoms and local atoms in multiple processes. Figure 2 The specific process is as follows:
[0066] Step 1.1: Record and index the collected atomic information.
[0067] In one specific embodiment, atomic information is initialized. The coordinates (x, y, z), types (used to determine interaction parameters), and globally unique tags (tags) of all atoms in the system are collected. A complete atomic index (glist) is created, including all local and ghost atoms, and the start and end positions of atoms in each spatial grid are recorded. For local atoms, their indices are recorded as ilist, which is used for subsequent traversal.
[0068] Step 1.2: Traverse the neighborhood grid list of each atom to obtain all atom pairs, and screen the atom pairs according to the cutoff radius characteristics.
[0069] Step 1.2.1: For each local atom i, calculate its grid cell number ibin based on its coordinates, and use the predefined nstencil structure to obtain its neighboring grid cell list. Iterate over all atoms j in these grid cells, including local and ghost atoms, to form an atom pair (i, j). The nstencil structure is a preset template for the neighborhood grid cell list, which is convenient for direct use during neighbor search.
[0070] Step 1.2.2: For each atom pair (i, j), calculate the square of the distance between the two atoms, rsq, and compare it with the square of the maximum neighbor cutoff radius, cutneighsq[itype][jtype]. The square of the maximum neighbor cutoff radius is determined by the types of atoms i and j. Specifically, it is determined by the square of the maximum interaction cutoff distance preset 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 out of the neighborhood range. The atom pair is skipped directly and the selected atom pair is used as a candidate atom pair.
[0071] Step 1.3: Construct the short-range adjacency list and long-range adjacency list respectively according to the screening results.
[0072] Step 1.3.1: For candidate atom pairs selected through step 1.2, determine whether rsq is less than the shorter squared cutoff radius, rcmax_skin, to construct a short-range adjacency list. Specifically, if the condition is met, the index of atom j is added to the short-range adjacency list, bufptr, for subsequent short-range interaction calculations, namely, those performed by the FREBO and FTORSION functions (although the FTORSION function is not specifically optimized in this embodiment, its computational efficiency is improved to a certain extent by employing a short-range adjacency list). The shorter squared cutoff radius is a threshold value, selected to ensure complete coverage of short-range interactions, based on the cutoff radius between all atom types plus the buffer distance (skin), for efficient short-range adjacency list construction.
[0073] Step 1.3.2: Initialize the Boolean variable jflag to 1 and perform sorting based on the atomic labels tag[i] and tag[j] and their coordinate positions to ensure the uniqueness of the atom pairs, thereby constructing a long-range adjacency list. Specifically, if jflag is subsequently set to 0, the subsequent steps are skipped. If jflag is 1, the index of atom j is added to the long-range adjacency list neighptr for long-range interaction calculations, i.e., the subsequent calculation of the FLJ function. A Boolean variable is a data type with only two possible values, typically representing "true" (1 or true) or "false" (0 or false). Here, jflag is used as a flag to determine and ensure that each pair of atoms (i, j) appears only once in the long-range adjacency list, avoiding duplicate calculations.
[0074] Based on the cutoff radius characteristics of the AIREBO potential, the adjacency table is optimized, classifying neighbor atoms into short-range and long-range categories for separate storage, improving data access efficiency. Pre-screening conditions are set during the adjacency table construction phase to reduce unnecessary conditional checks and branching in subsequent calculations, thereby increasing computation speed. This improves the efficiency of the adjacency table construction phase and ensures the accuracy and uniqueness of atom pairs in subsequent force calculations. Especially for complex potential functions such as AIREBO, this effectively reduces the set of atoms involved in the force field calculation, improving overall parallel efficiency.
[0075] Step 2: Pre-construct a bond order network based on the connectivity information between atoms in the adjacency table, and use the pre-constructed bond order network when calculating the FLJ function.
[0076] The FLJ function is a key component in the AIREBO potential used to describe interatomic interactions. Specifically, it is used to adjust the strength of interatomic interactions within the AIREBO potential, particularly when dealing with long-range interactions such as van der Waals forces. The FLJ (switching function) combines van der Waals interaction modeling with the switching function mechanism to smoothly adjust the interaction strength between non-bonded atomic pairs within a specific distance range.
[0077] In the context of the AIREBO potential function, the specific form and role of the FLJ function are as follows:
[0078] The FLJ function is used to adjust the contribution of the Lennard-Jones (LJ) term. The LJ term describes the van der Waals forces between atoms, while the FLJ function ensures that these interactions only operate within an appropriate distance range.
[0079] 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 conflict with covalent interactions at short distances.
[0080] This example pre-calculates the network relationship of the bond order in the FLJ function. By establishing the inter-atomic connectivity information before the force field calculation, it avoids redundant path search operations in each iteration, significantly reduces the calculation time, and lays the data foundation for subsequent vectorization processing. The specific steps are as follows:
[0081] Step 2.1: Pre-construct a bond order network based on the connectivity information between atoms in the adjacency table.
[0082] Step 2.1.1: Traverse the local atoms owned by the current process and initialize the bond order network structure of the atoms.
[0083] In one specific embodiment, after the short-range adjacency table is constructed, each local atom i in the current process is traversed one by one to establish a corresponding bond-order network structure. For each atom i, its bond-order network structure is initialized. This structure includes reserved storage for interatomic connection strengths, path counts, and related parameters to ensure complete preservation and efficient access to subsequent information.
[0084] Step 2.1.2: Limit the search and collect neighboring atom information based on the short-range adjacency table.
[0085] In a specific embodiment, starting from atom i, all directly and indirectly connected atoms in its short-range adjacency table are traversed in sequence to systematically collect its network topology information.
[0086] It should be noted that if Figure 3 As shown, in the original algorithm, atom j is first traversed, then atoms with two layers of chemical bonds to atom i are searched, and whether j is connected to i is determined before subsequent calculations are performed. When determining the connectivity of atom pairs, the original algorithm often uses an adjacency table to search for paths, but does not effectively control the path depth and access to intermediate atoms. This can easily lead to redundant calculations such as repeatedly traversing multiple paths or accessing the same intermediate atoms, resulting in a significant increase in computational complexity and reduced efficiency. However, this embodiment limits the search depth to no more than three layers, that is, the number of intermediate atoms a path is allowed to pass through is no more than two. During this process, the shortest path weight from atom i to each reachable atom j and the corresponding path number npath are recorded. This information provides a key basis for determining interatomic interactions. After searching and storing atoms with three layers of chemical bonds to atom i, atom j is traversed again to further determine whether atom j is a three-layer bonded neighbor of atom i before subsequent calculations are performed. In contrast, this embodiment effectively avoids repeated access and redundant calculations by limiting the search depth to no more than three layers and recording the shortest path weight and path number in real time during the traversal process, thereby improving computational efficiency and memory utilization.
[0087] Step 2.1.3: Construct a bond order network structure based on the information of atoms and adjacent atoms.
[0088] In a specific implementation, the connection information between atom i and all atoms j that meet the path conditions is stored in the bond-ordered network structure corresponding to i, including the path coefficient, connection label, etc.
[0089] Step 2.2: Utilize the pre-built bond order network when calculating the FLJ function.
[0090] Step 2.2.1: Traverse the atom pairs and use the pre-built bond order network to perform valid link search.
[0091] In one specific implementation, when executing the FLJ function, the traditional real-time path search operation is not used when traversing the atom pair (i, j). Instead, the pre-built bond network structure is directly used for querying. By querying the bond network structure of atom i, it is determined whether there is a valid connection path for atom j, and thus whether it should participate in the subsequent interaction force calculation.
[0092] Step 2.2.2: Determine the computational properties of the atom pair based on the path conditions.
[0093] In a specific embodiment, if the query result shows that a connection path exists, pre-stored path parameters are directly extracted, including connection weight w, path length npath, etc., to determine whether to apply van der Waals interaction;
[0094] When the path meets the LJ exclusion condition, the value of the corresponding action function is set to zero, indicating that the atom pair does not participate in the calculation of the LJ action to avoid computational redundancy.
[0095] Otherwise, the atom pair is retained for subsequent LJ force calculations, and the coefficients extracted from the path information (such as cij) will be used as interaction strength factors in the calculations.
[0096] This embodiment effectively avoids the redundant operation of real-time recursive search path for each atom pair in the original AIREBO implementation by pre-calculating bond order network information, which can significantly reduce the time complexity, especially in simulation scenarios with larger architectures or more iteration steps.
[0097] Step 3: Classify and group different types of interactions between atoms, and perform batch calculations of the FREBO function based on the classification and grouping results.
[0098] This example batches the atomic pair interactions of the FREBO function by type to optimize vectorized computing performance. Furthermore, based on a multi-core processor architecture, the computing tasks are split and distributed to each core. The multi-core processor processes each split task, ensuring load balancing and efficient parallel execution. The specific steps are as follows:
[0099] Step 3.1: Classify and group the different types of interactions between atoms.
[0100] Step 3.1.1: Determine the interaction type based on the type identification of the atom pair.
[0101] In one specific implementation, the process iterates over all local atoms i owned by the current process, and then visits and processes each neighbor atom j in its REBO (Reactive Empirical Bond Order) short-range adjacency list. Based on the type identifiers (type[i] and type[j]) of atoms i and j, the interaction type between the pair (i, j) is determined. The different types of interactions between atoms include (CC), (CH), and (HH).
[0102] Step 3.1.2: Construct different lists according to the interaction type, accumulate the lists according to the classification and grouping results of the atom pairs, and perform batch calculations of the lists based on the set threshold.
[0103] In one specific implementation, CH-type atom pairs are stored in the CH_list list, CC-type atom pairs are stored in the CC_list list, and HH-type atom pairs are stored in the HH_list list. Separate counter variables are maintained 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 a batch of vector processing), the batch vectorization calculation process for the corresponding type of atom pair is immediately triggered. After the current batch calculation is completed, the corresponding list and its count are promptly cleared.
[0104] Step 3.2: Perform batch calculations based on the classification and grouping results.
[0105] Step 3.2.1: Call vectorized FREBO (Force from REBO potential, REBO bonding force term) on the list that reaches the cumulative threshold and use parallel processing to batch calculate the kernel function;
[0106] In a specific embodiment, for each accumulated list of atom pair types, a specially designed vectorized FREBO calculation kernel function (FREBO_calc) is called to batch-process multiple atom pairs in parallel in the corresponding adjacency information for each type of atom pair.
[0107] It should be noted that during the execution process, the data items that need to be gathered are converted into constant form as much as possible to reduce the memory access overhead caused by the gather instruction.
[0108] Step 3.2.2: After all atom pairs are traversed, call vectorized calculation separately for the remaining tail data that is less than BLKSIZE (block size) to ensure that all atom pairs are processed.
[0109] We also optimized the bondorder function for vectorization. The bondorder function is used to calculate the bond order between two atoms, reflecting the strength and multiplicity of chemical bonds between atoms.
[0110] During bondorder calculation, a multi-atom i parallel neighbor traversal mechanism is employed. This mechanism involves traversing the adjacency lists of multiple atoms i simultaneously, achieving more efficient instruction concurrency. Furthermore, a mask vector is dynamically constructed by comparing the index of the currently traversed neighbor atom k with the index of the target atom j, masking invalid computation branches. When the mask values for all neighboring atoms in the current vector register are False (i.e., no valid neighbor pairs are involved in the computation), vectorized conditional instructions such as svptest_any() are called to quickly skip the computation of the current vector segment, effectively avoiding unnecessary floating-point calculations and memory accesses.
[0111] To further improve the computational performance of the FREBO portion of the AIREBO potential function, this embodiment adopts a classification and grouping processing strategy for different types of interactions between atoms (CC, CH, HH). Combined with batch vectorized computing, this effectively reduces unnecessary calculations and gather operations in vector instructions, thereby improving vectorization efficiency and overall computing performance.
[0112] In order to better illustrate the excellent effect of the method of this embodiment, the method of this embodiment is compared with the traditional AIREBO potential calculation performance. Figure 5 As shown in Figure 2, the optimized method in this embodiment has a speedup ratio of about 2 times compared to the original version. Figure 6 As shown in Figure 2, the optimized method in this embodiment shows good weak scalability in multiple computing scales, which is maintained above 70%, indicating that the optimization method has a significant effect in improving parallel efficiency and has good scalability and practical value. Figure 7As shown, the optimized method of this embodiment maintains a strong scalability of about 80% under multiple parallel core configurations, indicating that the optimization strategy is effective in improving parallel computing efficiency and has good load balancing and scalability.
[0113] Step 4: Integrate the calculation results of the FLJ function and the FREBO function, and combine them with the calculation results of the FTORSION function to obtain the final AIREBO potential.
[0114] Example 2:
[0115] A second embodiment of the present invention provides an AIREBO potential optimization system applicable to a multi-core processor, including:
[0116] an adjacency list construction module, configured to obtain atomic information and construct a hierarchical adjacency list according to the cutoff radius characteristics of the AIREBO potential and the atomic information;
[0117] A pre-calculated bond order network module is configured to pre-build a bond order network based on connectivity information between atoms in an adjacency table, and utilize the pre-built bond order network when calculating the FLJ function;
[0118] A classification and grouping multi-core processing module is configured to classify and group different types of interactions between atoms, and perform batch calculations of FREBO functions based on the classification and grouping results, wherein the computational tasks are split and each split task is processed using a multi-core processor;
[0119] The comprehensive calculation module is configured to integrate the calculation results of the FLJ function and the FREBO function, and combine them with the calculation results of the FTORSION function to obtain the final AIREBO potential.
[0120] The steps involved in the above embodiment 2 correspond to those in the method embodiment 1. For the specific implementation method, please refer to the relevant description part of the embodiment 1.
[0121] Those skilled in the art will appreciate that the units and algorithmic steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0122] In the above embodiments, all or part of the embodiments can be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted via 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 via wired (e.g., coaxial cable, optical fiber, digital line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data processing device such as a server or data center that integrates one or more available media. Available media can be magnetic media (e.g., floppy disks, hard disks, tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
[0123] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any technical object of a person skilled in the art that can be easily conceived of within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. An AIREBO potential optimization method suitable for multi-core processors, characterized in that: The following steps are involved: Obtain atomic information and construct a hierarchical adjacency list based on the cutoff radius characteristics of the AIREBO potential and the atomic information. The specific steps are as follows: record the collected atomic information and create an index; traverse the neighborhood grid list of each atom to obtain all atom pairs, and filter the atom pairs based on the cutoff radius characteristics; Construct short-range adjacency lists and long-range adjacency lists based on the screening results; A bond network is pre-built based on the connectivity information between atoms in the adjacency table. The pre-built bond network is used when calculating the FLJ function. The specific steps are as follows: traverse the local atoms owned by the current process and initialize the atomic bond network structure; limit the search and collect adjacent atom information based on the short-range adjacency table; build a bond network structure based on the information of atoms and adjacent atoms. The bond network structure includes reserved storage space for storing the connection strength between atoms, the number of paths, and related parameters; Classify and group different types of interactions between atoms, and perform batch calculations of FREBO functions based on the classification and grouping results. The computational tasks are split and processed using multi-core processors. The final AIREBO potential is obtained by combining the calculation results of the FLJ function and the FREBO function with the calculation results of the FTORSION function.
2. The AIREBO potential optimization method for multi-core processors according to claim 1, wherein: The specific steps for screening atom pairs according to the cutoff radius characteristics are: For each atom pair, the square of the distance between the two atoms is calculated and compared with the square of the maximum neighbor cutoff radius to obtain the candidate atom pair; 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 cutoff radius, thereby constructing a short-range adjacency list; Initialize the Boolean variable to 1, and perform sorting and judgment based on the atomic labels and coordinate positions to construct a long-range adjacency list.
3. The AIREBO potential optimization method for multi-core processors according to claim 1, wherein: The specific steps for calculating the FLJ function using the pre-built bond order network are: Traverse atom pairs and use the pre-built bond order network to perform valid link queries; Determine the computational properties of the atom pair based on the path conditions.
4. The AIREBO potential optimization method for multi-core processors according to claim 1, wherein: The specific steps for classifying and grouping different types of interactions between atoms are: Determine the interaction type based on the type identification of the atom pair; Different lists are constructed according to the interaction type, and the lists are accumulated according to the classification and grouping results of the atomic pairs, and batch calculations of the lists are performed according to the set threshold.
5. The AIREBO potential optimization method for multi-core processors according to claim 4, characterized in that: Different types of interactions between atoms include CC, CH and HH.
6. The AIREBO potential optimization method for multi-core processors according to claim 4, characterized in that: The specific steps for batch calculation based on classification and grouping results are as follows: Call vectorized FREBO on the list that reaches the cumulative threshold and use parallel processing to batch calculate the kernel function; After all atom pairs are traversed, vectorized calculation is called separately for the remaining tail data that is less than BLKSIZE.
7. An AIREBO potential optimization system suitable for multi-core processors, characterized in that: include: The adjacency list construction module is configured to obtain atomic information and construct a hierarchical adjacency list based on the cutoff radius characteristics of the AIREBO potential and the atomic information. The specific steps are: recording and indexing the collected atomic information; traversing the neighborhood grid list of each atom to obtain all atom pairs, and screening the atom pairs based on the cutoff radius characteristics; Construct short-range adjacency lists and long-range adjacency lists based on the screening results; The pre-calculated bond network module is configured to pre-build a bond network based on the connectivity information between atoms in the adjacency table. The pre-built bond network is used when calculating the FLJ function. The specific steps are as follows: traversing the local atoms owned by the current process and initializing the atomic bond network structure; limiting the search and collecting adjacent atom information based on the short-range adjacency table; and building a bond network structure based on the information of atoms and adjacent atoms. The bond network structure includes reserved storage space for storing the connection strength between atoms, the number of paths, and related parameters. A classification and grouping multi-core processing module is configured to classify and group different types of interactions between atoms, and perform batch calculations of FREBO functions based on the classification and grouping results, wherein the computational tasks are split and each split task is processed using a multi-core processor; The comprehensive calculation module is configured to integrate the calculation results of the FLJ function and the FREBO function, and combine them with the calculation results of the FTORSION function to obtain the final AIREBO potential.
Citation Information
Patent Citations
Molecular dynamics simulation acting force analysis method and device and computer equipment
CN118692576A
Molecular dynamics simulation parallel computing method of TIP4P water model
CN118862602A