Hy-GA parallel solving method for solving seepage equation based on domestic CPU + DCU architecture

By adopting the Hy-GA parallel solution method based on the domestic CPU+DCU architecture in the numerical simulation of oil and gas reservoirs, combined with the characteristics of algebraic multiple grids and geometric multiple grids, the problems of low parallel solution efficiency and poor convergence effect of seepage mechanical equations are solved. , realize efficient and accurate numerical simulation results.

CN119416693AActive Publication Date: 2025-02-11UNIV OF SCI & TECH BEIJING
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411458842.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-02-11
Estimated Expiration
2044-10-18

AI Technical Summary

Technical Problem

In the numerical simulation of oil and gas reservoirs, the parallel solution efficiency of seepage mechanical equations is low and the convergence effect is poor, resulting in insufficient computing resources and calculation bottleneck problems.

Method used

A parallel solution method of Hy-GA based on domestic CPU+DCU architecture is proposed. Combined with the characteristics of algebraic multiple grids and geometric multiple grids, an appropriately shaped hybrid multiple grid is designed to solve the seepage mechanical equation. This method performs specific operations separately in the initialization, setting, solving and output stages, and takes advantage of the computing advantages of the domestic CPU+DCU architecture to realize large-scale parallel computing.

Benefits of technology

Through the Hy-GA parallel solution method, the parallel solution efficiency of seepage mechanical equations is improved, the convergence effect is improved, the calculation bottleneck problem caused by insufficient traditional computing resources is solved, and the accuracy of the simulation results is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119416693A_ABST
    Figure CN119416693A_ABST
Patent Text Reader

Abstract

The invention discloses a Hy-GA parallel solving method for solving a seepage equation based on a domestic CPU + DCU architecture, and belongs to the technical field of high-performance computing. According to the method, on the basis of the calculation advantages of a domestic CPU + DCU architecture, the characteristics of algebraic multiple grids and geometric multiple grids are combined, and suitable mixed multiple grids are designed to solve a seepage mechanical equation; according to the method, large-scale parallel computing is carried out by utilizing a domestic supercomputing architecture, a simulation task can be decomposed and processed in parallel, and finer grid division and a more complex physical model are allowed to be used, so that the precision of a simulation result is improved, and the problem of computing bottleneck caused by insufficient traditional computing resources is solved. In addition, a mixed multi-grid precondition is used in the method, a geometric multi-grid aggregation coarsening method is used for constructing a coarse grid level, and a coefficient matrix is constructed based on a Galerkin operator of algebraic information; the complexity of constructing a coefficient matrix is reduced while the physical characteristics are kept as much as possible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of high performance computing technology, and in particular to a Hy-GA parallel solution method for solving a seepage equation based on a domestic CPU+DCU architecture. Background Art

[0002] The seepage mechanics equation has a wide range of applications in engineering fields such as numerical simulation of oil and gas reservoirs. Numerical simulation of oil and gas reservoirs refers to the establishment of a mathematical model for oil and gas reservoir simulation by computer. Under the control of boundary conditions, the partial differential equations are converted into discrete grid points and solved by iterative methods, such as Figure 1 As shown in the figure, it mainly includes a complete reservoir numerical model, which mainly includes a set of partial equations of seepage mechanics and boundary conditions (boundary conditions, initial conditions). These conditions restrict the subsequent discretization into grid points and finally give the oil and water distribution at a certain moment to predict the reservoir dynamics.

[0003] Solving the permeability mechanics equations is the core of numerical simulation. Some of the equations included are as follows: Component mass conservation equation: Seepage equation of motion: Energy conservation equation: State equation: (1) Component ratio relationship: (2) Saturation relationship: (3) Surface tension P c (S j )=P1-P j =f(S j ), (4) Multiple equilibrium equations: f ij =f i1 ,i=1:n c ,j=1:n p , and the well pressure control equation: etc.

