Molecular dynamics non-covalent bond calculation method and device based on cooperation of host and fpga

CN118098386BActive Publication Date: 2026-10-30WESTLAKE LAB OF LIFE SCI & BIOMEDICINE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410259846.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-07
Publication Date
2026-10-30
Estimated Expiration
2044-03-07

AI Technical Summary

Technical Problem

[0004]综上所述,目前虽然可以通过计算得到分子动力学中每一个粒子的非共价键作用力,但是其受到硬件计算平台的限制导致整体的计算量较大,计算效率低下

Benefits of technology

本申请实施例本申请实施例使用HOST的FPGA进行协同计算,HOST负责对分子结构进行区域划分,而FPGA负责对粒子之间的作用力进行计算,从而加快了分子动力学中非共价键的计算速度;本方案将同一区域中的粒子数据信息存储单独存放于一个独立的存储单元中,从而在进行计算时可以更快的调用想要的粒子数据信息;本方案对与待计算粒子相连比较近的粒子进行过滤,从而减少了计算量。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118098386B_ABST
    Figure CN118098386B_ABST
Patent Text Reader

Abstract

The application provides a molecular dynamics non-covalent bond calculation method and device based on HOST and FPGA cooperation, and comprises the following steps: a HOST end constructs a simulation box based on a molecular structure, and divides the simulation box into a plurality of same-size sub-lattices by adopting a grid division method; the HOST transmits particle data information in each region to an FPGA; the FPGA performs non-covalent bond calculation based on the data information of each particle, and transmits a calculation result to the HOST for integration to complete the non-covalent bond calculation. The scheme improves the calculation efficiency by cooperating the HOST and the FPGA to calculate the non-covalent bond force of the particles.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of molecular dynamics, and in particular to a method and apparatus for calculating non-covalent bonds in molecular dynamics based on the collaboration of HOST and FPGA. Background Technology

[0002] Molecular dynamics is a simulation technique that uses the principles of statistical physics and computer simulations to study the dynamic rheology of atoms and molecules in molecular systems, thereby simulating intermolecular interactions and the effects of gravitational laws, quantum mechanics, and other physical laws.

[0003] Non-covalent bonds refer to ionic bonds, metallic bonds, and intermolecular forces. A non-covalent bond is formed when two or more atoms do not share their outer electrons, reaching an electron saturation state under ideal conditions, thus forming a relatively stable chemical structure called a non-covalent bond. Non-covalent bond calculations in molecular dynamics require processing a large number of atoms and molecules and calculating their interactions, which usually requires a lot of computing resources. However, due to the limitations of hardware computing platforms, simulating complex systems or performing long-term simulations often requires experiments involving large computing clusters that run for months at a time.

[0004] In summary, although the non-covalent forces of each particle in molecular dynamics can be calculated, the overall computational load is large and the computational efficiency is low due to the limitations of the hardware computing platform. Summary of the Invention

[0005] This application provides a molecular dynamics non-covalent bond calculation method and apparatus based on HOST and FPGA collaboration, which improves computational efficiency by collaboratively calculating the non-covalent bond forces of particles using HOST and FPGA.

[0006] In a first aspect, embodiments of this application provide a molecular dynamics non-covalent bond calculation method based on HOST and FPGA collaboration, the method comprising: The host constructs a simulation box based on the molecular structure and uses a grid partitioning method to divide the simulation box into multiple sub-grids of the same size. A particle information lookup table is constructed based on the particle data information of each particle in the molecular structure and stored in a shared storage area. The particle data information includes the particle number, the sub-grid to which the particle belongs, the sub-grid identifier of the sub-grid to which the particle belongs, the real-time position information of the particle, and the calculation parameters of the particle. A sub-grid containing particles is designated as the calling grid. Half of the adjacent grids of each calling grid are used as the computation area of ​​that calling grid. The adjacent grids are the sub-grids that are directly adjacent to the calling grid. The host transmits the particle information lookup table in the shared memory area to the HBM2 storage device in the FPGA through the PCIe interface. The FPGA calculates the interaction force between each calling grid and the corresponding computation area in parallel based on the particle data information in the received particle information lookup table as the first interaction force result, and caches the first interaction force result in the shared memory area. After the HOST receives the first force result of each calling cell from the shared storage area, it transmits it to the FPGA. The FPGA calculates the force between each calling cell and the corresponding symmetrical region based on the first force result of each calling cell as the second force result and transmits the second force result to the shared storage area. The symmetrical region is the area composed of sub-cells that are symmetrical to the calculation area of ​​the calling cell and adjacent to the calling cell. The host updates the coordinate information of each particle in the molecular structure based on the first and second force results of each calling cell in the shared storage area to complete the non-covalent bond calculation.

