A SPH program acceleration method and device based on MPI parallelism

The MPI parallel method optimizes the domain division and particle exchange of SPH programs, which solves the problem of low parallelization efficiency in large-scale computing, and realizes efficient parallel computing and large-scale simulation capabilities.

CN115167918BActive Publication Date: 2025-08-19NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210696740.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-20
Publication Date
2025-08-19
Estimated Expiration
2042-06-20

AI Technical Summary

Technical Problem

The existing SPH programs are inefficient in parallelization in large-scale computing, resulting in huge consumption of computing resources and making it difficult to run efficiently on supercomputers.

Method used

The solution domain is divided by the MPI parallel method, sub-regions are allocated to the processor, parallel adjacent particle search is carried out, and particle exchange is optimized using non-blocking communication and asynchronous communication to achieve overlap between calculation and communication and improve parallel efficiency.

Benefits of technology

It realizes efficient parallelization of SPH programs in large-scale computing, improves computing efficiency, maintains high performance at the scale of hundreds of millions of particles, and supports large-scale engineering simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115167918B_ABST
    Figure CN115167918B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of smooth particle dynamics and discloses an SPH program acceleration method and device based on MPI parallelism. The present invention divides a solution domain in space to obtain a preset number of sub-regions, and allocates the sub-regions to processors; configures the sub-regions in the processor and determines the processor boundary values; performs parallel neighboring particle search in the processor, and obtains neighboring particles by dividing the particles in the processor solution region into a preset number of small cells; divides the processor solution region into a boundary part and a central part, sends particles falling into the boundary region to the processor in a non-blocking communication manner, and calculates particles in the central part; saves a calculation result array when a first preset condition is met; performs parallel particle update according to the calculation results in the array to determine a ghost particle set and / or a local particle set; performs particle cross-processor transfer on the ghost particle set and / or the local particle set to update the current processor particle number; and iterates according to the current processor particle number.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of smoothed particle fluid dynamics, and in particular to an SPH program acceleration method and device based on MPI parallelism. Background Art

[0002] With the rapid advancement of computing technology, more and more experiments can produce practically meaningful results through computer simulation. Consequently, computer simulation has been extensively applied to various resource-intensive fields, such as explosions and impacts, hydrological management, and penetration, achieving excellent results. However, since computational simulations rely on numerical methods to discretize space and ultimately solve a system of discretized equations to obtain an approximate solution to the problem, solving partial differential equations consumes enormous computing resources.

[0003] Smoothed Particle Hydrodynamics (SPH) is a Lagrangian, meshless particle method that has been successfully applied to numerous fields of engineering and science. This method discretizes objects in space using a set of nodes with physical information. Each particle has physical information such as position coordinates, mass, and velocity, and particle updates are approximated by the weighted average of all particles within the smooth domain. However, when the computational scale reaches 200,000 particles, each particle interacts with an average of 60-120 neighboring particles, resulting in very low computational efficiency. To address this issue and make the SPH algorithm suitable for simulating large-scale problems, it is necessary to develop a massively parallel program for SPH.

[0004] Currently, various acceleration methods have made significant progress. GPU-based SPH programs can produce meaningful results within a limited timeframe. Initial versions of GPU-accelerated SPH programs simply ported the particle interaction portion to the GPU for computation. However, this approach resulted in significant data communication between the CPU and GPU, resulting in significant communication overhead. Optimized versions now offload neighbor particle searches, particle interactions, and system update modules entirely to the GPU for computation, significantly improving computational performance. Currently, mainstream GPU-accelerated SPH programs are developed using this principle. Furthermore, multi-CPU homogeneous cluster systems are also key technologies for solving large-scale SPH simulations. Developing parallel SPH programs is of great significance. Numerous papers indicate that achieving parallel SPH, enabling it to run on supercomputers with tens of thousands of nodes, requires addressing numerous challenges. Therefore, efficiently parallelizing SPH programs has become a pressing technical challenge.