[0004] Based on the above partial differential equations, after discretization, they are solved by a three-step iterative method. The process is as follows: Figure 2As shown in the figure, it mainly includes the following steps: (1) Time step selection: start a new time step, i = 0; (2) Newton iteration: construct the residual and Jacobi matrix. Check convergence, if converged, enter the next time step; if not converged, continue to perform Newton maximum iteration; (3) Linear solution: solve linear equations. Check linear convergence, if linear convergence, continue nonlinear iteration; if not converged, redo the step size; (4) Redo step size: if Newton maximum iteration does not converge, redo the time step size. Among them, the linear solver is the main bottleneck of parallel computing, accounting for more than 80% of the workload in the solution process of the entire permeability mechanics equation set. In the numerical simulation of oil and gas reservoirs, the massive fine grid simulation of oil and gas reservoirs leads to large coefficient matrix size, bad properties, poor convergence, and irregular sparsity; the above problems affect the improvement of the parallel solution efficiency of coupled nonlinear equations. Therefore, we need a numerical solution method with strong convergence and good stability.

[0005] For large-scale numerical simulations, the multigrid (MG) algorithm has been proven to be one of the most efficient preconditioning acceleration algorithms for solving linear equations. The basic idea of ​​multigrid (MG) is to restrict the original linear system to a coarse grid, determine an approximate solution on the coarse grid, and then interpolate back to the fine grid to correct the initial solution.

[0006] There are two types of multigrid preprocessing acceleration algorithms: one is geometric multigrid (GMG) and the other is algebraic multigrid (AMG). The GMG algorithm usually needs to divide the discrete and physical grids according to known geometric figures, which is a real grid division; AMG does not need to use the physical and geometric background of the problem to solve, but only uses the algebraic information in the coefficient matrix of the equation system to construct a virtual multigrid. The difference between GMG and AMG lies in the construction of the coarse grid level and the coarse grid coefficient matrix A. C , the specific process and differences are as follows Figure 3 As shown in Figure 1, it starts from the large sparse linear equations obtained after discretization, which mainly includes the following contents:

[0007] Initialization processing: grid coarsening, restriction operator and interpolation operator processing.

[0008] Pre-smoothing: Perform smoothing to reduce high-frequency errors.

[0009] Residual constraint: constrain the residual on the fine grid to the coarse grid and construct the correction equation.

[0010] Coarse grid solution: Solve the correction value on the coarse grid and then perform pre-smoothing.

[0011] Grid correction: Add the correction amount to the initial solution to perform grid correction.

[0012] Post-smoothing: Smoothing is performed again to reduce low-frequency errors.

[0013] Convergence verification: When the error reaches the given tolerance, it converges, otherwise continue to iterate until the convergence condition is met.

[0014] The corresponding relationship between GMG and AMG is as follows:

[0015]