[0007] Secondly, embodiments of this application provide a molecular dynamics non-covalent bond computing device based on HOST and FPGA collaboration, comprising: The region partitioning module is used to construct a simulation box based on the molecular structure through the HOST end and divide the simulation box into multiple sub-grids of the same size using a grid partitioning method. A particle information lookup table is constructed based on the particle data information of each particle in the molecular structure and stored in the shared storage area. The particle data information includes particle number, sub-grid to which the particle belongs, sub-grid identifier of the sub-grid to which the particle belongs, real-time position information of the particle, and calculation parameters of the particle. The first calculation module sets the sub-grid containing particles as the calling grid, and half of the adjacent grids of each calling grid are used as the calculation area of ​​the calling grid. The adjacent grids are the sub-grids that are directly adjacent to the calling grid. The host end transmits the particle information lookup table in the shared storage area to the HBM2 storage device in the FPGA through the PCIe interface. The FPGA calculates the interaction force between each calling grid and the corresponding calculation area in parallel based on the particle data information in the received particle information lookup table as the first interaction force result, and caches the first interaction force result in the shared storage area. The second calculation module receives the first force result of each calling cell from the shared storage area and transmits it to the FPGA. The FPGA calculates the force between each calling cell and the corresponding symmetrical region based on the first force result of each calling cell as the second force result and transmits the second force result to the shared storage area. The symmetrical region is a region composed of sub-cells that are symmetrical to the calculation area of ​​the calling cell and adjacent to the calling cell. The integration module is used to perform non-covalent bond calculations by updating the coordinate information of each particle in the molecular structure based on the first and second force results of each calling cell in the shared storage area at the HOST end.

[0008] Thirdly, embodiments of this application provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to execute a molecular dynamics non-covalent bond calculation method based on HOST and FPGA collaboration.

[0009] Fourthly, embodiments of this application provide a readable storage medium storing a computer program, the computer program including program code for controlling a process to execute the process, the process including a molecular dynamics non-covalent bond calculation method based on HOST and FPGA collaboration.

[0010] The main contributions and innovations of this invention are as follows: This embodiment of the application uses the FPGA of the host for collaborative computing. The host is responsible for dividing the molecular structure into regions, while the FPGA is responsible for calculating the interaction forces between particles, thereby accelerating the calculation speed of non-covalent bonds in molecular dynamics. This solution stores the particle data information in the same region in a separate independent storage unit, so that the desired particle data information can be retrieved more quickly during calculation. This solution filters particles that are close to the particle to be calculated, thereby reducing the amount of computation.

[0011] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

[0012] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a flowchart of a molecular dynamics non-covalent bond calculation method based on HOST and FPGA collaboration, according to an embodiment of this application; Figure 2 This is a schematic diagram of the adjacent cell lattice method in this scheme; Figure 3 This is a schematic diagram of the storage format of particle data information in this scheme; Figure 4 This is the top-level framework diagram for non-covalent bond calculations in this scheme; Figure 5 This is the FPGA calculation flowchart for this solution; Figure 6 This is a structural diagram of the DSP pipeline in this solution; Figure 7 This is a schematic diagram of the multi-order linear interpolation framework that maximizes the speed of this scheme; Figure 8 This is a schematic diagram of the multi-order linear interpolation framework that achieves the highest accuracy in this scheme; Figure 9 This is a schematic diagram of the computational framework for the PME Fast Fourier Transform in this scheme; Figure 10 This is a flowchart of the PME calculation in this scheme; Figure 11 This is a schematic diagram illustrating the data interaction and calculation between the HOST and FPGA in this solution; Figure 12 This is a flowchart of the data processing performed by the CPU on the HOST side in this solution; Figure 13 This is a structural block diagram of a molecular dynamics non-covalent bond computing device based on the collaboration of HOST and FPGA according to an embodiment of this application; Figure 14 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0013] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0014] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.