[0005] The above content is only used to assist in understanding the technical solution of the present invention and does not constitute an admission that the above content is prior art. Summary of the Invention

[0006] The main purpose of the present invention is to provide an SPH program acceleration method and device based on MPI parallelism, aiming to solve the technical problem of efficient parallelization of SPH programs.

[0007] To achieve the above object, the present invention provides an SPH program acceleration method based on MPI parallelism, the method comprising:

[0008] Dividing the solution domain in space to obtain a preset number of sub-regions, and assigning the sub-regions to corresponding processors;

[0009] configuring the sub-regions in the processor and determining the boundary values of the processor;

[0010] Performing parallel neighboring particle search in the processor to obtain neighboring particles by dividing the particles in the processor solution area into a preset number of small cells;

[0011] Divide the solution area of the processor into a boundary part and a central part, send the particles falling into the boundary area to the adjacent processor in a non-blocking communication manner, and calculate the particles in the central part;

[0012] When the first preset condition is met, the calculation result is saved to an array;

[0013] Perform parallel particle updating according to the calculation results in the array to determine a ghost particle set and / or a local particle set;

[0014] Perform particle cross-processor transfer on the ghost particle set and / or the local particle set and update the number of particles on the current processor;

[0015] Iteration is performed according to the number of particles of the current processor until a maximum number of iterations is met.

[0016] Optionally, the step of dividing the solution domain in the space to obtain a preset number of sub-regions and allocating the sub-regions to corresponding processors includes:

[0017] Divide the solution domain in space to obtain a preset number of sub-regions;

[0018] Assign sub-regions to corresponding processes and require that each corresponding processor is evenly assigned the same number of particles.

[0019] Optionally, the step of configuring the sub-regions in the processor and determining the boundary values of the processor includes:

[0020] Performing region configuration in the processor and setting the region smoothing length to 2h;

[0021] Read source file information and configure boundary conditions according to the source file information;

[0022] Calculates the processor's bounds and stores the results in an array.

[0023] Optionally, the step of saving the calculation result to an array when the first preset condition is met includes:

[0024] When the particles in the center are calculated and the particles in the boundary are received, the particles in the boundary are calculated;

[0025] The calculation results of the particles in the center and the boundary parts are saved in an array.

[0026] Optionally, the step of transferring particles of the ghost particle set and / or the local particle set across processors and updating the number of particles of the current processor includes:

[0027] Sending the ghost particle set to an adjacent processor via asynchronous communication;

[0028] The particles in the local particle set are reordered. After detecting that the sending and receiving of ghost particles are completed, all particles in the local particle set are added to the array to update the particle number of the current processor. The particle number of the current processor is the sum of the local particle number and the ghost particle number.

[0029] Optionally, the step of sending the ghost particle set to an adjacent processor via asynchronous communication comprises:

[0030] The ghost particle set is sent to an adjacent processor through asynchronous communication, and the positions of the corresponding ghost particles are re-marked.

[0031] Optionally, the step of iterating according to the number of particles of the current processor until a maximum number of iterations is met includes:

[0032] Entering a step of performing a parallel neighboring particle search in the processor according to the number of particles in the current processor, and obtaining neighboring particles by dividing the particles in the processor solution area into a preset number of small cells;

[0033] During iteration, ensure that as the computational scale increases, the time spent traversing and sorting the array holding the particle information is much less than the time spent on particle interactions, maintaining a time gap of more than two orders of magnitude.

[0034] Output the calculation result when the maximum number of iterations is met.

[0035] In addition, to achieve the above-mentioned object, the present invention further proposes an SPH program acceleration device based on MPI parallelism, the device comprising:

[0036] A space partitioning module is used to divide the solution domain in space to obtain a preset number of sub-regions and assign the sub-regions to corresponding processors;

[0037] A boundary configuration module, configured to configure sub-regions in the processor and determine the boundary values of the processor;

[0038] A neighbor search module is used to perform parallel neighbor particle search in the processor, and obtain neighbor particles by dividing the particles in the processor solution area into a preset number of small cells;