[0016] The two have their own advantages and disadvantages in accelerating the linear solution algorithm in numerical simulation: algebraic multigrid directly starts from the coefficient matrix of the equation and abstracts the grid into the form of a matrix (such as Figure 4 The following is the AMG common coarse grid point selection method:

[0017] Node i strongly depends on j, or j strongly affects i, if and only if: Where α∈(0,1); generally speaking, α is 0.25 to 0.5. Different literatures have different details on the determination of strong connections. For example, the determination method in "Rajesh Gandham a, Kenneth Esler b, Yongpeng Zhang bA GPU accelerated aggregation algebraic multigrid method. Computers and Mathematics with Applications. 2014" is:

[0018]

[0019] The coarse grid is generated by the connectivity in the matrix nodes to generate a strongly connected matrix, which is applicable to a wider range of scenarios. However, for complex grid structures with higher dimensions, the connectivity of the grid nodes is enhanced, and the cost of the setup phase increases dramatically. For geometric multigrids, it is necessary to use the initial grid, generate a coarse grid for each layer according to the problem background, and traverse each grid point to calculate the corresponding coefficient matrix. This works best when the problem geometry background is known, but the calculation amount is large and the operation is more complicated.

[0020] Therefore, if traditional GMG or AMG is used for preprocessing alone, the efficiency of GMG may decrease when the grid structure is complex or irregular; AMG converges slowly when processing highly heterogeneous or highly anisotropic media. The hybrid preprocessing method of GMG and AMG (Hy-GA) can combine the advantages of both and achieve better results.

[0021] In the field of efficient solution of seepage mechanics equations, it is often necessary to combine the geometric physical background of the problem and improve the efficiency of parallel solution. In view of this, the present invention combines the characteristics of both and proposes a Hy-GA parallel solution method for solving seepage equations based on the domestic CPU+DCU architecture. At the same time, the computing advantages of the domestic CPU+DCU architecture are utilized to design a hybrid multi-grid heterogeneous parallel solution. Summary of the invention

[0022] The purpose of the present invention is to propose a Hy-GA parallel solution method for solving the seepage equation based on the domestic CPU+DCU architecture to solve the problems of poor convergence effect and low efficiency of parallel solution of seepage mechanics equations in reservoir numerical simulation.

[0023] In order to achieve the above object, the present invention adopts the following technical solutions:

[0024] The Hy-GA parallel solution method for solving the seepage equation based on the domestic CPU+DCU architecture is based on the computing advantages of the domestic CPU+DCU architecture, combined with the characteristics of algebraic multigrid and geometric multigrid, and an adaptive hybrid multigrid is designed to solve the seepage mechanics equation. The specific contents include the following:

[0025] S1, initialization phase: read coefficient matrix and vector data, and initialize algorithm parameters and grid hierarchy on the CPU side;

[0026] S2, setup phase: construct a multi-grid hierarchy and move the data stored in the memory to the video memory of the DCU through the memory copy function Memcpy between the CPU and the DCU; in this phase, all computing operations are completed in the DCU;

[0027] S3, solution stage: using the multi-grid hierarchy structure constructed in S2 to perform iterative solution between multiple grids; in the solution stage, repeat the pre-smoothing, residual limitation, coarsest grid layer solution, interpolation correction, and post-smoothing operations;

[0028] S4, output stage: when the number of iterations in the stage to be solved is not less than the preset maximum number of iterations or the current residual is less than the preset tolerance, the solution stage ends and the iteration information and execution time of each layer are output.

[0029] Preferably, the initialization operation in S1 includes the following contents: initializing the MPI environment and the DCU environment, determining the workspace and number of threads of each process, specifically: dividing the fine grid into blocks, and assigning each block to an MPI process; and using OpenMP and DCU in each MPI process to divide each grid into multiple threads and DCU processing.

[0030] Preferably, S2 specifically includes the following contents:

[0031] S2.1. Constructing the grid hierarchy: Using the geometric characteristics of geometric multigrids, a smooth aggregation method is used to construct a coarse grid hierarchy, denoted as There are n layers of grids, where Ω 1 The first layer is the initial fine grid;

[0032] S2.2. Constructing the transfer operator: Using the geometric relationship between the coarse and fine grids, we construct the interpolation operator, denoted as The restriction operator is constructed by using the algebraic characteristics between coarse and fine grids, denoted as

[0033] S2.3. Construct coefficient matrix: Using the algebraic properties of algebraic multigrid, construct the coefficient matrix based on the Galerkin operator, denoted as

[0034] Preferably, S3 specifically includes the following contents:

[0035] S3.1. Obtaining the initial solution: construct the initial equation AX=B, iterate the initial equation, obtain the initial solution X0, and calculate the residual r0=B-AX0, and transfer it to Ω by restricting the operator 2 In the coarse layer;

[0036] S3.2. Construct the coarse grid equation: The coefficient matrix on the coarse grid is denoted as The residual equation is derived from this formula, and the specific formula is expressed as:

[0037]

[0038] After the residual is obtained, it is transferred to the next grid layer through the restriction operator to obtain A k+1 e k+1 =r k+1 , until Ω n Coarsest grid layer;

[0039] S3.3. Coarse grid correction: reaching Ω n Then, we can directly solve for e n , through the interpolation operator, interpolate back to the fine grid to correct the initial solution. The specific formula is expressed as:

[0040]

[0041] Preferably, non-blocking communication is adopted as a communication mode between the multi-grids of the constructed multi-grid hierarchy to reduce communication overhead.

[0042] Preferably, the pre-smoothing and post-smoothing operations specifically refer to: applying a smoothing operator at each grid level; allocating part of the smoothing calculation tasks to the DCU, and using OpenMP to process the rest in parallel to ensure synchronous communication and update of boundary data.

[0043] Preferably, the residual limitation specifically refers to transferring the residual of the fine grid to the coarse grid through a limitation operator; and the interpolation correction specifically refers to transferring the solution of the coarse grid back to the fine grid through an interpolation operator.

[0044] Preferably, in the solution phase, a global error is calculated through a global reduction operation, and whether to continue iteration is determined based on the calculated error.

[0045] Compared with the prior art, the present invention provides a Hy-GA parallel solution method for solving the seepage equation based on the domestic CPU+DCU architecture, which has the following beneficial effects:

[0046] (1) The present invention proposes a Hy-GA parallel solution method for solving the seepage equation based on the domestic CPU+DCU architecture. Based on the computing advantages of the domestic CPU+DCU architecture and combining the characteristics of algebraic multigrid and geometric multigrid, an adaptive hybrid multigrid is designed to solve the seepage mechanics equation. The present invention utilizes the domestic supercomputer architecture for large-scale parallel computing, which can decompose the simulation task into parallel processing, allowing the use of finer grid division and more complex physical models, which not only improves the accuracy of the simulation results, but also solves the computing bottleneck problem caused by insufficient traditional computing resources.

[0047] (2) The hybrid multigrid preconditioning used in the present invention uses a geometric multigrid aggregation coarsening method to construct the coarse grid level, while constructing the coefficient matrix based on the Galerkin operator of algebraic information; while maintaining the physical properties as much as possible, the complexity of constructing the coefficient matrix is ​​reduced.

[0048] In summary, the present invention combines the advantages of algebraic multigrid (AMG) and geometric multigrid (GMG), not only maintaining a certain degree of adaptability, but also reducing the cost of constructing operators. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is a schematic diagram of a mathematical model for numerical simulation of oil and gas reservoirs mentioned in the background technology of the present invention;

[0050] Figure 2 It is a flow chart of the time iteration algorithm mentioned in the background technology of the present invention;

[0051] Figure 3 The whole calculation process (CPU serial) diagram of the multi-grid mentioned in the background technology of the present invention;

[0052] Figure 4 A schematic diagram of the basic concept and principle of the algebraic multigrid (AMG) mentioned in the background technology of the present invention;

[0053] Figure 5 A schematic diagram of a multi-grid V-loop iteration strategy mentioned in the background technology of the present invention;

[0054] Figure 6 A schematic diagram of the MPI / OpenMP parallel model mentioned in an embodiment of the present invention;

[0055] Figure 7 The overall flow chart of the Hy-GA parallel solution method for solving the seepage equation based on the domestic CPU+DCU architecture mentioned in the embodiment of the present invention;

[0056] Figure 8 Schematic diagram of the supercomputer structure mentioned in the embodiment of the present invention;

[0057] Fig. 9 This is a schematic diagram of the domestic DCU+CPU hybrid architecture mentioned in an embodiment of the present invention;

[0058] Fig.10 The present invention is a flowchart of creating an aggregation map mentioned in an embodiment of the present invention. DETAILED DESCRIPTION

[0059] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.

[0060] Embodiment 1:

[0061] The present invention proposes a Hy-GA parallel solution method for solving the seepage equation based on the domestic CPU+DCU architecture. Compared with the existing design, the present invention has the following advantages:

[0062] Complementary advantages of hybrid pretreatment:

[0063] (1) Initial approximation: Geometric multigrid (GMG) can provide a good initial approximation, which helps to accelerate the convergence of algebraic multigrid (AMG).

[0064] (2) Coarsening process: The coarsening process of geometric multigrid (GMG) and algebraic multigrid (AMG) can be used complementary. For example, you can first use geometric multigrid (GMG) to perform several coarsenings, and then use algebraic multigrid (AMG) on a coarser grid to process, which can better handle complex geometric structures and heterogeneity.

[0065] (3) Smoothing: Geometric multigrid (GMG) usually performs smoothing on a finer grid, while algebraic multigrid (AMG) can perform efficient smoothing on a coarser grid. Their combined use can improve the overall smoothing effect.

[0066] (4) Adapting to complex physical phenomena: Numerical simulation of oil reservoirs often involves complex phenomena such as multiphase flow and multicomponent transport. Hybrid preprocessing methods can better adapt to these complex physical phenomena and improve the stability and accuracy of simulation.

[0067] At the same time, on the basis of keeping the basic principles of reservoir numerical simulation unchanged, a heterogeneous parallel multi-grid preprocessing method based on the MPI / OpenMP model is used to give full play to the following advantages of heterogeneous parallel computing:

[0068] (1) Improved computing power: DCU has significant advantages in processing large-scale parallel computing tasks, especially in matrix operations, vector operations, etc., and can provide much higher computing power than CPU. Distributing the preprocessing of geometric multigrid (GMG) and algebraic multigrid (AMG) to DCU can significantly improve the computing efficiency of the solution stage.

[0069] (2) Maximizing resource utilization: By taking advantage of the different strengths of the CPU and DCU, hardware resources can be maximized. The CPU is good at processing complex logic control and serial calculations, while the DCU is good at large-scale data parallel calculations. Assigning appropriate tasks to the corresponding hardware can improve overall efficiency.

[0070] (3) Task parallelization: Many steps of geometric multigrid (GMG) and algebraic multigrid (AMG) (such as grid generation, coarsening, smoothing, interpolation, etc.) can be parallelized. Heterogeneous parallel computing can distribute these tasks to multiple computing units for parallel execution, thereby significantly reducing the computing time and making the Jacobian coefficient matrix solution more efficient, thereby improving the efficiency of reservoir numerical simulation.

[0071] In order to more clearly describe the specific steps of the Hy-GA parallel solution method for solving the percolation equation based on the domestic CPU+DCU architecture proposed in the present invention, some terms are explained as follows:

[0072] (1) Smoothing operator: also called preconditioner, used to eliminate high-frequency error components on each layer of coarse grid. Commonly used smoothing operators are Gaussian and Jacobi relaxation iterative methods.

[0073] (2) Transfer operator: including interpolation operator and restriction operator. The interpolation matrix is ​​used to transfer the solution or residual information from the coarse grid to the fine grid; the restriction matrix is ​​used to transfer the solution or residual information of the fine grid to the coarse grid.

[0074] (3) Mesh coarsening: The initial fine mesh is transformed into a mesh hierarchy with fewer mesh points and larger intervals through certain geometric relationships or strong connectivity.

[0075] (4) V-cycle: Iterative cycle strategy for multiple grids, such as Figure 5 As shown, the present invention adopts a two-layer coarse grid structure. In the initialization stage, two layers of coarse grids are constructed, and the V-loop strategy is called to recursively solve the coarse grid equation once until the coarsest grid layer.

[0076] (5)CPU-DCU architecture: Figure 8 , Fig. 9 As shown in the figure, it is a domestic CPU+DCU architecture; both DCU and CPU have their own memory (of course, there are some heterogeneous architectures similar to DCU, which share memory space with the CPU, such as integrated graphics cards. However, the current supercomputer architecture, such as Summit, Frontier, and domestic DCU series supercomputers, are basically designed with GPU / DCU and CPU memory separated). Based on this storage and supercomputer hardware architecture, which is different from Shenwei, the general idea of ​​heterogeneous acceleration and parallelization is:

[0077] 1) Copy data from CPU memory to DCU memory (called Host to Device or H2D);