[0015] Example 1 This application provides a molecular dynamics non-covalent bond calculation based on HOST and FPGA collaboration. By collaboratively calculating the non-covalent bond forces of particles using the HOST (host) and FPGA, computational efficiency is improved. Specifically, refer to... Figure 1 The method includes: The host constructs a simulation box based on the molecular structure and uses a grid partitioning method to divide the simulation box into multiple sub-grids of the same size. A particle information lookup table is constructed based on the particle data information of each particle in the molecular structure and stored in a shared storage area. The particle data information includes the particle number, the sub-grid to which the particle belongs, the sub-grid identifier of the sub-grid to which the particle belongs, the real-time position information of the particle, and the calculation parameters of the particle. A sub-grid containing particles is designated as the calling grid. Half of the adjacent grids of each calling grid are used as the computation area of ​​that calling grid. The adjacent grids are the sub-grids that are directly adjacent to the calling grid. The host transmits the particle information lookup table in the shared memory area to the HBM2 storage device in the FPGA through the PCIe interface. The FPGA calculates the interaction force between each calling grid and the corresponding computation area in parallel based on the particle data information in the received particle information lookup table as the first interaction force result, and caches the first interaction force result in the shared memory area. After the HOST receives the first force result of each calling cell from the shared storage area, it transmits it to the FPGA. The FPGA calculates the force between each calling cell and the corresponding symmetrical region based on the first force result of each calling cell as the second force result and transmits the second force result to the shared storage area. The symmetrical region is the area composed of sub-cells that are symmetrical to the calculation area of ​​the calling cell and adjacent to the calling cell. The host updates the coordinate information of each particle in the molecular structure based on the first and second force results of each calling cell in the shared storage area to complete the non-covalent bond calculation.

[0016] In this scheme, to meet the requirements of large-scale parallel computing, the HOST and FPGA are designed collaboratively to complete multi-channel communication. The HOST can support more functions by using the LINUX operating system. Since the molecular dynamics involved in this scheme is used to calculate complex biological systems such as proteins, the various particles in the molecular structure can be initially classified in the HOST, while the van der Waals forces and Coulomb forces between particles, which take the most time, can be calculated on the FPGA.

[0017] In this scheme, in the step of "constructing a simulation box based on molecular structure at the HOST end and dividing the simulation box into multiple sub-grids of the same size using a grid partitioning method", the larger the molecular structure, the larger the simulation box, and the simulation box contains all the molecular structures.

[0018] Specifically, since the van der Waals and Coulomb forces between molecules can be ignored when the two particles are far enough apart, the size of the simulation box in this scheme is related to the van der Waals and Coulomb forces.

[0019] This scheme uses the nearest-neighbor lattice method to divide the sub-lattice. The structure of the nearest-neighbor lattice method is as follows: Figure 2 As shown, the HOST end divides the molecular structure into uniformly sized subgrids according to a reasonable cutoff radius. The cutoff radius refers to the calculation range, and the buffer range radius is the buffer zone where particles enter and exit the cutoff radius within a given calculation time.

[0020] In this scheme, the host temporarily stores the particle data information in each subcell in the on-chip RAM.

[0021] In some embodiments, the CPU on the host has multiple cores. During computation, different threads are bound to the CPU cores. For example, if the CPU has four computing cores and two computing pipelines, two computing cores are bound to one computing pipeline. The purpose of this is to improve the CPU utilization and enable multi-threaded parallelism. The CPU is the processor in the host.

[0022] In this scheme, to allow for future parallel expansion using multiple FPGA cards, the storage format of each particle's information data in the particle information lookup table is identical, and the data information of each particle is distinguished by a data identifier bit. The storage format of the particle's data information is as follows: Figure 3 As shown.

[0023] For example, if there are 200,000 particles in the entire simulation box, then an 18-bit width is needed to store the particle indexes.

[0024] In this scheme, the top-level framework for non-covalent bond calculation is as follows: Figure 4 As shown, the CPU on the HOST side transmits the particle information lookup table in the shared memory area to the FPGA through the PCIe interface. It is worth mentioning that there may be multiple nodes on a single FPGA, and different computing tasks can be assigned to each node according to the actual situation. Each node contains an HBM2 storage device to store the received particle data information.

[0025] In some specific embodiments, the top-level framework mainly consists of two functional areas. The first part is the short-range force calculation part, which requires more logic resources; the other part is the electrostatic long-range force calculation unit, which optimizes the fast Fourier calculation in PME calculation.