[0039] A center-boundary module is used to divide the solution area of the processor into a boundary part and a center part, send particles falling into the boundary area to adjacent processors in a non-blocking communication manner, and calculate particles in the center part;

[0040] A condition judgment module, configured to save the calculation result to an array when a first preset condition is met;

[0041] A set calculation module, configured to perform parallel particle update according to calculation results in the array to determine a ghost particle set and / or a local particle set;

[0042] A cross-processor module, configured to transfer particles of the ghost particle set and / or the local particle set across processors and update the number of particles of the current processor;

[0043] The data iteration module is used to iterate according to the number of particles in the current processor until the maximum number of iterations is met.

[0044] In addition, to achieve the above-mentioned purpose, the present invention also proposes a computer device, which includes: a memory, a processor, and an MPI parallel-based SPH program acceleration program stored in the memory and runnable on the processor, wherein the MPI parallel-based SPH program acceleration program is configured to implement the MPI parallel-based SPH program acceleration method as described above.

[0045] In addition, to achieve the above-mentioned purpose, the present invention also proposes a medium, on which an MPI-parallel-based SPH program acceleration program is stored. When the MPI-parallel-based SPH program acceleration program is executed by a processor, the steps of the MPI-parallel-based SPH program acceleration method described above are implemented.

[0046] The present invention divides the solution domain in space into a preset number of sub-regions, and assigns the sub-regions to corresponding processors; configures the sub-regions in the processor and determines the boundary values of the processor; performs parallel neighboring particle searches in the processor, and obtains neighboring particles by dividing the particles in the processor solution region into a preset number of small cells; divides the processor solution region into a boundary part and a central part, sends the particles falling into the boundary region to the adjacent processor in a non-blocking communication manner, and calculates the particles in the central part; when a first preset condition is met, saves the calculation results to an array; performs parallel particle updates based on the calculation results in the array to determine a ghost particle set and / or a local particle set; performs particle cross-processor transfer on the ghost particle set and / or the local particle set and updates the particle number of the current processor; iterates based on the particle number of the current processor until a maximum number of iterations is met, thereby realizing the hiding of communication of the parallel method, improving the scalability of the program, and making it possible to perform large-scale engineering simulation using the SPH method. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 1 is a schematic diagram of the structure of an MPI-based parallel SPH program acceleration device in the hardware operating environment involved in an embodiment of the present invention;

[0048] Figure 2 1 is a flow chart of a first embodiment of an MPI-based parallel SPH program acceleration method according to the present invention;

[0049] Figure 3 Flowchart of the steps of the first embodiment of the MPI-based parallel SPH program acceleration method of the present invention;

[0050] Figure 4 Schematic diagram of parallelized SPH domain decomposition of the first embodiment of the MPI-based SPH program acceleration method of the present invention;

[0051] Figure 5 This is a flow chart of the calculation of parallelized SPH in six processes according to the first embodiment of the MPI-based SPH program acceleration method of the present invention;

[0052] Figure 6 A particle storage structure diagram of an SPH parallel algorithm of a first embodiment of an MPI-based SPH program acceleration method of the present invention;

[0053] Figure 7 FIG1 is a diagram of the parallel particle interaction process of the first embodiment of the MPI-based SPH program acceleration method of the present invention;

[0054] Figure 8This is a process diagram of particle cross-domain processor transfer in the first embodiment of the MPI-based parallel SPH program acceleration method of the present invention;

[0055] Figure 9 This is a smooth function graph of the cubic spline function of the first embodiment of the SPH program acceleration method based on MPI parallelism of the present invention. DETAILED DESCRIPTION

[0056] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0057] Reference Figure 1 , Figure 1 This is a schematic diagram of the structure of an MPI-based parallel SPH program acceleration device in the hardware operating environment involved in the embodiment of the present invention.