[0078] 2) Start the kernel to perform calculations on the DCU;

[0079] 3) Copy the data from the DCU memory back to the CPU memory (Device to Host or D2H);

[0080] 4) The CPU performs necessary calculations or communications.

[0081] When the CPU and DCU communicate, there will inevitably be overhead. At the same time, the calculation optimization of calculation-intensive tasks is also the key to improving the computing performance of the DCU. The present invention uses the following method to make improvements:

[0082] 1) Split the data appropriately;

[0083] 2) Use different streams for transmission and calculation;

[0084] 3) Branch optimization: DCU has weak control over logic, so branches should be minimized;

[0085] 4) The time-consuming parts of matrix calculation optimization include vector addition and subtraction operations, scalar and vector multiplication operations, and matrix and vector multiplication operations; the parallel solution studied adopts the LightSpMV method.

[0086] (6) MPI / OpenMP parallel model: Figure 6 As shown in the figure, MPI provides a mechanism for inter-process communication, which is suitable for parallel programs that need to transfer data between multiple computing nodes; OpenMP is a parallel programming standard for shared memory systems, which provides a communication mechanism between threads; MPI single-core expansion multiple nodes, each area is placed on a computing node: the initial grid can be divided into regions, each process processes a grid area, and completes a solution process; in this process, the smoothing of each layer of coarse grid is completed in parallel through OpenMP threads, and finally the results are summarized into one process.