[0026] In this scheme, the particle data information in different nodes of HBM2 on a single FPGA is independent of each other. Each time the HOST sends new data to the FPGA, the data identifier bit in the HBM2 is updated.

[0027] In this solution, the host transmits the start signal to the FPGA via a bypass interface, and the FPGA performs calculations after receiving the start signal.

[0028] Specifically, the start signal is transmitted through the DMA channel.

[0029] The PCIE in this solution is a high-speed serial computer expansion bus standard, which belongs to high-speed serial point-to-point dual-channel high-bandwidth transmission.

[0030] In this scheme, the FPGA's computation process is as follows: Figure 5 As shown, the user inputs the molecular structure to the HOST terminal. The HOST terminal constructs a particle information lookup table based on the user-input molecular structure and transmits it to the shared storage area via a DMA channel. When all data transmissions are complete, a start signal is sent to the FPGA. After receiving the start signal, the FPGA performs calculations. During the calculation, it determines whether all particle information in the current sub-cell has been calculated. If all particles in the current sub-cell have been calculated, the calculation result is cached in the shared storage area, and the particle data information in the next sub-cell is passed in for calculation until the calculation is completed and the first force result is obtained.

[0031] In this scheme, when the FPGA completes the calculation, it sends an interrupt signal to the HOST through the DMA channel. After receiving the interrupt signal, the HOST receives the first force result of each calling cell in the shared memory area.

[0032] The parallel computing in this scheme involves performing parallel computations on particle data in the calling cell and particle data in different sub-cells within the computation area. It can also be viewed as a single-command, multi-channel data stream processing. In this scheme, Force RAM and Energy RAM are constructed in the shared memory area to store the van der Waals forces and Coulomb forces between particles, respectively.

[0033] In this scheme, the maximum number of parallel computations is that each particle can be computed in parallel, but this consumes a huge amount of computing resources. To save computing resources, the FPGA constructs a DSP pipeline for multi-loop computation. The structure of the DSP pipeline is as follows: Figure 6 As shown, in the DSP pipeline, the particles to be calculated in each calling cell cycle and the particles in the calculation area are calculated. For example, there are 1000 particles in a calling cell. The particles form a pipeline for calculation. The first particle is transferred to the pipeline connected to other particles. In this process, the coefficients R-12, R-6 and R-2 need to be calculated. Since the parameters of each particle are different, it is necessary to obtain the particle data information of each particle according to the particle information lookup table. Here, R is the distance between particles.

[0034] Specifically, each step in the DSP pipeline requires multiple floating-point calculations of particle data. Multi-level DSP calculations can support a computing speed of 500MHz on the FPGA cloud platform. Moreover, with the improvement of FPGA technology, it can be upgraded from multiple SLR processes (a chip manufacturing process) of U250 (an FPGA accelerator card) to Intel's single-card, single-substrate process. The improvement of chip technology also provides greater potential for the future use of FPGA to accelerate molecular dynamics.

[0035] In this scheme, when calculating the values ​​of R-14, R-8, and R-3, the multi-level FLOAT POINT IP core calculation method (floating-point IP core calculation) can be used.

[0036] Specifically, this scheme uses a multi-level floating-point IP core for numerical calculation. After FOGA reads the XYZ coordinates of the particle to be calculated, the particle in the calling cell can be calculated on an equal footing with the particles in the sub-cells of the calculation area, and then the squares are calculated to obtain the value of R-2. It is worth mentioning that this scheme caches the intermediate variables such as R-2 and R-4 obtained by calculation in the register to save computing resources.

[0037] In some embodiments, the DSP pipeline employs a maximum-speed multi-order linear interpolation framework for computation. This framework uses first-, second-, and third-order linear interpolation methods to fit three high-power curves: R⁻¹⁴, R⁻⁸, and R⁻³, to conserve DSP resources and improve computation speed. The maximum-speed multi-order linear interpolation framework is as follows: Figure 7 As shown.

[0038] Specifically, this scheme can also use conventional interpolation models such as Hamiltonian interpolation and Legendre interpolation as the multi-order linear interpolation framework for maximum speed. Although the multi-order linear interpolation framework for maximum speed improves computational efficiency to a certain extent, it will sacrifice some computational accuracy.