[0058] like Figure 1 As shown, the MPI-based parallel SPH program acceleration device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to implement communication between these components. The user interface 1003 may include a display screen and an input unit such as a keyboard. Optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a wireless fidelity (WI-FI) interface). The memory 1005 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0059] Those skilled in the art will understand that Figure 1 The structure shown in does not constitute a limitation on the MPI parallel-based SPH program acceleration device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0060] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module, and an MPI-based parallel SPH program acceleration program.

[0061] exist Figure 1In the MPI parallel-based SPH program acceleration device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the MPI parallel-based SPH program acceleration device of the present invention can be set in the MPI parallel-based SPH program acceleration device, and the MPI parallel-based SPH program acceleration device calls the MPI parallel-based SPH program acceleration program stored in the memory 1005 through the processor 1001, and executes the MPI parallel-based SPH program acceleration method provided by the embodiment of the present invention.

[0062] The embodiment of the present invention provides an SPH program acceleration method based on MPI parallelism, referring to Figure 2 , Figure 2 2 is a flow chart of the first embodiment of the MPI-based parallel SPH program acceleration method of the present invention.

[0063] In this embodiment, the SPH program acceleration method based on MPI parallelism includes the following steps:

[0064] Step S10: Divide the solution domain in the space to obtain a preset number of sub-regions, and assign the sub-regions to corresponding processors.

[0065] It should be noted that the main steps taken in this embodiment are as follows: Figure 3 As shown, the main steps are: Steps:

[0066] (1) Set initial conditions, set the number of particles, and divide the solution area according to the experimental background;

[0067] (2) Region decomposition, each processor is assigned a corresponding sub-region;

[0068] (3) Setting boundary conditions and configuration parameters;

[0069] (4) Neighboring particle search;

[0070] (5) Parallel calculation of the interactions between particles. Particles close to the processor boundary need to be sent to adjacent processors.

[0071] (6) Update of physical information such as particle position, velocity, density, etc.

[0072] (7) Particles move across processors; determine whether the number of iterations is met. If so, the calculation is completed and ends. Otherwise, return to step (4) and repeat this process continuously.

[0073] The particle information in (2) needs to be stored in an array with empty spaces. This can solve the storage problem when the ghost particles are transferred to adjacent processors; (5) the boundary data should be sent out first, and the particles that are not related to the center should be calculated at the same time. Then the particles in the boundary part should be calculated. This strategy can hide the calculation and communication, greatly improving the parallel efficiency of the program. When the particle scale reaches hundreds of millions, it can still maintain extremely high computing efficiency; (7) when the ghost particles are sent, the local particles need to be reordered and organized so that the particles are continuous on the stored array. After the local particles are reorganized and sorted, the ghost particles that have been processed are added to the particle array. This principle also realizes the overlap of calculation and communication; (5) and (7) use the MPI packing function pack in the particle communication process. This operation can greatly reduce the communication time. When the particle scale increases, the communication overhead will be much greater than the calculation overhead. At this time, reducing the communication time will be an important measure to alleviate the acceleration bottleneck.

[0074] In a cluster with a distributed memory architecture, the memory between each processor is not shared. Therefore, in step (1), the particles need to be evenly distributed to different processes. Step (2) needs to save the solution range of each processor to ensure that the calculation of each particle is in the process to which it belongs, avoiding calculation errors caused by repeated calculations. In step (4), the boundary data must be sent out first, and then the interaction between the central particles is calculated. This strategy is to achieve the overlap of calculation and communication and improve parallel efficiency. At the same time, it is also necessary to ensure that the calculation can be carried out only after the boundary particles are sent. Otherwise, dirty data will be read, resulting in calculation errors. After the particles update their position information, it is possible that some particles will illegally penetrate the physical boundary. Therefore, it is necessary to ensure that the ghost particle set plus the local particle set equals the total number of particles.

[0075] It is understood that the present invention's SPH parallel computing method for large-scale distributed memory clusters utilizes a distributed storage structure for particle storage, enabling each processor to compute more particles. Furthermore, regarding particle communication, the present invention utilizes asynchronous communication to enable information exchange between particles in adjacent processors, significantly improving the program's parallel efficiency.