[0087] See also Figure 7 , the specific process of the Hy-GA parallel solution method for solving the seepage equation based on the domestic CPU+DCU architecture proposed in the present invention is described as follows:

[0088] Setup phase:

[0089] (1) Constructing the grid hierarchy: The geometric properties of the geometric multigrid (GMG) are used to construct the coarse grid hierarchy using the smooth aggregation method. There are n layers of grids, where Ω 1 is the initial fine mesh of the first layer.

[0090] (2) Transfer operator construction: construct interpolation operators using the geometric relationship between coarse and fine grids Constructing Restriction Operators Using Algebraic Properties

[0091] (3) Construction of coefficient matrix: Using the characteristics of AMG algebra, the coefficient matrix is ​​constructed based on the Galerkin operator.

[0092] Solve:

[0093] (1) Obtaining the initial solution: Perform a few simple iterations (smoothing) on ​​the initial equation AX = B to obtain the initial solution X0. At the same time, the residual r0 = B-AX0 is calculated and transferred to Ω by the restriction operator. 2 In the coarse level.

[0094] (2) Constructing the coarse grid equation: Coefficient matrix on the coarse grid The residual equation can be derived from the formula After the residual is obtained, it is transferred to the next grid layer through the restriction operator to obtain A k+1 e k+1 =r k+1 , until Ω n Coarsest grid layer.