[0039] In some embodiments, the DSP pipeline uses a multi-order linear interpolation framework with the highest accuracy for computation. This framework does not perform fitting but directly calculates using DSP resources, resulting in high accuracy, but it is also resource-intensive. The highest-accuracy multi-order linear interpolation framework is as follows: Figure 8 As shown.

[0040] In this DSP pipeline, both the highest-speed and the most accurate multi-order linear interpolation frameworks are retained to meet different computational needs.

[0041] Molecular dynamics non-covalent bond calculations include van der Waals forces and Coulomb forces. In this scheme, van der Waals forces are calculated using conventional methods through a DSP pipeline; this scheme will not explain their calculation. For Coulomb force calculations, the PME (Particle-Mesh-Ewald) algorithm is used. The PME algorithm requires Fast Fourier Transform (FFT) calculations. The computational framework diagram of PME FFT is shown below. Figure 9 As shown, the computational framework of PME Fast Fourier Transform uses a three-dimensional transformation control module. Data in the XYZ dimensions are successively transformed into Fourier transforms. This process requires independent and parallel local storage units, which can improve transformation efficiency. Because the transformation requires a data concatenation process, the data waiting for the next transformation can be concatenated during the transformation of the previous one, thus saving computational waiting time.

[0042] In this scheme, the PME calculation flowchart is as follows: Figure 10 As shown, the CPU in the HOST sends the particle information lookup table to the shared memory area through the DMA channel. Then, the FPGA initiates the PME transformation. The FPGA retrieves the particle data information from the particle lookup table in the shared memory area, performs Fourier transform and inverse Fourier transform, and then performs convolution to complete the calculation of one dimension. After completing the calculation of all dimensions, the FPGA caches the calculation results in the shared memory area and notifies the CPU that the calculation is complete through the DMA channel.

[0043] During PME calculations, the FPGA uses an adjusted HBM2 memory, which supports multi-channel read and write, further improving the calculation speed.

[0044] Specifically, the convolution calculation in the PME calculation process is completed during the inverse Fourier transform, thereby compressing the calculation time to the maximum extent.

[0045] In some embodiments, a schematic diagram of the HOST interacting with the FPGA and performing calculations is shown below. Figure 11 As shown, in this scheme, the HOST sends the computing resources required for 4 calling cells to the FPGA each time. The FPGA performs four parallel calculations simultaneously, progressing step by step until all calling cells in the simulation box have been calculated. If there are 2 FPGA acceleration cards participating in the calculation, each acceleration card has 4 parallel calculations. At this time, the HOST needs to interact with 8 data channels. The calculation time for each data channel is roughly the same. After the 8 calculations are completed, the next set of data is transmitted in a loop until all data calculations are completed.

[0046] In this scheme, a filtering module is set up. The filtering module determines the distance between particles based on the real-time position information of the particles, and filters out particles whose distance from the particle to be calculated is below a set length threshold. The filtered particles do not participate in the calculation.

[0047] Specifically, in the simulation box, each calling cell has 26 adjacent cells. The data in each calling cell needs to be calculated along with the data in the 13 sub-cells in the calculation area, plus the data in the calling cell itself, totaling 14 cells. However, some particles need to be skipped and do not need to be calculated, such as particles within the same water molecule. During data preprocessing at the host end, we encode each water molecule, meaning that three particles within the same water molecule have the same sequence number. In the DSP pipeline calculation, the particles in the calling cell are compared with the particles in the sub-cells in the calculation area, and data from the same molecule can be removed. For protein systems, particles that are closely connected to other particles can be excluded from calculation. Molecular identifiers can be used to filter particles that do not need to be calculated.

[0048] In some embodiments, the filtering method of the filtering module is optimized and adjusted according to different force fields and different calculation methods.

[0049] In the step of "FPGA calculates the force between each calling cell and the corresponding symmetrical region as the second force result based on the first force result of each calling cell", since each particle is subject to action and reaction forces, and the symmetrical region and the calculation region are symmetrical about the calling cell as the center of symmetry, the second force result can be calculated through action and reaction forces.

[0050] In the step of "updating the coordinate information of each particle in the molecular structure based on the first and second force results of each calling cell in the shared storage area at the HOST end", the first and second forces of each calling cell are added together to update the coordinate information of each particle in the molecular structure.