[0076] It should be noted that the proposed SPH parallel computing method for large-scale clusters easily surpasses the computing power of a single node due to its high parallel efficiency. The present invention can simulate engineering cases with practical application backgrounds. Furthermore, the present invention adopts a relatively efficient parallel solution, requiring only the particle interaction and particle update components to be handled, making it simple and easy to implement while also achieving superior parallel efficiency.

[0077] In specific implementation, Figure 4 As shown, Figure 4 This is a diagram of parallelized SPH domain decomposition. The SPH parallel program partitions the data at the start of the calculation and assigns corresponding (non-overlapping) regions to each processor. At the same time, all particles within the processor are stored within the node to facilitate the next step of the calculation.

[0078] Furthermore, the step of dividing the solution domain in the space to obtain a preset number of sub-regions and allocating the sub-regions to corresponding processors includes: dividing the solution domain in the space to obtain a preset number of sub-regions; allocating the sub-regions to corresponding processes and requiring each corresponding processor to be evenly allocated the same number of particles.

[0079] Step S20: configuring the sub-regions in the processor and determining the boundary values of the processor.

[0080] Furthermore, the step of configuring the sub-area in the processor and determining the boundary value of the processor includes: performing area configuration in the processor and setting the area smoothing length to 2h; reading the source file information and configuring the boundary conditions according to the source file information; calculating the boundary of the processor and storing the calculation results in an array.

[0081] Step S30: performing a parallel neighboring particle search in the processor, and obtaining neighboring particles by dividing the particles in the processor solution area into a preset number of small cells.

[0082] Step S40: Divide the solution region of the processor into a boundary part and a central part, send particles falling into the boundary region to adjacent processors in a non-blocking communication manner, and calculate particles in the central part.

[0083] Step S50: When the first preset condition is met, save the calculation result to an array.

[0084] like Figure 5 As shown, Figure 5 This is the parallelized SPH calculation process in 6 processes.

[0085] Furthermore, the step of saving the calculation results to an array when the first preset condition is met includes: when the calculation of the particles in the central part is completed and the reception of the boundary particles is completed, calculating the particles in the boundary part; and saving the calculation results of the particles in the central and boundary parts into an array.

[0086] Step S60: performing parallel particle updating according to the calculation results in the array to determine a ghost particle set and / or a local particle set.

[0087] In specific implementation, Figure 6 The particle storage structure in the parallel framework is shown. In the serial framework, the particles are stored in a fixed-length array. Different from the serial structure, due to the problem of particle transfer in parallel SPH, the array storing particle information is dynamic. This embodiment uses an array of additional length as a dynamic array, such as Figure 6 As shown in the figure, local particles represent local particles, whose computations are performed only on the local processor. Ghost particles, on the other hand, interact with each other, so there is a reserved space behind them to accommodate an indefinite number of ghost particles. Therefore, the length of the array must be significantly greater than the sum of local and ghost particles. Allocating this reserved space in an array solves the particle storage problem in a parallel framework.

[0088] Step S70: performing particle cross-processor transfer on the ghost particle set and / or the local particle set and updating the number of particles on the current processor.

[0089] In specific implementation, Figure 7 The particle interaction process using asynchronous communication is shown. First, the particles are divided into boundary particles and center particles. The boundary particles are sent out through asynchronous communication while the center particles are calculated. The particles sent from the boundary are then calculated, thus achieving overlap between calculations and recalculations. The neighboring particle search uses a linked list search algorithm, which divides the solution area into several background grids with a side length of 2h. Therefore, neighboring particles only need to search the surrounding adjacent grids to find all neighboring particles, greatly reducing calculation time.

[0090] In specific implementation, Figure 8 This is the particle transfer process in a parallel SPH program. Based on the calculated acceleration, the particle's position, density, velocity, and other information are updated. Particles crossing processor domains are also marked as ghosts. First, the ghost particles are sent out, while the local particles are reordered to ensure a continuous arrangement in the array. The incoming particles are then placed after the ghost particles, completing the particle transfer process. This process also overlaps computation and communication, significantly increasing the program's parallel efficiency.