[0095] (3) Coarse grid correction: reaching Ωn , directly solve for e n , through the interpolation operator, interpolate back to the fine grid to correct the initial solution,

[0096] MG's heterogeneous parallel design solution:

[0097] Grid division and allocation: Divide the fine grid into blocks, and assign each block to an MPI process. In each MPI process, OpenMP and DCU are used to divide each grid block into multiple threads and DCUs for processing. Figure 6 shown.

[0098] Communication mode: Use non-blocking communication (such as MPI_Isend and MPI_Irecv) to reduce communication overhead. Ensure the correct transmission and update of boundary data.

[0099] Parallel heterogeneous implementation details:

[0100] initialization:

[0101] Initialize the MPI environment (MPI_Init).

[0102] Initialize the DCU environment (such as OpenCL, CUDA).

[0103] Determine the number of workspaces and threads per process.

[0104] Smooth steps:

[0105] Apply smoothing operators at each grid level. Assign parts of the smoothing computation tasks to DCUs and process the rest in parallel using OpenMP. Ensure synchronous communication (using MPI) to update boundary data.

[0106] Limits and interpolation:

[0107] By restricting the operator, the residual of the fine grid is transferred to the coarse grid. It can be accelerated on the DCU.

[0108] The solution of the coarse grid is transferred back to the fine grid through the interpolation operator. It can be accelerated on the DCU.

[0109] Convergence judgment:

[0110] Calculate the global error through global reduction operations (such as MPI_Rce). Determine whether to continue iterating based on the error.

[0111] In traditional reservoir numerical simulation, the seepage equations often involve complex physical phenomena such as multiphase flow, heat conduction and geomechanics, and require the processing of large amounts of geological data, logging data and production data. Traditional computing platforms find it difficult to efficiently process these examples. As domestic supercomputers enter the E-class era, the powerful computing power of domestic DCUs can significantly shorten simulation time, improve computing efficiency, and have powerful data processing and storage capabilities, capable of quickly storing, retrieving and processing big data. At the same time, domestic supercomputer architectures support large-scale parallel computing, which can decompose simulation tasks for parallel processing, allowing the use of finer grid divisions and more complex physical models, which not only improves the accuracy of simulation results, but also solves the computing bottleneck problem caused by insufficient traditional computing resources.

[0112] In general numerical simulations, such as CFD, electromagnetic field simulation, structural mechanics, etc., multi-grid preprocessing technology is widely used. However, most of them use algebraic multi-grid (AMG). The reason is that there is no need to consider the complex geometric background of the problem, and the approximate solution of the problem can be quickly solved, which has a wider applicability. However, this method may ignore the impact of changes in geometric information stored on the grid on the accuracy of the solution when it is necessary to construct a grid level according to the problem background. Therefore, the hybrid multi-grid preconditioning used in the present invention uses a geometric multi-grid aggregation coarsening method in constructing a coarse grid level, and the construction of the coefficient matrix is ​​based on the Galerkin operator of algebraic information. While maintaining the physical properties as much as possible, the complexity of the construction coefficient matrix is ​​reduced.