[0051] Specifically, for simulation boxes with relatively simple particle types, updating the additive terms of particle forces is also relatively straightforward. However, for more complex protein force fields, the two-body forces that the host needs to calculate are also very complex. Therefore, a CPU cluster can be used to assist the FPGA in data processing.

[0052] In some embodiments, the flowchart of data processing performed by the CPU on the host side is as follows: Figure 12 As shown, after receiving data from each FPGA, the CPU concatenates all the received data to obtain the first force result. The CPU then sends the first force to the FPGA, which calculates the second force result based on the first force result. The CPU updates the coordinate information of each particle according to the first and second force results to complete one non-covalent bond calculation.

[0053] In practical molecular dynamics calculations, users can utilize a single FPGA board and a personal workstation, depending on their hardware configuration, making the design more portable. For example, a U250 accelerator card contains abundant logic resources. According to the U250 datasheet, a single card has four SLR regions, each connected to a DDR4 chip with 4GB of storage space per DDR, and 12,000 DSP resources. Therefore, the design can employ a multi-path parallel approach, using a 13-path pipeline for one data stream. Considering all logic resources, multi-path parallel computing is feasible.

[0054] Furthermore, FPGA accelerator cards now support multi-card parallel computing and are very user-friendly for large-scale molecular dynamics simulations. When using Vitis software, data from different cards can be accessed and stored via the OpenCL interface. Pair-to-pair data transfer is also supported between accelerator cards, allowing data from accelerator card 1 to be transferred to the storage area of ​​accelerator card 2. Higher-speed communication methods are also supported on the FPGA cloud platform, allowing users to choose the appropriate method based on their specific needs in practical applications.

[0055] For the host side, the cloud computing platform can support up to 64 vCPU computing cores. This greatly improves the CPU's computing power. During computation, a single host can transmit data packets to multiple FPGAs, and the data in each card can be processed in a multi-channel single-card manner.

[0056] Example 2 Based on the same concept, referencing Figure 13 This application also proposes a molecular dynamics non-covalent bond computing device based on HOST and FPGA collaboration, comprising: The region partitioning module is used to construct a simulation box based on the molecular structure through the HOST end and divide the simulation box into multiple sub-grids of the same size using a grid partitioning method. A particle information lookup table is constructed based on the particle data information of each particle in the molecular structure and stored in the shared storage area. The particle data information includes particle number, sub-grid to which the particle belongs, sub-grid identifier of the sub-grid to which the particle belongs, real-time position information of the particle, and calculation parameters of the particle. The first calculation module sets the sub-grid containing particles as the calling grid, and half of the adjacent grids of each calling grid are used as the calculation area of ​​the calling grid. The adjacent grids are the sub-grids that are directly adjacent to the calling grid. The host end transmits the particle information lookup table in the shared storage area to the HBM2 storage device in the FPGA through the PCIe interface. The FPGA calculates the interaction force between each calling grid and the corresponding calculation area in parallel based on the particle data information in the received particle information lookup table as the first interaction force result, and caches the first interaction force result in the shared storage area. The second calculation module receives the first force result of each calling cell from the shared storage area and transmits it to the FPGA. The FPGA calculates the force between each calling cell and the corresponding symmetrical region based on the first force result of each calling cell as the second force result and transmits the second force result to the shared storage area. The symmetrical region is a region composed of sub-cells that are symmetrical to the calculation area of ​​the calling cell and adjacent to the calling cell. The integration module is used to perform non-covalent bond calculations by updating the coordinate information of each particle in the molecular structure based on the first and second force results of each calling cell in the shared storage area at the HOST end.

[0057] Example 3 This embodiment also provides an electronic device, see reference. Figure 14 It includes a memory 404 and a processor 402, wherein the memory 404 stores a computer program and the processor 402 is configured to run the computer program to perform the steps in any of the above method embodiments.

[0058] Specifically, the processor 402 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.

[0059] Memory 404 may include a mass storage device for data or instructions. For example, and not limitingly, memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 404 may include removable or non-removable (or fixed) media. Where appropriate, memory 404 may be internal or external to a data processing device. In a particular embodiment, memory 404 is non-volatile memory. In a particular embodiment, memory 404 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random-Access Memory (FPMDRAM), Extended Data Out Dynamic Random-Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.

[0060] The memory 404 can be used to store or cache various data files that need to be processed and / or communicated, as well as possible computer program instructions executed by the processor 402.