[0091] Furthermore, the step of transferring particles of the ghost particle set and / or local particle set across processors and updating the number of particles of the current processor includes: sending the ghost particle set to an adjacent processor through asynchronous communication; reordering the particles of the local particle set, and after detecting that the sending and receiving of the ghost particles are completed, adding all particles in the local particle set to an array to update the number of particles of the current processor, where the number of particles of the current processor is the sum of the number of local particles and the number of ghost particles.

[0092] Furthermore, the step of sending the ghost particle set to an adjacent processor through asynchronous communication includes: sending the ghost particle set to an adjacent processor through asynchronous communication, and re-marking the positions of corresponding ghost particles.

[0093] Step S80: Iterate according to the number of particles of the current processor until the maximum number of iterations is met.

[0094] In specific implementation, Figure 9 As shown, the smooth function used in this embodiment is a cubic spline smooth function, where the other unknowns in the formula satisfy And α d is a constant coefficient related to space. In one-dimensional, two-dimensional and three-dimensional space, they are α d =1 / h,15 / 7πh 2 ,3 / 2πh 3 .

[0095] Furthermore, the step of iterating according to the number of particles of the current processor until the maximum number of iterations is met includes: entering into a parallel neighboring particle search in the processor according to the number of particles of the current processor, and obtaining neighboring particles by dividing the particles in the processor solution area into a preset number of small cells; ensuring during the iteration that as the calculation scale increases, the time spent on traversing and sorting the array storing particle information is much less than the time spent on particle interaction, and maintaining the time overhead difference at more than two orders of magnitude; and outputting the calculation result when the maximum number of iterations is met.

[0096] This embodiment divides the solution domain in space into a preset number of sub-regions, and assigns the sub-regions to corresponding processors; configures the sub-regions in the processor and determines the boundary values of the processor; performs parallel neighboring particle searches in the processor, and obtains neighboring particles by dividing the particles in the processor solution region into a preset number of small cells; divides the processor solution region into a boundary part and a central part, sends the particles falling into the boundary region to the adjacent processor in a non-blocking communication manner, and calculates the particles in the central part; when the first preset condition is met, saves the calculation results to an array; performs parallel particle updates based on the calculation results in the array to determine the ghost particle set and / or the local particle set; transfers particles of the ghost particle set and / or the local particle set across processors and updates the number of particles of the current processor; iterates based on the number of particles of the current processor until the maximum number of iterations is met, thereby realizing the hiding of communication of the parallel method, improving the scalability of the program, and making it possible to perform large-scale engineering simulation using the SPH method.

[0097] In addition, an embodiment of the present invention also proposes a medium on which an MPI parallel-based SPH program acceleration program is stored. When the MPI parallel-based SPH program acceleration program is executed by a processor, the steps of the MPI parallel-based SPH program acceleration method described above are implemented.

[0098] The embodiments or specific implementations of the MPI-based parallel SPH program acceleration device of the present invention can refer to the above-mentioned method embodiments and will not be repeated here.

[0099] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.

[0100] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.

[0101] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0102] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A SPH program acceleration method based on MPI parallelism, characterized in that: The method comprises: Divide the solution domain in space to obtain a preset number of sub-regions, and assign the sub-regions to corresponding processors; configuring the sub-regions in the processor and determining the boundary values of the processor; Performing parallel neighboring particle search in the processor to obtain neighboring particles by dividing the particles in the processor solution area into a preset number of small cells; Divide the solution area of the processor into a boundary part and a central part, send particles falling into the boundary part to adjacent processors in a non-blocking communication manner, and calculate particles in the central part; When the first preset condition is met, the calculation result is saved to an array; Perform parallel particle updating according to the calculation results in the array to determine a ghost particle set and / or a local particle set; Perform particle cross-processor transfer on the ghost particle set and / or the local particle set and update the number of particles on the current processor; Iteration is performed according to the number of particles of the current processor until a maximum number of iterations is met.