[0113] GMG AMG HyGA (Hybrid Multigrid Preprocessing) Memory requirements Low High Low Operator complexity Less costly More costly Less costly Matrix quality High Less control High at finer levels User-friendliness Less friendly More friendly Intermediate Irregular domains Not robust Robust Robust

[0114] In summary, it can be seen that the adaptive hybrid multigrid (Hy-GA) proposed in the present invention combines the advantages of GMG and AMG, not only maintaining a certain degree of adaptability, but also reducing the cost of constructing operators.

[0115] Embodiment 2:

[0116] Based on Example 1 but different in that, please refer to Figure 7-8 The execution process of the adaptive hybrid multigrid (Hy-GA) proposed by the present invention specifically includes the following contents:

[0117] Header files and libraries:

[0118] #include<mpi.h>

[0119] #include<omp.h>

[0120] #include <vector>

[0121] #include <iostream>

[0122] #include "dcu_utils.h" / / DCU tool library, providing DCU initialization, data transmission and calculation functions

[0123] Define the MG structure:

[0124] Contains the data stored in each grid layer (coefficient matrix, right-hand term b, etc.), AMG level and GMG level, as well as smoothing operator processing methods, interpolation methods, and methods for calculating residuals.

[0125]

[0126]

[0127]

[0128]

[0129] Define the method of clustering to construct the coarse grid level:

[0130] (Assuming criterion = smooth aggregation coarsening algorithm)

[0131] createCoarseLevelSystem(const O&fineOperator) / / pass in the initial fine grid, aggregation strategy criterion

[0132] {

[0133] P = criterion_.getProlongationDampingFactor(); / / P is the interpolation matrix

[0134] / *

[0135] ①Use the matrix of fine operators to create a matrix graph (MatrixGraph), and then build a property graph (PropertiesGraph) based on this graph. These graphs are used to save the topological structure of the matrix, including the properties of vertices and edges.

[0136] MG::MatrixGraph<const typename O::matrix_type> MatrixGraph;

[0137] MG::PropertiesGraph <MatrixGraph,Dune::Amg::VertexProperties,Dune::Amg::EdgeProperties,Dune::IdentityMap,Dune::IdentityMap> PropertiesGraph

[0138] / *

[0139] ② Creation of aggregate map: The aggregate map is constructed through the attribute graph and the judgment criteria. The construction process returns the number of four different types of aggregates: ordinary aggregates, isolated aggregates, single aggregates, and skipped aggregates. In order to optimize storage and calculation, a renumberer is used to renumber the aggregates.

[0140] MG::tie(noAggregates,isoAggregates,oneAggregates,skippedAggregates)=aggregatesMap_>buildAggregates(fineOperator.getmat(),PropertiesGraph;MatrixGraph,criterion_,true);

[0141] ③ Galerkin operator calculation coefficient matrix: (A″=p r AP)

[0142] GerlerkinProductBuilder.calculate(P, fineOperator.getmat(),*aggregatesMap_,*matrix)

[0143] }

[0144] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. For ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles described in the present invention, and these improvements and modifications should also be regarded as the protection scope of the present invention.< / iostream> < / vector>

Claims

1. A Hy-GA parallel solution method for solving the seepage equation based on the domestic CPU+DCU architecture, characterized in that: Based on the computing advantages of the domestic CPU+DCU architecture, combined with the characteristics of algebraic multigrid and geometric multigrid, an adaptive hybrid multigrid is designed to solve the seepage mechanics equations, including the following contents: S1, initialization phase: read coefficient matrix and vector data, and initialize algorithm parameters and grid hierarchy on the CPU side; S2, setup phase: construct a multi-grid hierarchy and move the data stored in the memory to the video memory of the DCU through the memory copy function Memcpy between the CPU and the DCU; in this phase, all computing operations are completed in the DCU; S3, solution stage: using the multi-grid hierarchy structure constructed in S2 to perform iterative solution between multiple grids; in the solution stage, repeat the pre-smoothing, residual limitation, coarsest grid layer solution, interpolation correction, and post-smoothing operations; S4, output stage: when the number of iterations in the stage to be solved is not less than the preset maximum number of iterations or the current residual is less than the preset tolerance, the solution stage ends and the iteration information and execution time of each layer are output.