[0061] The processor 402 reads and executes the computer program instructions stored in the memory 404 to implement any of the molecular dynamics non-covalent bond calculation methods based on HOST and FPGA collaboration in the above embodiments.

[0062] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408, wherein the transmission device 406 is connected to the processor 402 and the input / output device 408 is connected to the processor 402.

[0063] The transmission device 406 can be used to receive or send data via a network. Specific examples of the network described above may include wired or wireless networks provided by the communication provider of the electronic device. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 406 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0064] Input / output device 408 is used to input or output information. In this embodiment, the input information may be molecular structure, etc., and the output information may be the calculation results of the FPGA, etc.

[0065] Optionally, in this embodiment, the processor 402 can be configured to perform the following steps via a computer program: S101, the HOST end constructs a simulation box based on the molecular structure and uses a grid partitioning method to divide the simulation box into multiple sub-grids of the same size. Based on the particle data information of each particle in the molecular structure, a particle information lookup table is constructed and stored in the shared storage area. The particle data information includes the particle number, the sub-grid to which the particle belongs, the sub-grid identifier of the sub-grid to which the particle belongs, the real-time position information of the particle, and the calculation parameters of the particle. S102. Set the sub-grid containing particles as the calling grid. Half of the adjacent grids of each calling grid are used as the calculation area of ​​the calling grid. The adjacent grids are the sub-grids that are directly adjacent to the calling grid. The HOST end transmits the particle information lookup table in the shared storage area to the HBM2 storage device in the FPGA through the PCIE interface. The FPGA calculates the interaction force between each calling grid and the corresponding calculation area in parallel based on the particle data information in the received particle information lookup table as the first interaction force result, and caches the first interaction force result in the shared storage area. S103. After the HOST receives the first force result of each calling cell from the shared storage area, it transmits it to the FPGA. The FPGA calculates the force between each calling cell and the corresponding symmetrical region based on the first force result of each calling cell as the second force result and transmits the second force result to the shared storage area. The symmetrical region is a region composed of sub-cells that are symmetrical to the calculation area of ​​the calling cell and adjacent to the calling cell. S104: The HOST end updates the coordinate information of each particle in the molecular structure based on the first and second force results of each calling cell in the shared storage area to complete the non-covalent bond calculation.

[0066] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0067] Generally, various embodiments can be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects of the invention can be implemented in hardware, while others can be implemented in firmware or software that can be executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flowcharts, or using some other graphical representation, it should be understood that, by way of non-limiting example, these blocks, apparatuses, systems, techniques, or methods described herein can be implemented in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or controllers or other computing devices, or some combination thereof.

[0068] Embodiments of the present invention can be implemented by computer software, which may be executable by a data processor of a mobile device, such as a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets, and / or macros can be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. The computer program product may include one or more computer-executable components configured to perform the embodiments when the program is run. The one or more computer-executable components may be at least one piece of software code or a portion thereof. Additionally, it should be noted in this respect that, as Figure 14 Any box in the logical flow can represent a program step, or interconnected logic circuits, boxes and functions, or a combination of program steps and logic circuits, boxes and functions. Software can be stored on physical media such as memory chips or blocks of storage implemented within a processor, magnetic media such as hard disks or floppy disks, and optical media such as DVDs and their data variants, CDs, etc. The physical medium is a non-transient medium.

[0069] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0070] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A method for calculating non-covalent bonds in molecular dynamics based on the collaboration of host and FPGA, characterized in that, include: The host constructs a simulation box based on the molecular structure and uses a grid partitioning method to divide the simulation box into multiple sub-grids of the same size. A particle information lookup table is constructed based on the particle data information of each particle in the molecular structure and stored in a shared storage area. The particle data information includes the particle number, the sub-grid to which the particle belongs, the sub-grid identifier of the sub-grid to which the particle belongs, the real-time position information of the particle, and the calculation parameters of the particle. A sub-grid containing particles is designated as the calling grid. Half of the adjacent grids of each calling grid are used as the computation area of ​​that calling grid. The adjacent grids are the sub-grids that are directly adjacent to the calling grid. The host transmits the particle information lookup table in the shared memory area to the HBM2 storage device in the FPGA through the PCIe interface. The FPGA calculates the interaction force between each calling grid and the corresponding computation area in parallel based on the particle data information in the received particle information lookup table as the first interaction force result, and caches the first interaction force result in the shared memory area. After the HOST receives the first force result of each calling cell from the shared storage area, it transmits it to the FPGA. The FPGA calculates the force between each calling cell and the corresponding symmetrical region based on the first force result of each calling cell as the second force result and transmits the second force result to the shared storage area. The symmetrical region is the area composed of sub-cells that are symmetrical to the calculation area of ​​the calling cell and adjacent to the calling cell. The host updates the coordinate information of each particle in the molecular structure based on the first and second force results of each calling cell in the shared storage area to complete the non-covalent bond calculation.