2. The method according to claim 1, wherein The step of dividing the solution domain in the space to obtain a preset number of sub-regions and allocating the sub-regions to corresponding processors includes: Divide the solution domain in space to obtain a preset number of sub-regions; Assign sub-regions to corresponding processes and require that each corresponding processor is evenly assigned the same number of particles.

3. The method according to claim 1, wherein The step of configuring the sub-regions in the processor and determining the boundary values of the processor includes: Performing region configuration in the processor and setting the region smoothing length to 2h; Read source file information and configure boundary conditions according to the source file information; Calculates the processor's bounds and stores the results in an array.

4. The method according to claim 1, wherein The step of saving the calculation result to an array when the first preset condition is met includes: When the particles in the center portion are calculated and the particles in the boundary portion are received, the particles in the boundary portion are calculated; The calculation results of the particles in the central part and the boundary part are saved in an array.

5. The method according to claim 1, wherein The step of transferring particles of the ghost particle set and / or the local particle set across processors and updating the number of particles of the current processor includes: Sending the ghost particle set to an adjacent processor via asynchronous communication; The particles in the local particle set are reordered. After detecting that the sending and receiving of ghost particles are completed, all particles in the local particle set are added to the array to update the particle number of the current processor. The particle number of the current processor is the sum of the local particle number and the ghost particle number.

6. The method according to claim 5, wherein The step of sending the ghost particle set to an adjacent processor via asynchronous communication comprises: The ghost particle set is sent to an adjacent processor through asynchronous communication, and the positions of the corresponding ghost particles are re-marked.

7. The method according to any one of claims 1 to 6, wherein: The step of iterating according to the number of particles of the current processor until a maximum number of iterations is met includes: Entering a step of performing a parallel neighboring particle search in the processor according to the number of particles in the current processor, and obtaining neighboring particles by dividing the particles in the processor solution area into a preset number of small cells; During iteration, ensure that as the computational scale increases, the time spent traversing and sorting the array holding the particle information is much less than the time spent on particle interactions, maintaining a time gap of more than two orders of magnitude. Output the calculation result when the maximum number of iterations is met.

8. An SPH program acceleration device based on MPI parallelism, characterized in that: The device comprises: A space partitioning module is used to divide the solution domain in space into a preset number of sub-regions and assign the sub-regions to corresponding processors; A boundary configuration module, configured to configure sub-regions in the processor and determine the boundary values of the processor; A neighbor search module is used to perform parallel neighbor particle search in the processor, and obtain neighbor particles by dividing the particles in the processor solution area into a preset number of small cells; A center-boundary module is used to divide the solution area of the processor into a boundary part and a center part, send particles falling into the boundary part to adjacent processors in a non-blocking communication manner, and calculate particles in the center part; A condition judgment module, configured to save the calculation result to an array when a first preset condition is met; A set calculation module, configured to perform parallel particle update according to calculation results in the array to determine a ghost particle set and / or a local particle set; A cross-processor module, configured to transfer particles of the ghost particle set and / or the local particle set across processors and update the number of particles of the current processor; The data iteration module is used to iterate according to the number of particles of the current processor until a maximum number of iterations is met.

9. An MPI-based parallel SPH program acceleration device, characterized in that: The device includes: a memory, a processor, and an MPI parallel-based SPH program acceleration program stored in the memory and runnable on the processor, wherein the MPI parallel-based SPH program acceleration program is configured to implement the steps of the MPI parallel-based SPH program acceleration method as described in any one of claims 1 to 7.

10. A medium, characterized in that The medium stores an MPI-parallel-based SPH program acceleration program, which, when executed by a processor, implements the steps of the MPI-parallel-based SPH program acceleration method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Large-scale parallel processing method of moving particle semi-implicit method

    CN102902514A

  • Vectorization parallel computing method and device for SPH (Shortest Path Hierarchy)

    CN112989683A