Task processing method, apparatus and system
By determining the grid data partitioning method and reconstructing the submatrix in the solver, the problem of poor quality of preconditioners is solved, which improves the convergence and computational efficiency of iterative solution of linear equation systems.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2025-12-05
- Publication Date
- 2026-06-25
Smart Images

Figure CN2025140380_25062026_PF_FP_ABST
Abstract
Description
A task processing method, apparatus and system
[0001] Cross-references to related applications
[0002] This application claims priority to Chinese Patent Application No. 202411912750.6, filed on December 20, 2024, entitled “A Task Processing Method and Apparatus”, the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application relates to the field of computing, and more particularly to a task processing method, apparatus, and system. Background Technology
[0004] Structured meshes are prevalent and crucial in many scientific and engineering applications. A structured mesh refers to a mesh structure in which mesh cells are arranged in space according to certain rules. Such meshes are commonly used in fields such as numerical simulation and computational fluid dynamics (CFD) to capture and simulate complex physical phenomena.
[0005] Typically, structured grid problems, after mathematical physics modeling, include a key module—solving partial differential equations (PDEs). After numerical discretization of the PDEs, the structured grid problem is transformed into solving a large-scale sparse linear system of equations Ax = b. Here, A is the coefficient matrix, usually a large-scale sparse matrix, b is a known vector, and x is the vector to be solved. Iterative methods are an important class of methods for solving sparse linear systems of equations. Iterative methods gradually approximate the solution x of the linear system of equations through iterative correction. Preconditioners are a key technique for accelerating iterative methods. In multi-process parallel solving of linear systems of equations, the application needs to divide the coefficient matrix into multiple sub-matrices, assign these sub-matrices to multiple processes for parallel solving, and construct preconditioners in parallel based on these sub-matrices. The quality of the preconditioners affects the convergence of the iterative method.
[0006] Currently, in some scenarios, the quality of the preconditioners constructed by the process is poor, which seriously affects the convergence of iterative solutions to linear equation systems. Summary of the Invention
[0007] This application provides a task processing method, apparatus, and system that can be used to improve the convergence of iterative solutions to linear equation systems.
[0008] Firstly, this application provides a task processing method, which can be executed by a computing device. The method includes: the computing device acquiring a coefficient matrix of a linear equation system corresponding to grid data, wherein the grid data includes multiple grid point data points; a linear equation system can be constructed by mathematically processing the grid point data points included in the grid data, the linear equation system including a coefficient matrix, the values in the coefficient matrix representing the relationship between each grid point data point and other grid point data points; and solving the linear equation system using a solver, whereby N sub-matrices included in the coefficient matrix can be assigned to N processes for parallel solving. The processing of the grid data by the computing device may include: the multiple grid point data points being divided into N sub-grids according to a first partitioning method. The grid data consists of N sub-grids, each corresponding to one of the N sub-matrices in the coefficient matrix (denoted as the first sub-matrices). Each of the N first sub-matrices corresponds one-to-one with one of the N processes in the solver, meaning each first sub-matrice is executed by one process. N is a positive integer not less than 2. After obtaining the N first sub-matrices, the relationship between the grid points in each of these N first sub-matrices is used to determine whether the N first sub-matrices obtained according to the first partitioning method are suitable for the solver to perform the solution operation on the linear equation system. If not, the grid data is partitioned according to the second partitioning method to obtain the N second sub-matrices corresponding to the coefficient matrix. The solver then executes the N processes corresponding to these N second sub-matrices to perform the solution operation.
[0009] Through the above design, before performing the solution operation on the linear equation system, it is first determined whether the N first sub-matrices obtained by the first partitioning method are suitable for performing the solution operation. If they are not suitable, the second partitioning method is used to reconstruct the N second sub-matrices. This avoids the solver using the unsuitable N first sub-matrices to perform the solution operation. By reconstructing the N second sub-matrices, the convergence of the solution operation is improved, the number of iterations is reduced, computing resources are saved, and the task processing time is shortened.
[0010] In one alternative design, the N second sub-matrices are obtained by transforming the N first sub-matrices; therefore, the N second sub-matrices obtained by partitioning the grid data according to the second partitioning method are determined as follows:
[0011] Taking any one of the N second sub-matrices (e.g., the third sub-matrice) as an example, the following steps are performed on the third sub-matrice: determine the first dot data corresponding to the third sub-matrice; determine the position of the first dot data (related values / elements) in the N first sub-matrices; control the process corresponding to the third sub-matrice to perform a shuffle operation with the process corresponding to the first sub-matrice at the determined position (e.g., the value at the determined position in the fourth sub-matrice) to obtain the data in the linear equation corresponding to the first dot data (e.g., the value at the determined position in the fourth sub-matrice) to construct the third sub-matrice; the first dot data is any dot data included in the sub-grid data corresponding to the third sub-matrice obtained by the second partitioning method; construct the other sub-matrices in the N second sub-matrices in the same way as constructing the third sub-matrice.
[0012] In one alternative design, each point in the grid data is encoded according to a first partitioning method, and each point has a number; determining the position of the first point in the N first sub-matrices includes: determining the position of the first point in the N first sub-matrices (such as the fourth sub-matrice) based on the number of the first point.
[0013] In one optional design, the grid data is multidimensional grid data with multiple dimensional directions. The determination of whether the N first sub-matrices obtained according to the first partitioning method are suitable for the solver to perform the solution operation on the linear equation system is based on the relationship between the grid points in each of the N first sub-matrices. This includes: determining whether the grid data is anisotropic based on the values in the coefficient matrix; if the grid data is anisotropic, and the direction of anisotropy is the first dimension direction of the multidimensional grid data (denoted as the first direction), and the main partitioning direction of the first partitioning method is the first direction, then it is determined that the N first sub-matrices obtained by the first partitioning method are not suitable for the solver to perform the solution operation. The main partitioning direction being the first direction means that when the multidimensional grid data is divided into N first sub-matrices according to the first partitioning method, the number of partitions along the first direction of the multidimensional grid data is greater than the number of partitions along other directions. For example, the number of partitions along the first direction refers to dividing the grid data into several groups of sub-grid data perpendicular to the first direction.
[0014] Through the above design, when the first partitioning method does not follow the anisotropic direction of the structured mesh, N second sub-matrices can be reconstructed through the second partitioning method, avoiding the solver from directly using unsuitable N first sub-matrices to perform the solution operation.
[0015] In one optional design, determining whether the grid data is anisotropic based on the values in the coefficient matrix includes: if the values in the coefficient matrix representing the relationship between the first grid point data and every other grid point data are the same, then the grid data is isotropic; otherwise, the grid data is anisotropic; the first grid point is any one of the grid point data.
[0016] In one alternative design, the second partitioning method is to minimize the number of partitions along the first direction of the multidimensional grid data, or the main partitioning direction of the second partitioning method is any direction of the multidimensional grid data other than the first direction.
[0017] Through the above design, the second partitioning method follows the direction of anisotropy of the structured mesh. Thus, the N second sub-matrices constructed based on the second partitioning method can better reflect the characteristics of the original structured mesh problem. Based on the N second sub-matrices, the quality of the preconditioner can be constructed to a higher quality, thereby further improving the convergence of the iterative method and reducing the number of iterations.
[0018] In one optional design, determining whether the N first sub-matrices obtained by the first partitioning method are suitable for the solver to perform the solution operation on the linear equation system based on the relationship between the network point data in each of the N first sub-matrices includes: if the multiple values included in the sub-block located on the diagonal of the coefficient matrix are all smaller than the other values in the same matrix row as the sub-block, then it is determined that the N first sub-matrices obtained by the first partitioning method are not suitable for the solver to perform the solution operation.
[0019] With the above design, numerical comparison can more quickly determine whether the N first submatrices are suitable for the solver to perform the solution operation.
[0020] In an optional design, the method further includes: determining the anisotropic direction of the grid data as a first direction based on the values in the coefficient matrix; the anisotropic direction of the grid data being the first direction means that the relationship between each point data (denoted as the target point data) in some or all of the grid data and other point data in the first direction is stronger than the relationship between the target point data and point data in other dimensions; wherein, determining the anisotropic direction of the grid data as the first direction based on the values in the coefficient matrix includes: if the value in the coefficient matrix representing the relationship between each point data (denoted as the target point data) in some or all of the grid data and other point data in the first direction is greater than the value representing the relationship between the target point data and point data in other dimensions, then the anisotropic direction of the grid data is the first direction.
[0021] Secondly, this application also provides a task processing system that has the functionality to implement the behaviors described in the method examples of the first aspect. The beneficial effects are described in the first aspect description and will not be repeated here. The functionality can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the aforementioned functions. In one possible design, the device structure includes an acquisition module and a processing module. In another possible design, the acquisition module and the processing module may be the same module. These modules can perform the behaviors described in the method examples of the first aspect, as detailed in the method examples and will not be repeated here.
[0022] Thirdly, this application provides a computing device, including at least one processor and at least one memory, with the at least one processor and at least one memory connected together; wherein the one or more memories store one or more computer programs, the one or more computer programs including instructions, which, when executed by the one or more processors, cause the electronic device to perform the technical solution of the second aspect of this application and any possible design of the second aspect.
[0023] Fourthly, this application also provides a computing device cluster, which includes at least one computing device having the functionality to implement the behavior in the method example of the first aspect described above. The beneficial effects are described in the first aspect and will not be repeated here. Each computing device includes a processor and a memory. The processor is configured to support the computing device in executing the method described in the first aspect or any possible design of the first aspect. The memory is coupled to the processor and stores the necessary program instructions and data of the computing device. The computing device also includes a communication interface for communicating with other devices.
[0024] The fifth aspect provides a chip coupled to a memory in an electronic device for calling a computer program stored in the memory and executing the first aspect of this application and any possible design of the first aspect.
[0025] A sixth aspect provides a computer-readable storage medium comprising a computer program that, when executed on an electronic device, causes the electronic device to perform the technical solutions described in the first aspect and any possible design of the first aspect.
[0026] A seventh aspect provides a computer program product comprising instructions that, when executed on a computer, cause the computer to perform the technical solutions described in the first aspect and any possible design of the first aspect.
[0027] For the beneficial effects described in aspects two through seven above, please refer to the description of the beneficial effects in aspect one above, which will not be repeated here. Attached Figure Description
[0028] Figure 1A is a schematic diagram of a system architecture provided in an embodiment of this application;
[0029] Figure 1B is a schematic diagram of an application scenario of a system provided in an embodiment of this application;
[0030] Figure 2 is a schematic diagram of a structural mesh provided in an embodiment of this application;
[0031] Figure 3 is a schematic diagram of the construction of a preconditioner provided in an embodiment of this application;
[0032] Figure 4 is a flowchart illustrating a task processing method provided in an embodiment of this application;
[0033] Figure 5 is a schematic diagram of a first partitioning method and the corresponding coefficient matrix provided in an embodiment of this application;
[0034] Figure 6 is a flowchart illustrating the process of the task processing method performed by the system 10 provided in this embodiment of the application.
[0035] Figure 7 is a comparative diagram of the coefficient matrices corresponding to an isotropic mesh and an anisotropic mesh provided in an embodiment of this application;
[0036] Figure 8 is a schematic diagram comparing two methods of dividing the same grid provided in an embodiment of this application;
[0037] Figure 9 is a comparative diagram of the coefficient matrix before and after the mixing and washing operation provided in the embodiments of this application;
[0038] Figure 10 is a schematic diagram of process grouping provided in an embodiment of this application;
[0039] Figure 11 is a schematic diagram of the structure of a task processing system provided in an embodiment of this application;
[0040] Figure 12 is a schematic diagram of the structure of a computing device provided in an embodiment of this application;
[0041] Figure 13 is a schematic diagram of the structure of a computing device cluster provided in an embodiment of this application;
[0042] Figure 14 is a schematic diagram of another computing device cluster provided in an embodiment of this application. Detailed Implementation
[0043] This application provides a task processing method that can be applied to a computing system to improve the convergence of the computing system in iteratively solving linear equations generated by structured grid problems.
[0044] Figure 1A is a schematic diagram of a computing system architecture provided in an embodiment of this application. The computing system 10 includes an application program 101 and a solver 102.
[0045] Application 101 plays a crucial role in handling structured mesh problems. For example, it can be used for mesh analysis, mathematical physics modeling, and discretization of partial differential equations. It provides a user-friendly interface and computational capabilities, allowing users to easily input geometric models, set mesh parameters, select numerical methods (such as the finite difference method, finite element method, and finite volume method), and solve equations.
[0046] Mesh generation involves discretizing a given geometric region into a finite number of basic geometric shapes, known as mesh elements. The importance of meshes is self-evident, as many physical phenomena, such as mobile phone overheating, metal deformation, and electromagnetic interference, can be described by partial differential equations. To deeply understand the laws governing these phenomena, solutions to these partial differential equations are needed, and mesh generation is a crucial step in solving these equations. There are various types of mesh generation. For two-dimensional planes and three-dimensional curved surfaces, mesh elements typically use triangles and quadrilaterals; for three-dimensional regions, tetrahedrons, pyramids, triangular prisms, and hexahedrons are commonly used. Mesh type, mesh density, and mesh quality all affect the accuracy of the numerical solution.
[0047] Mathematical physics modeling can be seen as the process of describing and predicting physical phenomena using mathematical methods. This typically involves establishing partial differential equations (PDEs) to simulate the behavior of physical systems. For example, the law of conservation of energy in solids and fluids can be described as a PDE representing the change in temperature T in space. It can be understood that mathematical physics modeling is the process of simplifying and abstracting complex physical problems and describing them using mathematical language (such as PDEs). For instance, the modeling process requires clearly defining the physical phenomena and problems of the region under study, such as fluid flow or heat conduction. Then, based on the law of conservation of energy and other physical laws, a mathematical model describing this physical phenomenon is established, including mathematical equations such as PDEs. For structured meshes, this involves dividing the region into multiple mesh cells and then representing the changes of this physical phenomenon on the mesh cells using mathematical equations such as PDEs. During the modeling process, appropriate mathematical models and equations need to be selected to describe the physical phenomena, and the predicted results of the physical system are obtained by solving these mathematical equations.
[0048] Since directly solving partial differential equations is often very difficult, it is usually necessary to transform them into numerical problems through discretization. Discretization of partial differential equations can be the process of transforming continuously changing physical quantities or spatial regions into a finite number of discrete points. Commonly used methods for discretizing partial differential equations include, but are not limited to, the finite element method, the finite difference method, and the finite volume method. The working principle of the finite element method is to transform the differential equation into an equivalent integral equation, and then use the nodes and elements of the mesh for interpolation and integration to obtain a linear system of equations Ax = b, where A is the coefficient matrix, b is a known vector, and x is the vector to be solved. Solving the linear system of equations yields the solution vector x, such as the prediction result of the physical system. It should be understood that this example uses the finite element method; the embodiments of this application do not limit the method of discretizing partial differential equations, and any method that can obtain a linear system of equations is applicable to the embodiments of this application. The task of solving the linear system of equations can be performed by the solver 102.
[0049] Solver 102 can be used to perform solution operations on linear equation systems, thereby supporting the solution of partial differential equations and a series of application programs 101 that include partial differential equation solving. Depending on the solution method used (direct method and iterative method), solver 102 includes an iterative solver. Optionally, solver 102 includes a direct solver. The iterative solver may include different iterative methods, such as, but not limited to, the conjugate gradient method, the generalized minimum residual method, the generalized conjugate residual method, and the Chebyshev method. Preconditioners are a key module of iterative solvers and are also important methods for improving convergence speed and handling ill-conditioned matrices. In practical applications, commonly used preconditioner construction methods include Block-Jacobi, Additive Schwarz, Jacobi, Incomplete LU Decomposition, Over-Relaxation, and Multigrid methods. The Block-Jacobi method is a commonly used preconditioner technique in multi-process parallel solution of linear equation systems. The iterative method approximates the solution to a system of linear equations through iteration, while the block Jacobi method applies this iterative process to submatrices to improve computational efficiency. The preconditioner can be considered as solving the system of linear equations with inaccurate precision.
[0050] In the embodiments of this application, when using the block Jacobi method for iterative solution, the original coefficient matrix needs to be divided into blocks to construct preconditioners in parallel and then solved block by block.
[0051] Referring to Figure 1B, in some embodiments, application 101 may generate N sub-matrices comprising the coefficient matrix using a pre-defined grid process partitioning method. These sub-matrices are assigned to N processes comprising solver 102, and each process independently computes the preconditioner for its assigned sub-matrix based on the block Jacobi method. Subsequently, multiple processes perform the solution operation in parallel based on the obtained preconditioners. When the convergence condition is met, each process obtains a partial value in the solution vector x, and then solver 102 returns the obtained solution vector x to application 101.
[0052] The following explanations of some terms used in the embodiments of this application are provided to facilitate understanding by those skilled in the art.
[0053] 1. Structural Mesh
[0054] Structured meshes have applications in many fields, especially in applications requiring precise simulation and analysis, such as oil exploration, weather forecasting, aerospace, and hydraulic engineering, where they play a crucial role. They divide a geometric region into a series of regular or relatively regular mesh cells, which can be triangular, quadrilateral, tetrahedral, or hexahedral, depending on the geometric region and physical problem being analyzed. They help scientists more accurately simulate and analyze various natural phenomena and engineering problems, capturing the details of the region through structured meshes.
[0055] For example, in the field of oil exploration, geologists use various exploration techniques to obtain underground geological data. To analyze this data more intuitively and determine the location of oil and gas resources, they need to model complex three-dimensional geological structures. To predict accurate geological models and reservoir simulations, the underground space is typically divided into a series of grid cells. Imagine the entire underground space divided into small cells; these cells are grid cells. They can be two-dimensional, such as triangles or quadrilaterals, or three-dimensional, such as tetrahedrons or hexahedrons. Engineers select appropriate grid sizes and shapes based on the morphology, properties, and characteristics of the underground layers to more accurately describe the underground space. In this way, the geological features and data within each small cell can be more precisely described and analyzed. Through calculations and simulations of these small cells, the characteristics of the entire geological structure can be obtained, such as the distribution of oil and gas and the properties of the reservoir. For example, consider two-dimensional data on oilfield distribution. This data indicates where oil is present and where it is not. Based on this data, a two-dimensional structural grid can be created. Figure 2 exemplifies a quadrilateral structural grid (referred to as a grid for short). This grid is divided into a series of grid cells, each corresponding to a location in the actual underground space. Reservoir simulation can then be performed on this structural grid. Reservoir simulation is a crucial step. It predicts the distribution and reserves of oil reservoirs by simulating underground geological structures and hydrocarbon migration processes—that is, identifying all oil reservoirs and calculating their reserves.
[0056] For example, the specific process may include: (1) identifying the underground area to be studied, such as a specific oil and gas field, understanding the distribution of reservoirs, predicting oil and gas flow, etc. (2) acquiring geological exploration data, such as seismic data, well logging data, etc., and collecting reservoir engineering data, such as production history, fluid properties, etc. For example, the exploration team will set up a series of vibration sources and receivers on the ground. The vibration sources will generate seismic waves, which will propagate underground and generate reflected waves when they encounter oil reservoirs or other geological structures. The receivers will receive these reflected waves and convert them into electrical signals for subsequent processing. (3) then establish a three-dimensional geological model of the underground based on the geological data. This model may include information such as different strata, rock types, porosity, and permeability. (4) select an appropriate grid size and shape according to the complexity of the geological model and the accuracy requirements of the research objectives. (5) divide the study area into a series of grid units. (6) assign values to each grid unit, including attributes such as rock type, porosity, and permeability. Application 101 (such as reservoir simulation software) performs simulation based on these grid cells and properties to determine the linear equation set, and solver 102 calculates the linear equation set to obtain simulation results (such as solution vector x). (7) Based on the simulation results, analyze the underground oil and gas distribution and flow.
[0057] For another example, weather forecasting requires precise simulation and prediction of the atmosphere, which is a three-dimensional and highly complex system. To more accurately simulate atmospheric changes, meteorologists divide the atmospheric space into small three-dimensional grids, also known as structured grids. These grids can be viewed as small rooms within the atmospheric space, and the atmospheric conditions (such as temperature, humidity, and wind speed) in each room can be determined through calculation and simulation. Then, meteorologists can use these grids to perform numerical weather prediction, that is, to predict future weather conditions by simulating atmospheric changes using computers.
[0058] 2. Preconditioner
[0059] Preconditioners are a key technique for accelerating iterative solutions to linear equation systems, especially large ones. They are considered a transformation matrix that improves the properties of the coefficient matrix of a linear equation system, aiming to convert the original system into a more solvable form. Essentially, they transform the original problem into an equivalent problem that is easier to solve by changing the coefficient matrix.
[0060] The main function of preconditioners is to make iterative methods that are originally difficult to converge more easily or to accelerate the convergence speed. In the linear system of equations Ax = b, if the condition number of the coefficient matrix is large, the convergence speed of the iterative method may be very slow. The condition number is a measure of the ill-conditioning of a matrix; a larger condition number indicates that the matrix is more unstable in numerical computation and more prone to amplifying errors. The introduction of preconditioners can reduce the condition number of the coefficient matrix, thereby enabling the iterative method to converge faster, i.e., improving the speed.
[0061] 3. Block-based Jacobi method
[0062] As mentioned earlier, preconditioners can be considered as inaccurate solutions to linear equation systems, while the idea behind the block Jacobi method is to solve for an approximate matrix composed of the diagonal blocks of the original coefficient matrix.
[0063] Figure 3 illustrates an exemplary schematic diagram of constructing preconditioners using the block Jacobi method. As shown on the left side of Figure 3, the construction process may include:
[0064] (1) Divide the coefficient matrix into several submatrices. These submatrices can be smaller matrices formed by consecutive rows and columns in the coefficient matrix. Note that here, multiple consecutive rows need to be divided into a submatrix. You cannot skip rows when dividing the submatrix. That is, a submatrix includes multiple consecutive rows in the original coefficient matrix.
[0065] (2) Multiple submatrices are distributed to multiple processors (processes) of solver 102, and each processor independently computes the preconditioner for the block it is responsible for. This makes full use of the computing power of multiple processors and speeds up the construction of preconditioners.
[0066] For each submatrix, an appropriate preconditioner can be applied. These preconditioners can be simple diagonal preconditioners, block diagonal preconditioners, or more complex algebraic multigrid (AMG) preconditioners, etc. Figure 3 shows a block diagonal preconditioner, in which each submatrix is further subdivided into multiple sub-blocks of the same size (A...). nm Each process sequentially takes a sub-block (called a diagonal block) from the main diagonal of the coefficient matrix to obtain an approximate matrix of the original coefficient matrix. This approximate matrix is the preconditioner, as shown on the right side of Figure 3. This approximate matrix is formed by taking the sub-block (A) from the main diagonal of the original coefficient matrix. ii The algorithm consists of A, where i is an integer from 1 to n. In multi-process parallel solving, process 1 takes A. 11 Construct a preconditioner and perform iterative computation; process 2 selects A. 22 Construct a preconditioner to perform iterative computation, and process 3 selects A. 33Preconditioners are constructed to perform iterative computations. Due to its simplicity and good parallelism, the block Jacobi method has become the most important and commonly used preconditioner for multi-process parallel solution of linear equations.
[0067] In summary, it can be seen that the quality of the construction of the preconditioner affects the convergence of the iterative method. A good preconditioner can significantly improve the convergence speed. However, in some cases, the quality of the constructed preconditioner is poor, which seriously affects the convergence of the iterative method.
[0068] In view of this, this application provides a task processing method, which can be executed by an application program 101 or a solver 102. Taking the solver 102 as an example, in this method, the solver 102 determines whether the N sub-matrices (denoted as first sub-matrices) obtained by the process partitioning method of the grid used by the application program 101 (denoted as the first partitioning method) are suitable for the solver 102 to perform the solution operation. If it is determined that they are not suitable, the second partitioning method is used to generate N second sub-matrices. The solver 102 uses N processes to perform the solution operation based on the N second sub-matrices. For example, preconditioners are constructed in parallel based on the N second sub-matrices. The preconditioners constructed by this method are more suitable for the solver 102 to perform the solution operation, thereby further improving the convergence of iterative solution of linear equation systems.
[0069] The task processing method provided in this application embodiment will be described in detail below, taking the system shown in Figure 1A as an example.
[0070] Figure 4 is a flowchart illustrating the task processing method provided in this embodiment. Figure 4 uses a two-dimensional structured mesh as an example. This method can be executed by the application program 101 or solver 102 in Figure 1A. The method may include some or all of the following steps. As shown in Figure 4, the method may include:
[0071] Step 401: Obtain the data to be processed for the structured grid task.
[0072] A structured mesh task can be to solve a system of linear equations corresponding to mesh data. The mesh data includes multiple grid point data points. Mesh data includes the aforementioned structured mesh data, and grid point data includes the data of the mesh nodes. For ease of explanation, mesh data will be simply referred to as a mesh, and grid point data as a node.
[0073] The data to be processed for the structured mesh task can be generated by application 101. Accordingly, this data may include N first sub-matrices comprised of the coefficient matrix in the linear equation system. As mentioned earlier, these N first sub-matrices are obtained by application 101 dividing the mesh using a first partitioning method. The coefficient matrix and how to divide the coefficient matrix into N first sub-matrices are described below:
[0074] There is a correspondence between a structured mesh and the linear equation system Ax = b. The coefficient matrix can be viewed as a mathematical representation of the mesh, capturing key connection information between mesh nodes and the interactions of physical quantities. A mesh node refers to the vertex of a mesh cell; as shown in Figure 2 or Figure 5(a), each mesh cell is composed of connected mesh nodes. In a structured mesh, each mesh node has a specific location and number, and these nodes participate in the subsequent discretization process. During numerical discretization, a coefficient matrix can be assembled based on the mesh's topology and physical properties. For example, referring to Figure 5, this process may include:
[0075] (1) Obtain a structured mesh, which can be a two-dimensional structured mesh, including the x and y directions. The mesh elements included in the two-dimensional structured mesh can be two-dimensional elements such as triangles and quadrilaterals (see Figure 5(a)). Alternatively, the structured mesh can be a three-dimensional structured mesh, including the x, y, and z directions. The mesh elements included in the three-dimensional structured mesh can be three-dimensional elements such as cubes and hexahedrons. For ease of explanation, the following will first introduce the two-dimensional structured mesh as an example.
[0076] (2) Determine the node number: Based on the first partitioning method, divide the multiple grid nodes included in the structured grid into N parts, each corresponding to N processes. Each part includes multiple nodes. Assign a unique number to each node in the grid, where multiple nodes belonging to each process need to be numbered consecutively. Optionally, record the position information of these nodes.
[0077] (3) Assemble the coefficient matrix: Determine the positions and values of the non-zero elements in the coefficient matrix. These non-zero elements typically correspond to relationships between grid nodes, such as connections between grid nodes or interactions between physical quantities. Specifically, each non-zero element in the coefficient matrix is represented by a triple (row number, column number, value), where the row and column numbers correspond to the grid node numbers, and the value corresponds to the interactions or connections between physical quantities. In summary, each non-zero element in the coefficient matrix corresponds to a triple (i, j, a_ij), where i and j represent the row and column numbers, respectively, corresponding to the node numbers in the grid. a_ij is the value of the non-zero element, representing the relationship between node i and node j.
[0078] For example, Figure 5(a) shows a 2×2 quadrilateral grid consisting of 4 grid cells (small rectangles in the figure). These 4 grid cells are connected by 9 grid nodes (represented by black circles in Figure 5(a), referred to simply as nodes). The 9 nodes in this grid are numbered sequentially from 1 to 9. Then, a coefficient matrix can be formed based on the node numbers, as shown in Figure 5(b). This coefficient matrix has a size of 9×9, where row numbers 1-9 sequentially represent nodes 1-9, and column numbers 1-9 also sequentially represent nodes 1-9. That is, one row number represents one node, and one column number also represents one node. Each node in the grid corresponds to a row in the coefficient matrix. This matrix row is used to record the relationship between the node and its neighboring nodes. That is, the node number is the row number of the corresponding matrix row, and the numbers of the nodes adjacent to the node in this matrix row are the column numbers. Therefore, when assembling the coefficient matrix, for each node in the mesh, its row number in the coefficient matrix is determined based on its node number, and the column number is determined by the numbers of the other adjacent nodes. The elements at the positions indicated by these row and column numbers in the coefficient matrix are non-zero elements, indicating that the two nodes are connected or adjacent. The value of this non-zero element represents the relationship between the two nodes, such as the strength of their interaction or connection. Examples include the transmission or change of physical quantities like force or temperature.
[0079] As shown in Figure 5, the structural mesh is characterized by all nodes within the mesh (except those on the mesh boundary) having the same number of neighboring cells of the same type. As shown in Figure 2, each mesh node, except for the points on the mesh boundary, has four adjacent mesh nodes. Correspondingly, in the coefficient matrix of this structural mesh, except for the nodes on the mesh boundary, each node's corresponding sentence row has the same number of non-zero elements.
[0080] (4) Based on the nodes included in each of the N parts divided by the first partitioning method, the coefficient matrix is divided into N first sub-matrices.
[0081] The example above is an illustration. In a practical application, in an alternative implementation, application 101 can directly assemble N first submatrices based on N parts, with each first submatrice corresponding to a process in solver 102, as shown in Figure 6.
[0082] Optionally, the data to be processed also includes node position information (denoted as first position information) and / or, the position information of elements in the coefficient matrix (denoted as second position information). Both the first and second position information are used to determine the orientational relationship between nodes represented by the elements in the coefficient matrix. For example, the first position information includes the position of each node in the grid, as shown in Figure 5(a). The position of the node can be represented by the coordinates used by the grid, such as the coordinates of node 1 being (0,0), node 2 being (0,1), node 3 being (0,2), node 4 being (1,0), and node 7 being (2,0).
[0083] The second position information indicates the relative positional relationship between the grid nodes corresponding to the non-zero elements in the coefficient matrix. Taking a single matrix row as an example, the grid node corresponding to the non-zero element on the main diagonal of the matrix row is taken as the origin. The position information of other non-zero elements in the matrix row records the positional relationship of their corresponding grid nodes relative to the origin. For example, in one example, the position information includes the coordinates (x, y) of each non-zero element, where x represents the left or right of the origin, and y represents the top or bottom of the origin. Assuming the coordinates of the grid node corresponding to the non-zero element on the main diagonal (denoted as the origin) are (0, 0), if the grid node corresponding to another non-zero element in the matrix row is the left neighbor of the origin, then the coordinates of the non-zero element are (-1, 0). If the grid node is the right neighbor of the origin, then the coordinates of the non-zero element are (1, 0). If the grid node is the top neighbor of the origin, then the coordinates of the non-zero element are (0, 1). If the grid node is the bottom neighbor of the origin, then the coordinates of the non-zero element are (0, -1).
[0084] For example, taking "node 5 as the origin" in Figure 5(a) as an example, in the coefficient matrix shown in Figure 5(b), the row corresponding to node 5 is the 5th row. The non-zero elements in this row correspond to nodes 2, 4, and 5, and nodes 6 and 8, respectively. As shown in Figure 5(a), node 2 is below node 5, node 4 is to the left of node 5, node 6 is to the right of node 5, and node 8 is above node 5. Therefore, the coordinates of these non-zero elements are (0, -1), (-1, 0), (0, 0), (1, 0), and (0, 1), respectively. It should be noted that the values here are only examples; as long as the orientation relationship of the grid nodes can be distinguished, there is no specific limitation. In addition, the position information may only include the coordinates of non-zero elements on the off-diagonal, but not the coordinates of non-zero elements on the main diagonal. For example, (0, 0) may not be included in the above example. This reduces the amount of position information data and reduces memory overhead.
[0085] Optionally, the data to be processed also includes subvectors of the known vector. Similar to dividing the coefficient matrix into N first submatrices, application 101 divides the known vector (b) into N subvectors. These subvectors are also distributed to the aforementioned N processes. Each process obtains a first submatrix of the coefficient matrix and a subvector of the known vector. Subsequently, each process can solve in parallel based on its obtained first submatrix and subvectors of b, and each process obtains a subvector from the solution vector x.
[0086] Step 402: Determine whether the N first sub-matrices obtained by the first partitioning method are suitable for the solver 102 to perform the solution operation on the linear equation system. If they are suitable, multiple processes can perform parallel solution operations based on their respective first sub-matrices and sub-vectors of b. If they are not suitable, then proceed to step 403.
[0087] This application provides multiple determination methods, which are described below:
[0088] Judgment Method 1: Solver 102 performs the following steps:
[0089] Step 4021a: Determine whether the structure mesh is anisotropic based on the values in the coefficient matrix (i.e., the values of the non-zero elements). If so, proceed to step 4022a.
[0090] In this embodiment, the structured mesh can be defined as isotropic or anisotropic based on whether its physical properties and computational characteristics are consistent or similar in different directions. For example, in one example, an isotropic structured mesh can refer to a mesh in which the relationship between each node and its adjacent nodes in any direction is the same for some or all of the nodes; an anisotropic structured mesh can refer to a mesh in which the relationship between each node and its adjacent nodes in any direction is not exactly the same or completely different. The number of nodes can be measured by the number of nodes. For example, if the relationship between most nodes and each of their adjacent nodes is the same, the structured mesh is isotropic. Conversely, if the relationship between a small number of nodes and each of their adjacent nodes is different, the structured mesh is anisotropic.
[0091] When applied to the coefficient matrix, as shown in Figure 7(a), in the coefficient matrix corresponding to an isotropic structured mesh, the values of all non-zero elements except those on the main diagonal are the same in some or all of the matrix rows. It is important to note that the granularity of comparison here is at the matrix row level, meaning that the values of all non-zero elements in a matrix row are the same, indicating that the relationship between that node and its adjacent nodes in any direction is the same. It does not limit whether the values of elements in different matrix rows are the same; for example, the non-zero elements in the first matrix row may all be 1, while the non-zero elements in the ninth matrix row may all be 5 (referring to non-zero elements excluding those on the main diagonal).
[0092] Conversely, as shown in Figure 7(b), if the values of the non-zero elements in each matrix row, excluding the main diagonal, are not exactly the same or completely different, then the structured mesh is anisotropic.
[0093] It should be noted that the element values of each coefficient matrix shown in the embodiments of this application are merely examples and are not intended to limit the values of the coefficient matrix obtained from the structural mesh.
[0094] Step 4022a: Determine the direction of anisotropy of the structured mesh (denoted as the first direction).
[0095] The direction of anisotropy indicates which direction a node in a mesh has a stronger relationship with its neighboring nodes. For example, taking the two-dimensional mesh in Figure 5 or Figure 6 as an example, if some or all nodes in the mesh have stronger relationships with their neighbors in the x-direction than with their neighbors in the y-direction, then the direction of anisotropy for this mesh is the x-direction. Conversely, if some or all nodes in the mesh have stronger relationships with their neighbors in the y-direction than with their neighbors in the x-direction, then the direction of anisotropy for this mesh is the y-direction.
[0096] For example, taking node 5 in the structured mesh shown in Figure 6 as an example, if the relationship between node 5 and nodes 4 and 6 is stronger than the relationship between node 5 and nodes 2 and 8, then node 5 is determined to have stronger coupling in the x-direction and weaker coupling in the y-direction. Conversely, if the relationship between node 5 and nodes 2 and 8 is stronger than the relationship between node 5 and nodes 4 and 6, then node 5 is determined to have stronger coupling in the y-direction and weaker coupling in the x-direction. If most nodes in the structured mesh exhibit stronger coupling in the x-direction, then the direction of anisotropy of the structured mesh is the x-direction; similarly, if most nodes in the structured mesh exhibit stronger coupling in the y-direction, then the direction of anisotropy of the structured mesh is the y-direction.
[0097] This can be determined by combining the numerical values in the coefficient matrix with the first / second position information. For example, taking a row in the coefficient matrix as an example, the m largest values among the non-zero elements (excluding the main diagonal) in that row can be identified first. Then, based on the first position information, the orientation relationship between the nodes corresponding to these m largest values and the nodes other than those corresponding to that row in the grid can be determined. For example, in Figure 6, the first row of the coefficient matrix corresponds to node 1. The largest element value in this row is 2. Based on the column number of this element value, the element value can be identified as number 4 (i.e., node 4). Based on the first position information, node 4 (coordinate (0,1)) is located in the y-direction of node 1 (coordinate (0,0)), thus determining that node 1 has a stronger coupling in the y-direction. For example, in Figure 6, the second row of the coefficient matrix corresponds to node 2. The larger element value in this row is 2. Based on the column number of this element value, we can determine that the element value is numbered 5 (i.e., node 5). Based on the first position information, we determine that node 5 (coordinates (1,1)) is in the y-direction of node 2 (coordinates (1,0)), thus determining that node 2 has stronger coupling in the y-direction. Similarly, if it is determined that most nodes have stronger coupling in the y-direction, then the direction of anisotropy in this mesh structure is the y-direction.
[0098] Optionally, the second position information can be used to determine the orientational relationship between the nodes corresponding to the larger m values and the nodes excluding those corresponding to the matrix row in the mesh. For example, in Figure 6, the first row of the coefficient matrix corresponds to node 1. The largest element value in this row is 2. Based on the column number of this element value, its number is determined to be 4 (i.e., node 4). According to the second position information, node 4 (coordinate (0,1)) is in the y-direction of node 1 (coordinate (0,0)), thus determining that node 1 has stronger coupling in the y-direction. Similarly, in Figure 6, the second row of the coefficient matrix corresponds to node 2. The largest element value in this row is 2. Based on the column number of this element value, its number is determined to be 5 (i.e., node 5). According to the second position information, node 5 (coordinate (0,1)) is in the y-direction of node 2 (coordinate (0,0)), thus determining that node 2 has stronger coupling in the y-direction. And so on. If it is determined that most nodes have stronger coupling in the y-direction, then the direction of anisotropy in this mesh structure is the y-direction.
[0099] Step 4023a: Determine the main partitioning direction of the first partitioning method.
[0100] The primary partitioning direction refers to the dimension along which the first partitioning method divides the mesh most frequently, or in other words, the direction along which the first partitioning method divides the mesh the most. For example, for a 2D structured mesh, the primary partitioning direction can be the x-direction or the y-direction; for a 3D structured mesh, the primary partitioning direction can be the x-direction, y-direction, or z-direction. Continuing with the 2D structured mesh example, if the primary partitioning method is the x-direction, it means that the primary partitioning method divides the mesh the most frequently along the x-direction. Note that the number of divisions along the x-direction here refers to the number of divisions perpendicular to the x-direction, or the number of cuts along the x-direction, not the number of cuts parallel to the x-axis. For example, in the primary partitioning method shown in Figure 5 or Figure 6, the number of divisions in the y-direction is 2, the node is divided into 3 parts in the y-direction, and the number of divisions along the x-direction is 0. Therefore, the primary partitioning direction of the first partitioning method is the y-direction.
[0101] Optionally, the number of divisions mentioned above can also be replaced by the number of parts into which the nodes in the grid are divided in the y direction. For example, in the above example, dividing the grid 2 times in the y direction is equivalent to dividing the nodes in the grid into 3 parts in the y direction.
[0102] The main partitioning direction of the first partitioning method can be determined by the application 101, or it can be determined based on N first sub-matrices and first position information. For example, sub-matrix 1 includes the matrix rows corresponding to nodes 1-3, sub-matrix 2 includes the matrix rows corresponding to nodes 4-6, and sub-matrix 3 includes the matrix rows corresponding to nodes 7-9. Based on the first position information, the coordinates of nodes 1-9 are determined as (0, 0), (1, 0), (2, 0), (0, 1), (1, 1), (2, 1), (0, 2), (1, 2), (2, 2). It can be determined that nodes 1-9 are divided into 3 parts in the y-direction: (nodes 1-3), (nodes 4-6), (nodes 7-9). The number of partitions in the y-direction is 2, and the number of partitions in the x-direction is 0. Therefore, the main partitioning direction is determined to be the y-direction.
[0103] Optionally, the main partitioning direction of the first partitioning method can also be determined by the values of the elements in the N first submatrices and the second position information, as described in the previous introduction, which will not be repeated here.
[0104] It is worth noting that if the number of partitions in the x-direction and the number of partitions in the y-direction are the same in the first partitioning method, then to avoid the possibility that the first partitioning method may not be applicable, it is assumed that the N first submatrices obtained by the first partitioning method are unsuitable for solving the problem. For further determination of whether the first partitioning method is a second partitioning method, please refer to the relevant introduction below, which will not be repeated here.
[0105] Step 4024a: Determine whether the main partitioning direction of the first partitioning method is the direction of anisotropy of the structured mesh (first direction). If it is, then determine that the N first sub-matrices obtained by the first partitioning method are not suitable for solver 102 to perform the solution operation; or, if not, then determine that the N first sub-matrices obtained by the first partitioning method are suitable for solver 102 to perform the solution operation.
[0106] For example, for a two-dimensional structured mesh, if the anisotropy of the structured mesh is in the y-direction, and the main partitioning direction of the first partitioning method is also in the y-direction (meaning the partitioning is performed most frequently in the y-direction), then the N first sub-matrices obtained by the first partitioning method are deemed unsuitable for solver 102 to perform the solution operation. If the anisotropy of the structured mesh is in the x-direction, and the main partitioning direction of the first partitioning method is in the y-direction, then the N first sub-matrices obtained by the first partitioning method are deemed suitable for solver 102 to perform the solution operation.
[0107] The 3D structured mesh also includes the z-direction. For example, if the anisotropy direction of the 3D structured mesh is the z-direction, and the main partitioning direction of the first partitioning method is the z-direction, then the N first sub-matrices obtained by the first partitioning method are determined to be unsuitable for solver 102 to perform the solution operation. If the main partitioning direction of the first partitioning method is the x-direction or y-direction, then the N first sub-matrices obtained by the first partitioning method are determined to be suitable for solver 102 to perform the solution operation.
[0108] Judgment Method 2: Solver 102 performs the following steps:
[0109] Steps 4021a to 4022a;
[0110] Step 4023b: Determine whether the first partitioning method is the target partitioning method for the structure mesh. If yes, determine that the N first sub-matrices obtained by the first partitioning method are not suitable for solver 102 to perform the solution operation; or, if not, determine that the N first sub-matrices obtained by the first partitioning method are suitable for solver 102 to perform the solution operation.
[0111] The target partitioning method has the following characteristics: under the condition that the nodes in the mesh are divided into N parts, the number of partitions is minimized in the direction of anisotropy of the structured mesh (denoted as the first direction). In other words, if the number of partitions in the first direction of the first partitioning method is neither the most (i.e., the main partitioning direction is not the first direction) nor the least, then it is still determined that the N first sub-matrices obtained by the first partitioning method are not suitable for solver 102 to perform the solution operation.
[0112] For example, suppose the anisotropy direction (first direction) of a certain structured mesh is the x-direction. The first partitioning method divides the mesh 3 times along the x-direction and 4 times along the y-direction, meaning the main partitioning direction is the y-direction, and the nodes in the mesh are divided into N parts. The target partitioning method is to divide the mesh 6 times along the y-direction and 1 time along the x-direction, dividing the nodes into N parts. In this example, although the main partitioning direction of the first partitioning method is not the x-direction, the first partitioning method is not the target partitioning method. However, it is determined that the N first sub-matrices obtained by the first partitioning method are not suitable for solving problem 102. It should be noted that the mention of the main partitioning direction is only to illustrate the difference between the first and second determination methods; in the second determination method, it is not necessary to determine the main partitioning direction of the first partitioning method.
[0113] The target partitioning method can be determined based on the specifications of the structured mesh, the direction of the anisotropy of the structured mesh, and the number of processes N; or, the target partitioning method can be preset, for example, each anisotropy direction of each structured mesh is associated with information of a target partitioning method (indicating the location of the mesh division by the target partitioning method).
[0114] Judgment Method 3: Solver 102 performs the following operations:
[0115] Step 4021c: Determine whether the values of some or all of the non-zero elements included in one or more diagonal blocks in the coefficient matrix are greater than the values of the non-zero elements outside the diagonal blocks. If so, determine that the N first sub-matrices obtained by the first partitioning method are not suitable for solver 102 to perform the solving operation; or, if not, determine that the N first sub-matrices obtained by the first partitioning method are suitable for solver 102 to perform the solving operation.
[0116] Combining Figures 3 and 6, let's understand based on the main diagonal piece A. ii Taking the construction of preconditioners as an example, suppose A ii The size is 3×3. In Figure 6, solver 102 determines whether the main diagonal block A included in part or all of the first submatrix is... ii The first submatrix is determined to be suitable for solver 102 to perform its solution operation if some or all of the values in the first submatrix (excluding the values on the main diagonal) are greater than the values outside the main diagonal blocks. Here, "partial" can refer to one or more values, determined based on the performance requirements of the solution operation. Typically, "partial" refers to at least half of the values. For example, if most values in the main diagonal blocks are greater than the values outside the main diagonal blocks, then the first submatrix is suitable for solver 102 to perform its solution operation. If most of the main diagonals are suitable, then the N first matrices obtained from the first partitioning method are suitable for solver 102 to perform its solution operation; otherwise, they are deemed unsuitable.
[0117] For example, for submatrix 1, determine A in submatrix 1. 11All included values are 1, and all are less than A in submatrix 1. 11 If any value other than A is 2, then submatrix 1 is deemed unsuitable. Similarly, determine the suitability of submatrix 2 based on the value of A. 22 All included values are 1, and all are less than A in submatrix 2. 22 If any value other than 2 is found, then submatrix 2 is deemed unsuitable. If the majority of the N first submatrices are unsuitable...
[0118] Step 403: Divide the structural mesh into N second sub-matrices using the second partitioning method.
[0119] The second partitioning method differs from the first, as shown in Figure 8. Figure 8(a) illustrates the first partitioning method, and Figure 8(b) illustrates the second. The second partitioning method divides the nodes in the grid along the x-direction into three parts, each corresponding to one of the three processes. The nodes assigned to each process are numbered consecutively, resulting in the node numbers shown in Figure 8(b). It should be noted that although the node numbers assigned to the same process remain the same, the nodes assigned to the same process differ between the two partitioning methods. For example, according to the first partitioning method shown in Figure 8(a), process 1 is assigned nodes 1, 2, and 3. These three grid nodes correspond to grid nodes 1, 4, and 7 in Figure 8(b).
[0120] In some embodiments, the second partitioning method is the aforementioned target partitioning method. In other embodiments, the main partitioning direction of the second partitioning method is not the direction of anisotropy of the structured mesh (the first direction). That is, the number (number of times) of partitioning the structured mesh in the first direction by the second partitioning method is not the most, but it may be the least or it may not be the least. When the number of partitions in the first direction is the least, the second partitioning method is the target partitioning method. After determining the second partitioning method, the N first sub-matrices are converted into N second sub-matrices according to the second partitioning method. The following describes how to determine the N second sub-matrices based on the second partitioning method:
[0121] Step 4031: Determine the shuffle operation information: the data distribution of the N second submatrices in the N first submatrices.
[0122] Taking a second submatrix (or denoted as the third submatrix) as an example, determine the multiple grid nodes corresponding to the third submatrix in the second partitioning method; determine the positions of the elements related to these multiple grid nodes in the N first submatrixes.
[0123] For example, Figure 9 illustrates a comparison of the coefficient matrices obtained by the two partitioning methods. Figure 9(a) illustrates the coefficient matrix (denoted as coefficient matrix A) obtained by the first partitioning method and the N first sub-matrices (sub-matrix 1 to sub-matrix 3) obtained therefrom. Figure 9(b) illustrates the coefficient matrix (denoted as coefficient matrix A') obtained by the second partitioning method and the N second sub-matrices (sub-matrix 1' to sub-matrix 3') obtained therefrom.
[0124] Taking submatrix 1' as an example, in the second partitioning method shown in Figure 8(b), submatrix 1' corresponds to nodes 1, 2, and 3. These three grid nodes are nodes 1, 4, and 7 in the first partitioning method shown in Figure 8(a), respectively. Based on the numbering of the same node under the two partitioning methods, the position of the matrix row corresponding to that node in submatrix 1 (denoted as the first position) and the position of the matrix row at the first position in submatrix 1' (denoted as the second position) can be determined.
[0125] For example, combining Figure 9(a) and Figure 9(b), in the second division method:
[0126] Nodes 1, 2, and 3 corresponding to submatrix 1' are nodes 1, 4, and 7 in Figure 9(a), respectively. Nodes 1, 4, and 7 correspond to the first row (the first row of submatrix 1 corresponding to process 1), the fourth row (the first row of submatrix 2 corresponding to process 2), and the seventh row (the first row of submatrix 3 corresponding to process 3) of coefficient matrix A, respectively. Based on the node numbers of submatrix 1' in the second partitioning method, it can be determined that: the first row of coefficient matrix A should be located in the first row of submatrix 1', the fourth row of coefficient matrix A should be located in the second row of submatrix 1', and the seventh row of coefficient matrix A should be located in the third row of submatrix 1'.
[0127] Nodes 4, 5, and 6 of submatrix 2' correspond to nodes 2, 5, and 8 in Figure 9(a), respectively. Nodes 2, 5, and 8 correspond to the 2nd row (the 2nd row of submatrix 1 corresponding to process 1), the 5th row (the 2nd row of submatrix 2 corresponding to process 2), and the 8th row (the 2nd row of submatrix 3 corresponding to process 3) of coefficient matrix A, respectively. Similarly, it is determined that the 2nd row of coefficient matrix A should be located in the 1st row of submatrix 2', the 5th row of coefficient matrix A should be located in the 2nd row of submatrix 2', and the 7th row of coefficient matrix A should be located in the 3rd row of submatrix 2'.
[0128] Nodes 7, 8, and 9 corresponding to submatrix 3' are nodes 3, 6, and 9 in Figure 9(a), respectively. Nodes 3, 6, and 9 correspond to the 3rd row (process 1 corresponds to the 3rd row of submatrix 1), the 6th row (process 2 corresponds to the 3rd row of submatrix 2), and the 9th row (process 3 corresponds to the 3rd row of submatrix 3) in coefficient matrix A, respectively. Similarly, it is determined that the 3rd row of coefficient matrix A should be located in the 1st row of submatrix 3', the 6th row of coefficient matrix A should be located in the 2nd row of submatrix 3', and the 9th row of coefficient matrix A should be located in the 3rd row of submatrix 3'.
[0129] Next, based on the node's index in both partitioning methods, the column positions of the non-zero elements in the first row of the coefficient matrix A (N first sub-matrices) at the second position in the matrix row of the coefficient matrix A' (N second sub-matrices) are determined. For example, continuing with Figure 9(a), taking node 2 as an example, node 2 corresponds to the second row in sub-matrix 1, and the column numbers of the non-zero elements in the second row of sub-matrix 1 are 1, 2, 3, and 5, respectively. Based on the second position, the first row of this matrix row in sub-matrix 2' is determined, as shown in Figure 9(b). The column numbers of these non-zero elements will then become 1, 4, 7, and 5. This is because the indexes of nodes 1, 2, 3, and 5 in the first partitioning method will change to 1, 4, 7, and 5 in the second partitioning method.
[0130] For example, taking node 5 in Figure 9(a) as an example, node 5 corresponds to the second row of submatrix 2. The column numbers of the non-zero elements in the second row of submatrix 2 are 2, 4, 5, 6, and 8. It should be noted that the matrix rows do not need to be swapped; they remain in the second row of submatrix 2'. Only the columns need to be rearranged. After rearrangement, the column numbers of these non-zero elements will become 4, 2, 5, 8, and 6. This is because the numbering of nodes 2, 4, 5, 6, and 8 in the first partitioning method will become 4, 2, 5, 8, and 6 in the second partitioning method.
[0131] The above defines the coordinates of each non-zero element in the coefficient matrix A (N first sub-matrices) within the coefficient matrix A' (N second sub-matrices), or in other words, the coordinates of each non-zero element in the coefficient matrix A' (N second sub-matrices) within the coefficient matrix A (N first sub-matrices). This represents the data distribution of the N second sub-matrices within the N first sub-matrices.
[0132] The shuffling operation information indicates the data distribution of the N second submatrices in the N first submatrices. For example, the shuffling operation information includes the coordinates of each non-zero element in the coefficient matrix A and the coordinates of that non-zero element in the coefficient matrix A'.
[0133] Step 4032: Instruct multiple processes to perform shuffling operations based on the shuffling operation information to obtain N second sub-matrices.
[0134] Continuing with a second submatrix (such as a third submatrix) as an example, the process executing the third submatrix is controlled based on the shuffling operation information to perform a shuffling operation with each process at the position of the non-zero element included in the third submatrix in the coefficient matrix A, so as to obtain the third submatrix; the other submatrixes in the N second submatrixes are constructed in the same way as the third submatrix.
[0135] For example, in the examples of Figure 9(a) and Figure 9(b), the shuffling operation information indicates that: the first row of coefficient matrix A should be located in the first row of submatrix 1', the fourth row of coefficient matrix A should be located in the second row of submatrix 1', and the seventh row of coefficient matrix A should be located in the third row of submatrix 1'. The third row of coefficient matrix A should be located in the first row of submatrix 3', the sixth row of coefficient matrix A should be located in the second row of submatrix 3', and the ninth row of coefficient matrix A should be located in the third row of submatrix 3'. The third row of coefficient matrix A should be located in the first row of submatrix 3', the sixth row of coefficient matrix A should be located in the second row of submatrix 3', and the ninth row of coefficient matrix A should be located in the third row of submatrix 3'. (The first row of submatrix 1 does not need to be swapped, and the second row of submatrix 2 does not need to be swapped.)
[0136] Note that the number of N processes corresponding to the two partitioning methods usually remains the same, so the shuffling operation can include:
[0137] Process 1 sends the matrix data of the second row of submatrix 1 to process 2, which becomes the first row of submatrix 2' in process 2. Similarly, process 1 sends the third row of submatrix 1 to process 3, which becomes the first row of submatrix 3' in process 3.
[0138] Process 2 sends the first row of submatrix 2 to process 1, which becomes the second row of submatrix 1' in process 1. Similarly, process 2 sends the third row of submatrix 2 to process 3, which becomes the second row of submatrix 3' in process 3.
[0139] Process 3 sends the first row of submatrix 3 to process 1, which becomes the third row of submatrix 1' in process 1. Similarly, process 3 sends the second row of submatrix 3 to process 2, which becomes the third row of submatrix 2' in process 2.
[0140] After swapping the matrix rows, the columns of the non-zero elements in the matrix rows are rearranged according to the shuffling operation information. For example, as shown in Figure 9(a), taking grid node 2 as an example, the column numbers of the non-zero elements in the second row of submatrix 1 are 1, 2, 3, and 5. This matrix row will be moved to the first row of submatrix 2', and the column positions of some or all of its non-zero elements will be adjusted. The column numbers of these non-zero elements will become 1, 4, 7, and 5. The non-zero element with the original column number 1 does not need to be moved, the non-zero element with the original column number 2 is moved to the position with column number 4 in this matrix row (the first row of submatrix 2'), the non-zero element with the original column number 3 is moved to the position with column number 7 in this matrix row (the first row of submatrix 2'), and the non-zero element with the original column number 5 does not need to be moved. And so on, adjusting the column positions of the non-zero elements in the other matrix rows of N second submatrixes.
[0141] After the final shuffling and rearrangement, each process yields N second sub-matrices as shown in Figure 9(b).
[0142] Optionally, processes can exchange their matrix data via All-to-All (A2A) communication. In one possible scenario, all processes communicate via A2A; in another, each process communicates only within its own process group, i.e., only with processes in its own process group. Referring to the example in Figure 10, process 1 sends matrix data to processes 4, 5, and 6 via A2A communication. Process 1 receives matrix data from processes 4, 5, and 6. Similarly, process 4 sends matrix data to processes 1, 2, and 3 via A2A communication. Process 4 receives matrix data from processes 1, 2, and 3.
[0143] Optionally, the shuffling operation also includes: the solver 102 instructing each process to perform the shuffling operation for (the known vector) b based on the shuffling operation information of the coefficient matrix. It should be noted that since the known vector can be of M×1 form, the shuffling operation for b only includes: performing the same row swaps on the elements in the subvectors according to the row swapping method of the coefficient matrix. For example, referring back to Figure 6, assuming M = 9, process 1 obtains subvector 1 of b (rows 1-3 in M×1), process 2 obtains subvector 2 of b (rows 4-6 in M×1), and process 3 obtains subvector 3 (rows 7-9 in M×1). In the above example, if the solver 102 instructs process 1 to swap the second row of submatrix 1 to the first row of submatrix 2', it similarly instructs process 1 to swap the elements included in the second row of subvector 1 of b to the first row of subvector 2' of (b) in process 2. If solver 102 instructs process 1 to swap the third row of submatrix 1 to the first row of submatrix 3', then it similarly instructs process 1 to swap the elements in the third row of subvector 1 of b to the first row of subvector 3' of process 3. If solver 102 instructs process 2 to swap the first row of submatrix 1 to the second row of subvector 1', then it similarly instructs process 2 to swap the elements in the first row of subvector 2 of b to the second row of subvector 1' of process 1. And so on, swapping other rows of b in this manner, so that each process obtains a shuffled subvector ' of b. Optionally, the row swapping method for the subvectors of b can be instructed by solver 102, or it can be performed autonomously by the process without additional instruction from solver 102. For example, it is agreed that when a process shuffles and rearranges the submatrixes of the coefficient matrix, it simultaneously swaps the elements in the subvectors of b. Optionally, each process records the row swapping method performed on its subvectors of b, and then performs the inverse row transformation on the solution vector x based on the row swapping method.
[0144] Step 404: Use N processes to perform the solution operation based on N second submatrices.
[0145] This step involves multiple processes constructing preconditioners in parallel based on their respective second submatrices. Each process has a subblock of the preconditioner, and then performs the solution operation based on the subblock of its corresponding preconditioner.
[0146] Combining Figure 6 and Figure 9(b), in the block-based Jacobi iterative method, the multiple processes are based on the sub-blocks (A') on the main diagonal of the coefficient matrix A'. 11 ', A 22 ', A 33 ') Construct a preconditioner, where each process owns one sub-block (A) of that preconditioner. ii After that, each process performs parallel solving operations based on its own (preconditioner) sub-blocks.
[0147] For example, the solution operation performed by each process may also include performing the solution operation based on the sub-blocks of its own preconditioners and the sub-vectors ' of the shuffled b, etc. For example, in Figure 6, process 1 performs the solution operation based on A 11 The subvectors 1' of ' and b are subjected to iterative solution operations; process 2 is based on A 22 The subvectors 2' of ' and b are subjected to iterative solution operations; process 3 is based on A 33 The subvectors 3' of ' and b are subjected to iterative solution operations. It should be noted that other data / parameters may also be used when performing iterative solution operations, for example, the coefficient matrix A' may also be applied, depending on the iterative method adopted by the solver 102, which is not limited in this embodiment.
[0148] Through the above design, it can be seen that the second partitioning method follows the direction of anisotropy of the structured mesh. Multiple processes can construct a preconditioner that is closer to the original coefficient matrix based on the N second sub-matrices after shuffling and rearranging. This preconditioner retains the relationship information between nodes with stronger coupling, better reflects the characteristics of the original structured mesh problem, improves the quality of the constructed preconditioner, further improves the convergence of the block Jacobi method, and reduces the number of iterations.
[0149] It should be noted that the system 10 shown in Figure 1A is merely an example, and the embodiments of this application do not limit the architecture of the systems to which this task processing method may be applied. In practical applications, structured grid problems typically need to be applied in large-scale computing clusters such as high-performance computing (HPC) or supercomputers, employing a large number of parallel processes to handle the structured grid problems. Through experiments, those skilled in the art have verified that, in the CMA-GFS global 12.5km mode, the task processing method provided in this application embodiment reduces the number of iterations for solving the problem by nearly 50%. For the HPC field, this method can significantly reduce the computational load of HPC systems, save computing resources, and shorten task processing time.
[0150] After completing the iterative solution operation, each process will obtain a subvector of the solution vector x. For example, process 1 obtains subvector 1 of the solution vector x, process 2 obtains subvector 2 of the solution vector x, and process 3 obtains subvector 3 of the solution vector x.
[0151] Step 405: N processes perform shuffling operations on the subvectors of the obtained solution vector x according to the shuffling operation information, to obtain multiple subvectors ' of the solution vector x, and return the multiple subvectors ' to the application 101.
[0152] This shuffling operation includes: similar to the row transformation of elements in b, multiple processes can perform the inverse row transformation of elements in solution vector x in the same way as the row swapping of b. For example, in the example above, if process 1 swaps the 3rd row of subvector 1 of b to the 1st row of subvector 3' of b in process 3, then after process 1 obtains subvector 1 of solution vector x, process 2 obtains subvector 2 of solution vector x, and process 3 obtains subvector 3 of solution vector x, process 1 is instructed to obtain the 1st row of subvector 3 of solution vector x from process 3 and swap it back to the 3rd row of subvector 1' of solution vector x in process 1.
[0153] Similarly, if process 2 swaps the first row of subvector 2 of b to the second row of subvector 1' of b in process 1, process 2 obtains the second row of subvector 1 of solution vector x from process 1 and swaps it back to the first row of subvector 2' of solution vector x in process 1.
[0154] And so on. Each process obtains its own subvector ' of the solution vector x, and returns the subvector ' of the solution vector x to the application program 101. Optionally, the solver 101 can also assemble the subvectors ' of the solution vector x obtained by each process into a complete solution vector x and return it to the application program 101.
[0155] Optionally, the row transformation method of b can be determined based on the information recorded when the process performs a shuffling operation on b, or it can be determined based on the aforementioned shuffling operation information.
[0156] It should be noted that step 405 is an optional step. When application 101 executes this method, application 101 can generate N second submatrices based on N first submatrices and distribute the N second submatrices to the N processes of solver 102. In this case, the N processes do not need to perform the shuffling operation on the solution vector x. Optionally, when application 101 executes this method, application 101 can also perform the shuffling operation on the subvectors of the solution vector x directly returned by the N processes. This depends on how application 101 interacts with the user, and this embodiment does not limit this.
[0157] It should be noted that the above example uses a linear system of equations where b is a known vector. However, b can also be a known matrix, in which case the solution x is also a matrix. This application does not limit this approach.
[0158] The above description uses a two-dimensional structured mesh as an example. The spatial model of a three-dimensional structured mesh is more complex, but the node processing method is the same as for a two-dimensional structured mesh. Assuming a three-dimensional structured mesh includes K nodes, the corresponding coefficient matrix has a size of K×K. Referring to the method described for two-dimensional structured meshes, the multiple nodes in the three-dimensional structured mesh are divided into N parts according to the number of processes N, with each part corresponding to one process. The multiple nodes assigned to a process are numbered consecutively, and N first sub-matrices are obtained based on this. Under different partitioning methods, the nodes in the three-dimensional structured mesh will have different numbers, which will affect the row and column numbers in the coefficient matrix corresponding to the nodes. Therefore, in the task processing method of this application embodiment, the processing method for three-dimensional structured meshes is the same as that for two-dimensional structured meshes. Please refer to the above description; it will not be repeated here.
[0159] The methods provided by the embodiments of this application have been described above with reference to the accompanying drawings. The apparatus provided by the embodiments of this application will be described below with reference to the accompanying drawings.
[0160] Based on the same inventive concept as the method embodiments, this application also provides a task processing system for executing the method performed in the embodiment of FIG4 above. As shown in FIG11, the system 1100 includes an acquisition module 1101, a determination module 1102, a processing module 1103, and an execution module 1104. Specifically, in the system 1100, the modules are connected through a communication path.
[0161] The acquisition module 1101 is used to acquire the coefficient matrix of the linear equation system corresponding to the grid data. The grid data includes multiple grid point data. The values in the coefficient matrix represent the relationship between each grid point data and other grid point data. The multiple grid point data are divided into N sub-grid data according to a first partitioning method. The N sub-grid data correspond to N first sub-matrices in the coefficient matrix. Each first sub-matrice is executed by a process. N is a positive integer not less than 8. For details, please refer to the description of step 401 in the method embodiment of Figure 4, which will not be repeated here.
[0162] The determining module 1102 is used to determine whether the N first sub-matrices obtained according to the first division method are suitable for the solver to perform the solving operation on the linear equation system based on the relationship between the network point data in each first sub-matrice of the N sub-matrices; for details, please refer to the description of step 402 in the method embodiment of Figure 4, which will not be repeated here.
[0163] The processing module 1103 is used to determine N second sub-matrices obtained by dividing the grid data according to the second partitioning method when it is determined that the N first sub-matrices obtained by the first partitioning method are not suitable for the solver to perform the solution operation; for details, please refer to the description of step 403 in the method embodiment of Figure 4, which will not be repeated here.
[0164] The execution module 1104 is used to execute the N processes corresponding to the N second sub-matrices using the solver to perform the solution operation. For details, please refer to the description of step 404 in the method embodiment shown in Figure 4, which will not be repeated here.
[0165] This application also provides a computing device 1200. As shown in FIG12, the computing device 1200 includes: a bus 1202, a processor 1204, a memory 1206, and a communication interface 1208. The processor 1204, the memory 1206, and the communication interface 1208 communicate with each other via the bus 1202. The computing device 1200 may be a server, a storage array, or a hard disk enclosure, etc. It should be understood that this application does not limit the number of processors and memories in the computing device 1200.
[0166] Bus 1202 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, only one line is used in Figure 12, but this does not imply that there is only one bus or one type of bus. Bus 1202 can include pathways for transmitting information between various components of computing device 1200 (e.g., memory 1206, processor 1204, communication interface 1208).
[0167] The processor 1204 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0168] The memory 1206 may include volatile memory, such as random access memory (RAM). The processor 1204 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD), etc., without limitation.
[0169] In one embodiment, the computing device 1200 is used to perform the functions of the data processing device 1200. The memory 1206 stores executable program code, and the processor 1204 executes this executable program code to implement the functions of the aforementioned acquisition module 1101, determination module 1102, processing module 1103, and execution module 1104, thereby realizing the task processing method. That is, the memory 1206 stores instructions for the computing device 1200 to execute the task processing method provided in this application.
[0170] The communication interface 1208 uses transceiver modules such as, but not limited to, network interface cards and transceivers to enable communication between the computing device 1200 and other devices or communication networks.
[0171] This application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device may be a server. In some embodiments, the computing device may also be a desktop computer, a laptop computer, or a smartphone, or other terminal device.
[0172] As shown in Figure 13, the computing device cluster includes at least one computing device 1200. The memory 1206 of one or more computing devices 1200 in the computing device cluster may store the same instructions for executing task processing methods.
[0173] In some possible implementations, the memory 1206 of one or more computing devices 1200 in the computing device cluster may also store partial instructions for executing task processing methods. In other words, a combination of one or more computing devices 1200 can jointly execute instructions for executing task processing methods.
[0174] It should be noted that the memory 1206 in different computing devices 1200 within the computing device cluster can store different instructions, which are used to execute parts of the functions of the task processing system 1100. That is, the instructions stored in the memory 1206 of different computing devices 1200 can implement the functions of one or more modules among the acquisition module 1101, determination module 1102, processing module 1103, and execution module 1104.
[0175] In some possible implementations, one or more computing devices in a computing device cluster can be connected via a network. This network can be a wide area network (WAN) or a local area network (LAN), etc. Figure 14 illustrates one possible implementation. As shown in Figure 14, two computing devices 1200A and 1200B are connected via a network. Specifically, they are connected to the network through communication interfaces in each computing device. In this type of possible implementation, the memory 1206 in computing device 1200A stores instructions for executing the functions of the acquisition module 1101, the determination module 1102, and the processing module 1103. Simultaneously, the memory 1206 in computing device 1200B stores instructions for executing the functions of the module 1104.
[0176] It should be understood that the functions of computing device 1200A shown in Figure 14 can also be performed by multiple computing devices 1200. Similarly, the functions of computing device 1200B can also be performed by multiple computing devices 1200. For example, in some embodiments, solver 102 initiates multiple processes to solve in parallel, which may run on the same computing device 1200B or on multiple computing devices 1200B.
[0177] This application embodiment also provides another computing device cluster. The connection relationship between the computing devices in this computing device cluster can be similarly referred to the connection method of the computing device cluster described in Figures 13 and 14. The difference is that the memory 1206 of one or more computing devices 1200 in this computing device cluster can store the same instructions for executing task processing methods.
[0178] In some possible implementations, the memory 1206 of one or more computing devices 1200 in the computing device cluster may also store partial instructions for executing task processing methods. In other words, a combination of one or more computing devices 1200 can jointly execute instructions for executing task processing methods.
[0179] Based on the above embodiments, this application also provides a computer program that, when run on a computer, causes the computer to execute the task processing method provided in the embodiment shown in FIG4.
[0180] Based on the above embodiments, this application also provides a computer-readable storage medium storing a computer program. When executed by a computer, the computer program causes the computer to perform the task processing method provided in the embodiment shown in FIG4. The storage medium can be any available medium accessible to a computer. For example, but not limited to, a computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code having an instruction or data structure form and accessible by a computer.
[0181] Based on the above embodiments, this application also provides a chip for reading computer programs stored in a memory to implement the task processing method provided in the embodiment shown in FIG4.
[0182] Based on the above embodiments, this application provides a chip system including a processor for supporting a computer device in implementing the task processing method provided in the embodiment shown in FIG4. In one possible design, the chip system further includes a memory for storing necessary programs and data of the computer device. This chip system may be composed of chips or may include chips and other discrete components.
[0183] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0184] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.
[0185] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.
[0186] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.
[0187] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of protection of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A task processing method characterized by, The method comprises: obtaining a coefficient matrix of a linear equation group corresponding to grid data, wherein the grid data comprises a plurality of grid point data, values in the coefficient matrix represent relationships between each grid point data and other grid point data in the plurality of grid point data, the plurality of grid point data is divided into N sub-grid data according to a first division mode, the N sub-grid data corresponds to N first sub-matrices in the coefficient matrix, each first sub-matrix is executed by a process, and N is a positive integer not less than 2; determining whether the N first sub-matrices obtained according to the first division mode are suitable for a solver to perform a solving operation on the linear equation group according to relationships between grid point data in each first sub-matrix in the N first sub-matrices; when it is determined that the N first sub-matrices obtained according to the first division mode are not suitable for the solver to perform the solving operation, determining N second sub-matrices obtained by dividing the grid data according to a second division mode; performing the solving operation by using the solver to execute N processes corresponding to the N second sub-matrices.
2. The method of claim 1, wherein, The determination of the N second sub-matrices obtained by dividing the grid data according to the second division mode comprises: determining first grid point data corresponding to a third sub-matrix in the N second sub-matrices; determining a position of the first grid point data in the N first sub-matrices; controlling a process executing the third sub-matrix to perform a shuffle operation with a process at the determined position to obtain data in the linear equation corresponding to the first grid point data to constitute the third sub-matrix; constituting other sub-matrices in the N second sub-matrices in the same manner as constituting the third sub-matrix.
3. The method according to claim 1 or 2, characterized in that, Each grid point data in the grid data has a number after being encoded according to the first division mode; The determination of the position of the first grid point data in the N first sub-matrices comprises: determining the position of the first grid point data in the N first sub-matrices according to the number of the first grid point data.
4. The method of claim 1, wherein, The grid data is multi-dimensional grid data, and the solver comprises a preconditioned sub-block Jacobi, and the determination of whether the N first sub-matrices obtained according to the first division mode are suitable for the solver to perform the solving operation according to the relationships between the grid point data in each first sub-matrix in the N first sub-matrices comprises: judging whether the grid data is anisotropic according to the values in the coefficient matrix; if the grid data is anisotropic, the direction of anisotropy is a first direction of the multi-dimensional grid data, and a main division direction of the first division mode is the first direction, it is determined that the N first sub-matrices obtained according to the first division mode are unsuitable for the solver to perform the solving operation; the main division direction being the first direction means that when the multi-dimensional grid data is divided into N first sub-matrices according to the first division mode, the number of divisions along the first direction of the multi-dimensional grid data is greater than the number of divisions along other directions.
5. The method of claim 4, wherein, The judgment of whether the grid data is anisotropic according to the values in the coefficient matrix comprises: If the values representing the relationship between the first grid point data and every other grid point data in the coefficient matrix are all the same, then the grid data is isotropic; otherwise, the grid data is anisotropic. The first grid point is any one of the grid point data.
6. The method according to claim 4 or 5, characterized in that, The second division method is to have the fewest divisions along the first direction of the multidimensional grid data, or the main division direction of the second division method is any direction of the multidimensional grid data other than the first direction.
7. A task processing system characterized by comprising: The system includes: The acquisition module is used to acquire the coefficient matrix of the linear equation system corresponding to the grid data. The grid data includes multiple grid point data. The values in the coefficient matrix represent the relationship between each grid point data and other grid point data. The multiple grid point data are divided into N sub-grid data according to a first partitioning method. The N sub-grid data correspond to N first sub-matrices in the coefficient matrix. Each first sub-matrice is executed by a process. N is a positive integer not less than 8. The determination module is used to determine, based on the relationship between the network point data in each of the N sub-matrices, whether the N first sub-matrices obtained according to the first division method are suitable for the solver to perform the solution operation on the linear equation system; The processing module is used to determine, when it is determined that the N first sub-matrices obtained by the first partitioning method are not suitable for the solver to perform the solving operation, the N second sub-matrices obtained by partitioning the grid data according to the second partitioning method; An execution module is used to execute N processes corresponding to the N second submatrices using the solver to perform the solution operation.
8. The system of claim 7, wherein, When determining the N second sub-matrices obtained by dividing the grid data according to the second partitioning method, the processing module is specifically used for: Determine the first grid point data corresponding to the third submatrix among the N second submatrixes; Determine the position of the first network point data in the N first sub-matrices; The process executing the third sub-matrix is controlled to perform a shuffle operation with the process at the determined position to obtain the data in the linear equation corresponding to the first network point data to form the third sub-matrix; The other submatrices among the N second submatrices are constructed in the same manner as the third submatrices.
9. The system of claim 7 or 8, wherein, Each point in the grid data is encoded according to the first division method, and each point has a number. The determining module, when determining the position of the first network point data in the N first sub-matrices, is specifically used to: determine the position of the first network point data in the N first sub-matrices based on the number of the first network point data.
10. The system of claim 7, wherein, The grid data is multi-dimensional grid data. The solver includes a pre-conditional sub-block Jacobi. When the processing module determines whether the N first sub-matrices obtained according to the first partitioning method are suitable for the solver to perform the solution operation on the linear equation system based on the relationship between the grid points in each of the N first sub-matrices, it is specifically used for: Determine whether the grid data is anisotropic based on the values in the coefficient matrix; If the grid data is anisotropic, and the direction of the anisotropy is the first direction of the multidimensional grid data, and the main partitioning direction of the first partitioning method is the first direction, then it is determined that the N first sub-matrices obtained by the first partitioning method are not suitable for the solver to perform the solution operation. The term "main partitioning direction" refers to the fact that when the multidimensional grid data is divided into N first sub-matrices according to the first partitioning method, the number of partitions along the first direction of the multidimensional grid data is greater than the number of partitions along other directions.
11. The system of claim 10, wherein, The processing module, when determining whether the grid data is anisotropic based on the values in the coefficient matrix, is specifically used for: If the values representing the relationship between the first grid point data and every other grid point data in the coefficient matrix are all the same, then the grid data is determined to be isotropic; or, otherwise, the grid data is determined to be anisotropic; the first grid point is any one of the grid point data.
12. The system of claim 10 or 11, wherein, The second division method is to have the fewest divisions along the first direction of the multidimensional grid data, or the main division direction of the second division method is any direction of the multidimensional grid data other than the first direction.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores program instructions, which are computed, and the storage device performs the task processing method according to any one of claims 1-6.
14. A computer program product comprising instructions, characterized in that, When the instruction is executed by the computing system, it causes the computing system to perform the method as described in any one of claims 1-6.