2. The Hy-GA parallel solution method for solving the seepage equation based on the domestic CPU+DCU architecture according to claim 1 is characterized in that: The initialization operation described in S1 includes the following contents: initializing the MPI environment and the DCU environment, determining the workspace and number of threads of each process, specifically: dividing the fine grid into blocks, and assigning each block to an MPI process; and using OpenMP and DCU in each MPI process to divide each grid block into multiple threads and DCUs for processing.

3. The Hy-GA parallel solution method for solving the seepage equation based on the domestic CPU+DCU architecture according to claim 2 is characterized in that: The S2 specifically includes the following contents: S2.

1. Constructing the grid hierarchy: Using the geometric characteristics of geometric multigrids, a smooth aggregation method is used to construct a coarse grid hierarchy, denoted as There are n layers of grids, where Ω 1 The first layer is the initial fine grid; S2.

2. Constructing the transfer operator: Using the geometric relationship between the coarse and fine grids, we construct the interpolation operator, denoted as The restriction operator is constructed by using the algebraic characteristics between coarse and fine grids, denoted as S2.

3. Construct coefficient matrix: Using the algebraic properties of algebraic multigrid, construct the coefficient matrix based on the Galerkin operator, denoted as 4. The Hy-GA parallel solution method for solving the seepage equation based on the domestic CPU+DCU architecture according to claim 3 is characterized in that: The S3 specifically includes the following contents: S3.

1. Obtaining the initial solution: construct the initial equation AX=B, iterate the initial equation, obtain the initial solution X0, and calculate the residual r0=B-AX0, and transfer it to Ω by restricting the operator 2 In the coarse layer; S3.

2. Construct the coarse grid equation: The coefficient matrix on the coarse grid is denoted as The residual equation is derived from this formula, and the specific formula is expressed as: After the residual is obtained, it is transferred to the next grid layer through the restriction operator to obtain A k+1 e k+1 =r k+1 , until Ω n Coarsest grid layer; S3.

3. Coarse grid correction: reaching Ω n Then, we can directly solve for e n , through the interpolation operator, interpolate back to the fine grid to correct the initial solution. The specific formula is expressed as:

5. The Hy-GA parallel solution method for solving the seepage equation based on the domestic CPU+DCU architecture according to claim 4 is characterized in that: Non-blocking communication is used as the communication mode between the multi-grids of the constructed multi-grid hierarchy to reduce communication overhead.

6. The Hy-GA parallel solution method for solving the seepage equation based on the domestic CPU+DCU architecture according to claim 1 is characterized in that: The pre-smoothing and post-smoothing operations specifically refer to: applying a smoothing operator at each grid level; allocating part of the smoothing calculation tasks to the DCU, and using OpenMP to parallelly process the rest to ensure synchronous communication and update boundary data.

7. The Hy-GA parallel solution method for solving the seepage equation based on the domestic CPU+DCU architecture according to claim 1 is characterized in that: The residual limitation specifically refers to transferring the residual of the fine grid to the coarse grid through a limitation operator; the interpolation correction specifically refers to transferring the solution of the coarse grid back to the fine grid through an interpolation operator.

8. The Hy-GA parallel solution method for solving the seepage equation based on the domestic CPU+DCU architecture according to claim 1 is characterized in that: In the solving stage, a global error is calculated through a global reduction operation, and whether to continue iteration is determined based on the calculated error.

Citation Information

Patent Citations

  • Heterogeneous many-core architecture-oriented parallel characteristic line method transport scanning method and device

    CN113391932A

  • Parallel computing method of cluster dynamics method oriented to DCU-CPU hybrid architecture

    CN114490046A

  • SW architecture-oriented fluid dynamics multi-grid solver parallel optimization method

    CN115906684A

  • Sparse AMG optimization method for CPU + DCU heterogeneous hybrid architecture

    CN116150553A

  • Parallel immersion boundary method and device based on DCU accelerator

    CN117972276A