2. The molecular dynamics non-covalent bond calculation method based on HOST and FPGA collaboration according to claim 1, characterized in that, In the step of "constructing a simulation box based on molecular structure at the HOST end and dividing the simulation box into multiple sub-grids of the same size using a grid partitioning method", the larger the molecular structure, the larger the simulation box, and the simulation box contains all the molecular structures.

3. The molecular dynamics non-covalent bond calculation method based on HOST and FPGA collaboration according to claim 1, characterized in that, The information data of each particle is stored in the same format in the particle information lookup table, and the data information of each particle is distinguished by a data identifier bit.

4. The molecular dynamics non-covalent bond calculation method based on HOST and FPGA collaboration according to claim 1, characterized in that, The host transmits the start signal to the FPGA via a bypass interface, and the FPGA performs calculations after receiving the start signal.

5. The molecular dynamics non-covalent bond calculation method based on HOST and FPGA collaboration according to claim 1, characterized in that, When the FPGA completes the calculation, it sends an interrupt signal to the host through the DMA channel. After receiving the interrupt signal, the host receives the first force result of each calling cell in the shared memory area.

6. The molecular dynamics non-covalent bond calculation method based on HOST and FPGA collaboration according to claim 1, characterized in that, A filtering module is set up. The filtering module determines the distance between particles based on the real-time position information of the particles and filters out particles whose distance from the particle to be calculated is below a set length threshold. The filtered particles do not participate in the calculation.

7. The molecular dynamics non-covalent bond calculation method based on HOST and FPGA collaboration according to claim 1, characterized in that, In the step of "updating the coordinate information of each particle in the molecular structure based on the first and second force results of each calling cell in the shared storage area at the HOST end", the first and second forces of each calling cell are added together to update the coordinate information of each particle in the molecular structure.

8. A molecular dynamics non-covalent bond computing device based on HOST and FPGA collaboration, characterized in that, include: The region partitioning module is used to construct a simulation box based on the molecular structure through the HOST end and divide the simulation box into multiple sub-grids of the same size using a grid partitioning method. A particle information lookup table is constructed based on the particle data information of each particle in the molecular structure and stored in the shared storage area. The particle data information includes particle number, sub-grid to which the particle belongs, sub-grid identifier of the sub-grid to which the particle belongs, real-time position information of the particle, and calculation parameters of the particle. The first calculation module sets the sub-grid containing particles as the calling grid, and half of the adjacent grids of each calling grid are used as the calculation area of ​​the calling grid. The adjacent grids are the sub-grids that are directly adjacent to the calling grid. The host end transmits the particle information lookup table in the shared storage area to the HBM2 storage device in the FPGA through the PCIe interface. The FPGA calculates the interaction force between each calling grid and the corresponding calculation area in parallel based on the particle data information in the received particle information lookup table as the first interaction force result, and caches the first interaction force result in the shared storage area. The second calculation module receives the first force result of each calling cell from the shared storage area and transmits it to the FPGA. The FPGA calculates the force between each calling cell and the corresponding symmetrical region based on the first force result of each calling cell as the second force result and transmits the second force result to the shared storage area. The symmetrical region is a region composed of sub-cells that are symmetrical to the calculation area of ​​the calling cell and adjacent to the calling cell. The integration module is used to perform non-covalent bond calculations by updating the coordinate information of each particle in the molecular structure based on the first and second force results of each calling cell in the shared storage area at the HOST end.

9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to execute a molecular dynamics non-covalent bond calculation method based on HOST and FPGA collaboration as described in any one of claims 1-7.

10. A readable storage medium, characterized in that, The readable storage medium stores a computer program, which includes program code for controlling the process to execute the process, the process including a molecular dynamics non-covalent bond calculation method based on HOST and FPGA collaboration according to any one of claims 1-7.