Method and system for solving heat conduction of heat transfer equipment by three-diagonal heterogeneous many-core parallelism
By employing a tridiagonal heterogeneous many-core parallel solution method on the new generation Sunway architecture, combined with parallel elimination, block parallel splitting method and SIMD data vectorization, the problems of long calculation time and inaccurate results caused by the large scale of tridiagonal matrix equations in heat transfer equipment are solved, and fast and accurate temperature change analysis is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANDONG COMP SCI CENTNAT SUPERCOMP CENT IN JINAN
- Filing Date
- 2023-01-12
- Publication Date
- 2026-05-22
AI Technical Summary
In the heat transfer process of existing heat transfer equipment, the tridiagonal matrix equations are large in scale, resulting in long calculation time and inaccurate results, which cannot meet the needs of efficient analysis.
A tridiagonal heterogeneous many-core parallel solution method is adopted, utilizing the new generation Sunway 26010pro chip and heterogeneous many-core architecture. The computation process is optimized through parallel elimination, block parallel splitting method, catch-up method and SIMD data vectorization. Combined with DMA operation and communication superposition, it can quickly solve large-scale tridiagonal matrix equations.
The new generation of Sunway architecture enables fast and accurate solving of tridiagonal matrix equations, shortening analysis time, improving computational efficiency and accuracy, and supporting the design and analysis of high-temperature and high-pressure equipment.
Smart Images

Figure CN116227164B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer processing technology, and in particular to a tridiagonal heterogeneous many-core parallel solution method and system for heat conduction in heat transfer equipment. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] Many industrial processes rely heavily on heat conduction, such as the vulcanization of rubber products and the heat treatment of steel forgings. Heat conduction principles play a crucial role in the design calculations of kilns, heat transfer equipment, and thermal insulation, as well as in the temperature distribution analysis of catalyst particles. In the design of high-temperature, high-pressure equipment (such as ammonia synthesis towers and waste heat boilers in large ethylene plants), heat conduction principles are also required to calculate the temperature distribution within the heat transfer walls for thermal stress analysis. Taking heat transfer equipment as an example, the heat conduction process is a complex physical phenomenon, difficult to visualize and analyze directly. Current technologies often employ empirical methods or simulations to analyze or predict heat conduction. Empirical methods rely on operators' past experience, resulting in significant deviations and often inconsistent with actual conditions. Therefore, constructing simulation models, establishing heat conduction equations, and solving them are generally preferred to obtain more accurate analysis results on heat conduction.
[0004] The inventors discovered that solving the heat conduction equation generates a tridiagonal matrix equation. While existing parallel algorithms for tridiagonal matrix equations exist, including cyclically increasing parallel algorithms, cyclically reducing parallel algorithms, and splitting methods, their parallelism is very limited. As the simulation problem becomes increasingly complex in the heat conduction process of heat transfer equipment, the numerical model involves more parameters, resulting in increasingly larger tridiagonal matrix equations, reaching millions or even tens of millions of dimensions. The performance of workstations and small-scale single-cluster processors cannot meet the speed and accuracy requirements of large-scale computing, leading to lengthy analysis times and inaccurate results in the heat conduction process. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the purpose of this invention is to provide a tridiagonal heterogeneous many-core parallel solution method and system for heat conduction in heat transfer equipment. This method enables rapid solution of large-scale tridiagonal matrix equations on the new generation Sunway architecture, solving the problem that the large scale of the tridiagonal matrix equations to be solved in the heat conduction simulation of heat transfer equipment leads to long analysis time and inaccurate results.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solution:
[0007] The first aspect of this invention provides a tridiagonal heterogeneous many-core parallel solution method for heat conduction in heat transfer devices, comprising the following steps:
[0008] Collect the heat transfer parameters of the heat transfer equipment and establish a heat transfer model; input the heat transfer parameters into the heat transfer model and construct the heat transfer equation;
[0009] By using difference and transformation, a system of tridiagonal linear equations about heat conduction is obtained from the heat conduction equation;
[0010] The process is established based on the tridiagonal linear equation system, which includes a main kernel group consisting of a main kernel and a slave kernel group consisting of slave kernels; data dependencies of the tridiagonal matrix equation data are eliminated by parallel elimination; a portion of the new tridiagonal matrix equation formed after parallel elimination is extracted to form a smaller tridiagonal matrix equation; and the reduced tridiagonal matrix equation is solved by the catch-up method.
[0011] Each process is processed in parallel to output all remaining solutions to the tridiagonal matrix equation; and temperature change curves are plotted based on the solution results to obtain the temperature change of the heat conduction process.
[0012] Furthermore, thermal conductivity parameters include the thermal conductivity of the medium, the specific heat of the medium, the density of the medium, and the surface thermal conductivity coefficient.
[0013] Furthermore, before eliminating data dependencies in the tridiagonal matrix equation data using parallel elimination, a conditional operator is used to determine whether the process and matrix size are divisible. If they are divisible, the data dependencies in the tridiagonal matrix equation data are eliminated using parallel elimination. If they are not divisible, the first and last processes are used to send and receive non-divisible data during data transmission.
[0014] Furthermore, the specific steps for eliminating data dependencies in tridiagonal matrix equations using parallel elimination are as follows:
[0015] By segmenting the timing, the part with the longest time ratio, i.e. the computational hotspot, is the parallel elimination part of the tridiagonal matrix equation. This part is then placed into the kernel optimization to further shorten the solution time.
[0016] By modifying the solution expression to eliminate inter-block data dependencies, the tridiagonal matrix is divided into blocks for elimination, and direct memory access (DMA) operations are used to move data from main memory to the slave kernel's local storage space for memory access optimization.
[0017] Furthermore, the specific steps for eliminating elements by dividing the tridiagonal matrix into blocks are as follows: the tridiagonal matrix is divided into multiple sub-blocks, each slave core in the slave core group is responsible for processing one sub-block, and the upper diagonal of the tridiagonal matrix in the sub-block is eliminated in parallel by multiple processes, and then the lower diagonal is eliminated, and non-zero elements are introduced respectively.
[0018] Furthermore, by allocating two data spaces the size of arrays, computation and communication are superimposed, allowing the next data to be obtained while computation is being performed.
[0019] Furthermore, the extracted partial matrices are: the last row of data in the first sub-block after the slave core is divided into blocks in the slave core group of the first process, and the first and last rows of data in all other sub-blocks; the first row of data in the last sub-block after the slave core is divided into blocks in the slave core group of the last process, and the first and last rows of data in the other sub-blocks; and the first and last rows of data in each sub-block after the slave core is divided into blocks in the slave core groups of the remaining processes.
[0020] Furthermore, the process of back-substituting all remaining solutions of the tridiagonal matrix equation into parallel tasks includes three parts: the solution of the first process, the solution of the last process, and the solution of all other processes; the first and last processes each have two solution expressions, while all other processes have only one solution expression.
[0021] Furthermore, it also includes verifying the correctness and error of the solution results. The specific steps for verifying the correctness and error of the solution results are as follows: after obtaining the solution results, the residual is used to measure the degree of error by setting a check function.
[0022] A second aspect of the present invention provides a tridiagonal heterogeneous many-core parallel solution system for heat conduction in heat transfer devices, comprising:
[0023] The data acquisition module is configured to collect the heat transfer parameters of the heat transfer equipment, establish a heat transfer model, input the heat transfer parameters into the heat transfer model, and construct the heat transfer equation.
[0024] The equation transformation module is configured to transform the heat conduction equation into a tridiagonal linear system of equations about heat conduction through difference and transformation.
[0025] The equation solving module is configured to establish a process based on a tridiagonal linear equation system. The process includes a main kernel group consisting of a main kernel and a slave kernel group consisting of slave kernels. Data dependencies of the tridiagonal matrix equation data are eliminated through parallel elimination. A portion of the new tridiagonal matrix equation formed after parallel elimination is extracted to form a smaller tridiagonal matrix equation. The reduced tridiagonal matrix equation is solved using the catch-up method.
[0026] The temperature change analysis module is configured to back-substitute all remaining solutions of the tridiagonal matrix equations in a parallel manner for each process; and to plot the temperature change curves based on the solution results to obtain the temperature changes in the heat conduction process.
[0027] The above one or more technical solutions have the following beneficial effects:
[0028] This invention provides a tridiagonal heterogeneous many-core parallel solution method and system for heat conduction in heat transfer equipment. In the process of temperature change analysis, it addresses the problem that existing technologies cannot solve the large scale of the tridiagonal matrix equations required in the simulation of heat conduction phenomena in heat transfer equipment, leading to lengthy analysis times and inaccurate results. Based on the new generation of domestically produced "Sunway" series supercomputers, using the Sunway 26010pro chip and a heterogeneous many-core architecture, this invention improves the original algorithm by incorporating a catch-up method, adding non-divisible parts and verification parts, thus refining the algorithm. In terms of parallel layer partitioning, it combines three methods: data block partitioning at the core level, memory access optimization, computation and communication superposition optimization, and SIMD data vectorization, improving the computational efficiency of solving the tridiagonal matrix equations on the Sunway architecture. The improved algorithm of this invention can shorten the time for solving the equation system, obtain numerical solutions at discrete points, and finally, after post-processing, accurately analyze the temperature changes of the heat transfer equipment during the heat conduction process.
[0029] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0030] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0031] Figure 1 This is a flowchart of the tridiagonal heterogeneous many-core parallel solution method for heat conduction in a heat transfer device according to Embodiment 1 of the present invention;
[0032] Figure 2 This is a framework structure diagram of the process parallelism and thread-level parallelism scheme in Embodiment 1 of the present invention;
[0033] Figure 3 This is a schematic diagram of the master-slave kernel working state in the matrix block parallel splitting method of Embodiment 1 of the present invention;
[0034] Figure 4 This is an experimental effect diagram of the experimental verification process in Embodiment 1 of the present invention;
[0035] Figure 5 This is a schematic diagram of the equation solving module and temperature change analysis module in Embodiment 2 of the present invention. Detailed Implementation
[0036] It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of this application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0037] Tridiagonal matrices are a typical type of sparse matrix structure. The computation of implicit difference schemes for partial differential equations often involves solving tridiagonal matrix equations, and numerical solutions to partial differential equations are found in many scientific and engineering computational fields. For example, calculations in heat conduction simulation, oil and gas resource exploration, numerical oceanographic models, and fluid dynamics ultimately boil down to solving tridiagonal matrix equations.
[0038] The new generation of domestically produced "Sunway" series supercomputers adopts the Sunway 26010pro chip and a heterogeneous many-core architecture, consisting of multiple core groups. Each core group contains one master core and 64 slave cores, with each slave core having a local storage space of 256KB. The slave core array is distributed in an 8x8 pattern. Basic solver libraries such as Xmath, SWIBLAS, and SWSparse have been deployed in the new generation of Sunway many-core processors, but there is currently no parallel splitting method solver for large-scale tridiagonal matrix equations. Due to the limitation of local storage space in the slave cores of the Sunway many-core processor, existing parallel splitting methods cannot fully integrate with the Sunway hardware architecture, facing challenges such as long computation time and insufficient matrix size when solving tridiagonal matrix equations.
[0039] Example 1:
[0040] Embodiment 1 of the present invention provides a tridiagonal heterogeneous many-core parallel solution method for heat conduction in heat transfer equipment, such as... Figure 1 As shown, it includes the following steps:
[0041] S1: Collect the heat transfer parameters of the heat transfer equipment and establish a heat transfer model; input the heat transfer parameters into the heat transfer model and construct the heat transfer equation.
[0042] Taking a heat exchanger as an example, thermal conductivity parameters such as the thermal conductivity λ, specific heat c, density ρ, and surface thermal conductivity h of the medium can be obtained through the heat exchanger equipment information.
[0043] The expression for the one-dimensional heat conduction equation is as follows:
[0044]
[0045] Where, temperature u = u(x,t), λ represents the thermal conductivity of the medium, c represents the specific heat of the medium, and ρ represents the density of the medium.
[0046] S2: By using the difference and transformation of the heat conduction equation, we obtain a tridiagonal linear system of equations concerning heat conduction.
[0047] The specific process is as follows:
[0048] right Using the backward difference formula:
[0049] right Using the second-order central difference quotient formula
[0050] Therefore, the one-dimensional heat conduction expression can be transformed into:
[0051]
[0052] The finite difference method divides the region to be solved into countless tiny grids, each carrying location and temperature information. The temperature on the grid is used to approximate the actual temperature at the object's location. Therefore, the grid is split along the two directions corresponding to the horizontal axis k and the vertical axis j, denoted as u. k,j =u(x k ,t j ), where k = 0, 1, ..., nj = 0, 1, ..., m
[0053] From the difference approximation equation, we can obtain Where A is a tridiagonal matrix, the resulting tridiagonal linear equation system is as follows:
[0054]
[0055] Among them, grid Fourier number Grid Biot Mathematics U(v,t j This needs to be obtained from the temperature change equation at the boundary. In addition, the number of sample points taken by the element subdivision is also needed to determine the dimension of the tridiagonal matrix.
[0056] S3: Establish a process based on the tridiagonal linear equation system, which includes a main kernel group consisting of a master kernel and a slave kernel group consisting of slave kernels; eliminate data dependencies in the tridiagonal matrix equations using parallel elimination; extract parts of the new tridiagonal matrix equations formed after parallel elimination to form smaller tridiagonal matrix equations; solve the reduced tridiagonal matrix equations using the catch-up method; back-substitute all remaining solutions of the tridiagonal matrix equations by each process in parallel; and plot the temperature change curves based on the solution results to obtain the temperature change of the heat conduction process.
[0057] The specific solution process includes:
[0058] Step 1: Obtain the tridiagonal matrix equation data, establish a process based on the tridiagonal matrix equation data, and eliminate data dependencies in the tridiagonal matrix equation data through parallel elimination.
[0059] The process includes a master core group consisting of master cores and a slave core group consisting of slave cores. In this embodiment, the number of processes is set to p, the number of slave cores is 64, the matrix size handled by each process is m, and the data size handled by each slave core is m / 64. The specific process parallelism and thread-level parallelism schemes are as follows: Figure 2 As shown.
[0060] Step 2: Extract a portion of the new tridiagonal matrix equation formed after parallel elimination to form a smaller tridiagonal matrix equation.
[0061] Step 3: Solve the reduced tridiagonal matrix equation using the chasing method.
[0062] Step 4: Back-substitute all remaining solutions of the tridiagonal matrix equations into each process in parallel.
[0063] Step 5: Verify the correctness and error of the solution results.
[0064] The formula for the tridiagonal matrix equation is: Ax = r, where x is the unknown quantity to be solved, the coefficient matrix A is a tridiagonal matrix, and r is the known right-hand vector. Non-zero elements are distributed along the main diagonal and the two secondary diagonals; all other elements are 0. In this embodiment, the expression is...
[0065] as follows:
[0066]
[0067] In step 1, before eliminating data dependencies in the tridiagonal matrix equation data using parallel elimination, a conditional operator is used to determine whether the process and the matrix size are divisible. If they are divisible, the data dependencies in the tridiagonal matrix equation data are eliminated using parallel elimination. If they are not divisible, the first and last processes are used to send and receive non-divisible data during data transmission.
[0068] To achieve the above process, this embodiment first performs variable declaration before parallel elimination. During variable declaration, a conditional operator is used to assign the number of rows each process is responsible for. The format of the conditional operator is as follows: It indicates that expression 1 is executed if the condition is met, otherwise expression 2 is executed.
[0069] Conditions? Expression 1 : Expression 2
[0070] The corresponding operation in the code is: mem = (rank == size - 1) ? (m + final):m
[0071] Where rank is the process ID, size is the number of processes, final is the remainder when the matrix size and process are not divisible, m is the number of rows each process is responsible for when the matrix size and process are divisible, and mem is the number of rows each process is responsible for.
[0072] If the process and matrix sizes are not divisible, the data transmission and reception before and after parallel elimination and parallel solution both require the transmission of the non-divisible portion. In this case, MPI's transmission and reception functions are needed for processing; this embodiment uses conditional statements to achieve this.
[0073] The specific steps for eliminating data dependencies in tridiagonal matrix equations using parallel elimination are as follows:
[0074] (1) By segmenting the timing, the part with the longest time consumption, i.e. the computational hotspot, is the parallel elimination part of the tridiagonal matrix equation. This part is then placed into the kernel optimization to further shorten the solution time. In this embodiment, the tridiagonal matrix, which accounts for 60% of the time consumption, is placed into the kernel optimization.
[0075] (2) Eliminate data dependencies between blocks by modifying the solution expression, divide the tridiagonal matrix into blocks for elimination, and use DMA operations to move the data in the main memory to the local storage space of the slave core for memory access optimization.
[0076] It should be noted that the new generation Shenwei many-core processor has four types of many-core parallel modes: master-slave accelerated parallelism, master-slave collaborative parallelism, master-slave asynchronous parallelism, and master-slave dynamic parallelism. This embodiment uses the master-slave accelerated parallelism mode in the parallel elimination process of the parallel elimination module, such as... Figure 3 As shown, the main core performs non-parallel computations and communications for the slave cores. While the slave cores are performing computational tasks, the main core is waiting.
[0077] Thread-level parallelism is achieved through data partitioning. When partitioning data in the slave cores, the algorithm is modified to eliminate inter-block dependencies. For matrices to be computed on the slave cores, the data is evenly distributed across 64 slave cores, combining thread parallelism and process parallelism to improve computational efficiency.
[0078] Specifically, the steps for eliminating elements in a tridiagonal matrix by dividing it into blocks are as follows: the tridiagonal matrix is divided into multiple sub-blocks, each slave core in the slave core group is responsible for processing one sub-block, and the upper diagonal of the tridiagonal matrix in the sub-block is eliminated in parallel by multiple processes, and then the lower diagonal is eliminated, and non-zero elements are introduced respectively.
[0079] On the new generation of Shenwei many-core processors, LDM refers to a high-speed local data storage space for each slave core. DMA operations can transform direct access to main memory into access to the local LDM. Therefore, the DMA data transfer adopted in this embodiment is non-blocking. DMA operations are used to optimize memory access and improve the computational efficiency of parallel solution methods.
[0080] Since computation and memory access coexist in the kernel, performing the next memory access during computation can fully superimpose computation and communication, saving the time overhead of memory access and improving computational efficiency. Therefore, this embodiment uses the superposition of computation and communication to optimize the parallel elimination process of the algorithm.
[0081] Specifically, by allocating two data spaces the size of arrays, computation and communication are superimposed, allowing the next data to be obtained while computation is being performed.
[0082] In step 2, the extracted partial matrices are: the last row of data in the first sub-block after the slave core is divided into blocks in the slave core group of the first process, and the first and last rows of data in all other sub-blocks; the first row of data in the last sub-block after the slave core is divided into blocks in the slave core group of the last process, and the first and last rows of data in the other sub-blocks; and the first and last rows of data in each sub-block after the slave core is divided into blocks in the slave core groups of the remaining processes.
[0083] Step 4, which involves back-substituting each process into outputting all remaining solutions to the tridiagonal matrix equation in parallel, specifically includes three parts: the solution of the first process, the solution of the last process, and the solution of all other processes; the first and last processes each have two solution expressions, while all other processes have only one solution expression.
[0084] Specifically, the first process is divided into two solution formulas: the first one is solved by a kernel and the remaining 63 kernels are solved by kernels.
[0085] The final process is divided into two solutions: the last one is solved by a slave core, and the remaining 63 slave cores are solved by slave cores.
[0086] All other processes contain a single solution formula, implemented using a for loop of 64 iterations.
[0087] After forming a small-scale tridiagonal matrix equation, the reduced tridiagonal matrix equation is solved in the first process using the catch-up method.
[0088] Based on the relationship between the solutions of the reduced tridiagonal matrix equation and the original equation, each process is used in parallel to find all solutions of the matrix equation by back-substituting.
[0089] In this embodiment, data parallelization and vectorization are used to optimize the algorithm. The new generation Shenwei many-core processor's main core supports 256-bit SIMD extended instructions, and the slave cores support 512-bit SIMD extended instructions. To achieve vectorization of data processing, parallel solving is combined with the vector instructions of the new generation Shenwei many-core processor chip. In this embodiment, SIMD data vectorization operations are added to the parallel solving process. Specifically, vectorization in the main core includes the following sequential steps: loop unrolling and splitting, variable substitution, and operation substitution.
[0090] Specifically: the main core can process 4 double-precision floating-point operations at a time, and vectorized memory access operations must be continuous, which is perfect for arrays.
[0091] Before vectorization, `load` is used to map to the extended vector type; after vectorization, `store` is used to map to the standard type. On the main core, the double-precision extended variable type is `duoblev4`. Vectorization is equivalent to adding a `for` loop, which can reduce the bandwidth requirements for instruction access. The implementation of vectorization on the main core is as follows:
[0092] for(i=0;i<n;i=i+4)
[0093] {
[0094] s_x[i+3:i]=(s_r[x+3:i]-s_b[x+3:i]) / s_a[x+3:i]
[0095] }
[0096] The value of u(x, t) is finally obtained by using the above method, and the temperature change curve is plotted to further analyze how the temperature changes with time in a region.
[0097] This embodiment uses mesh splitting to obtain the temperature corresponding to each point, thus allowing observation of temperature changes within a region. In the design of high-temperature and high-pressure equipment, heat conduction laws are also needed to calculate the temperature distribution within the heat transfer walls of the equipment for thermal stress analysis. Therefore, the tridiagonal heterogeneous many-core parallel solution method for heat conduction in heat transfer equipment of this invention can quickly obtain temperature changes and distributions, providing new technical support for the design of high-temperature and high-pressure equipment.
[0098] In step 5, the specific steps to verify the correctness and error of the solution are as follows: after obtaining the solution, the residual is used to measure the degree of error by setting a check function.
[0099] When solving matrix equations using a programming language, since only a finite number of binary bits can be used to represent a number, therefore... The solutions obtained from matrix equations are generally approximate. Therefore, by setting a check function, the residuals are used to measure the degree of deviation from the true solution after obtaining the approximate solution.
[0100] Specifically, through and The difference is calculated and compared with the L2 norm t, where t = 10 in this embodiment. -4 When the error is greater than 10 -4 When an error occurs, it will report an error and indicate the magnitude of the error and the location of the error.
[0101] To verify the effectiveness of the method in this embodiment, an experiment was conducted. The test environment was the domestically produced heterogeneous new-generation Sunway supercomputer. The test object was a tridiagonal matrix equation, and the test core consisted of one main core and 64 slave cores. The experimental results are as follows: Figure 4 As shown.
[0102] Figure 4 The image shows a comparison of the runtime of the pure main core and the runtime after optimization when using two core groups and a matrix dimension of 832000. It includes comparisons of the hotspot optimization and the total program runtime before and after optimization. The image shows that hotspot optimization achieves a 19-fold speedup, and total runtime optimization achieves a 2.69-fold speedup. Therefore, this invention enables rapid solving of large-scale tridiagonal matrix equations on the new generation Shenwei architecture, addressing the problem of excessively long computation times caused by the large size of tridiagonal matrix equations that need to be solved on the new generation Shenwei many-core processor in simulation problems.
[0103] To address the limitations of existing parallel processing methods, which suffer from the drawbacks of workstations and small-scale single-cluster processors being unable to meet the speed and accuracy requirements of large-scale computing as simulation problems become increasingly complex and numerical models involve more parameters, resulting in larger and larger tridiagonal matrix equations with matrix dimensions reaching millions or even tens of millions of dimensions, this invention solves the aforementioned problems by using a matrix block parallel splitting method.
[0104] The matrix block parallel splitting method of this invention adds a non-divisible component, so that the matrix is not limited by the matrix size or the process being divisible during solution. It is applicable to any situation when solving tridiagonal matrix equations. When solving reduced tridiagonal matrix equations, the classic serial catching-up method is used, which has low memory access and is suitable for solving small-scale matrix equations. During the parallel solution process, the parallel solution process is vectorized using SIMD, reducing the requirement for instruction access bandwidth and improving computational efficiency.
[0105] This invention employs segmented instrumentation timing, incorporating a portion of the tridiagonal matrix into the kernel for optimization. By modifying the expression, it eliminates data dependencies within the parallel elimination module. Data is evenly divided into blocks to achieve thread-level parallelism and load balancing, tightly integrating the parallel splitting method with the unique architecture of the Sunway supercomputer to improve computational efficiency. DMA operations are used during parallel elimination, combined with batch data transfer, computation, and communication, to improve memory access efficiency and significantly shorten computation time.
[0106] This invention also adds a verification part, which uses a check function to verify the correctness and error of the final solution with residuals.
[0107] Example 2:
[0108] Embodiment 2 of the present invention provides a tridiagonal heterogeneous many-core parallel solution system for heat conduction in heat transfer equipment, comprising:
[0109] The data acquisition module is configured to collect the heat transfer parameters of the heat transfer equipment, establish a heat transfer model, input the heat transfer parameters into the heat transfer model, and construct the heat transfer equation.
[0110] The equation transformation module is configured to transform the heat conduction equation into a tridiagonal linear system of equations about heat conduction through difference and transformation.
[0111] The equation solving module and the temperature change analysis module, such as Figure 5 As shown:
[0112] The equation system solving module includes:
[0113] The parallel elimination module is configured to acquire tridiagonal matrix equation data, establish a process based on the tridiagonal matrix equation data, and the process includes a main core group consisting of main cores and a slave core group consisting of slave cores; and eliminate data dependencies in the tridiagonal matrix equation data through parallel elimination methods.
[0114] The first reduction module is configured to extract a portion of the new tridiagonal matrix equation formed after parallel elimination to form a smaller tridiagonal matrix equation.
[0115] The second reduction module is configured to solve the reduced tridiagonal matrix equation using the catch-up method.
[0116] The parallel solution module is configured to back-substitute each process in a task-parallel manner to find all remaining solutions to the tridiagonal matrix equation.
[0117] The temperature change analysis module includes:
[0118] The parallel solution module is configured to back-substitute all remaining solutions of the tridiagonal matrix equations in a task-parallel manner; and to plot temperature change curves based on the solution results to obtain the temperature changes in the heat conduction process.
[0119] The verification module is configured to verify the correctness and error of the solution results.
[0120] In the entire solution method, parallelism is divided into three types: task parallelism, thread parallelism, and SIMD data parallelism. Therefore, this embodiment combines these three parallelism methods to reasonably allocate tasks and computational load when implementing the parallel algorithm, fully utilizing the hardware architecture of the Sunway supercomputer to improve computational efficiency. Specifically, this is reflected in the following aspects:
[0121] (1) The parallel solution module uses task parallelism, with different processes executing different solution tasks. This includes the first process, the last process, and all other processes. Different formulas are used to solve for x, but the number of rows processed by each process is almost identical, negligible compared to large-scale matrices. Different processes execute different solution formulas in parallel, improving computational efficiency.
[0122] (2) The cores employ thread parallelism, which in this invention is reflected in 64 slave cores completing the computational tasks of the parallel elimination module. This module achieves load balancing by distributing data evenly across the 64 slave cores.
[0123] (3) The parallel solver module uses SIMD data parallelism. Through segmented instrumentation timing, it was found that as the matrix size increases, the parallel solver module accounts for the largest proportion, after the parallel elimination module. This module uses SIMD data parallelism to reduce the number of instructions and lower the requirement for instruction access bandwidth.
[0124] In the tridiagonal heterogeneous many-core parallel solution system for heat conduction in heat transfer equipment, this embodiment first uses a segmented instrumentation timing method to find the hot spot module of the algorithm, that is, the parallel elimination module, which takes the longest time, reaching 60% of the entire parallel solution algorithm.
[0125] Secondly, after the parallel elimination module is divided into blocks by the first process, the blocks are serial within each block and parallel between blocks. Therefore, when the process-level matrix blocks are divided into 64 thread-level slave cores, data dependencies exist between blocks. At this point, the algorithm is modified to evenly distribute the process-level matrix blocks across the 64 slave cores. By modifying the expression of the parallel solution module and the matrix size of the reduction module, the number of matrix blocks becomes 64 times the original, the matrix dimension of the reduction module becomes 64 times the original, and the parallel solution module expression changes from 3 solution formulas to 5 solution formulas.
[0126] The parallel elimination module is then placed into a slave core, and the matrix is evenly divided into 64 slave cores according to the matrix size. The relationship between the matrix size N, the array size arr_num handled by each slave core, and the number of slave cores number is as follows:
[0127] N = arr_num × number
[0128] As the matrix size increases exponentially, reaching millions or tens of millions, due to the limitation of local storage space in the slave core, it is not possible to put all the data into the slave core for optimization at once. In this embodiment, the slave core part adopts a batch return method, which requires multiple read and write operations.
[0129] The specific operation involves reading data from 64 slave cores, performing calculations, and sending the data back to main memory. Then, another 64 slave cores are called to read and send the data back, repeating this process until the entire array has been read, calculated, and sent back. At this point, the relationship between the number of iterations of the for loop and the size of the data sent by each slave core, as well as the size of the core matrix, is as follows:
[0130] count(loop count) = N / size(number of processes) ÷ 64 ÷ arr_num
[0131] Subsequently, in this embodiment, the data from the parallel elimination module is transferred to the slave core, where it is processed and the result is sent back to the master core using the CRTS_dma_iget and CRTS_dma_iput functions. DMA operations are used to change direct access to main memory to accessing LDM, improving computational efficiency.
[0132] It should be noted that this embodiment uses an optimization strategy that combines computation and communication on the basis of memory access optimization of DMA operation. Two array spaces are allocated in the kernel, and a second DMA memory access operation is initiated when the parallel elimination module completes the calculation of each parameter, so that computation and communication are superimposed to improve the overall computation efficiency.
[0133] The steps and methods involved in the above embodiment two correspond to those in embodiment one. For specific implementation details, please refer to the relevant description section of embodiment one.
[0134] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computer devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computer device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. The present invention is not limited to any particular combination of hardware and software.
[0135] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. A tridiagonal heterogeneous many-kernel parallel solution method for heat conduction in heat transfer equipment, characterized in that, Includes the following steps: Collect the heat transfer parameters of the heat transfer equipment and establish a heat transfer model; input the heat transfer parameters into the heat transfer model and construct the heat transfer equation; By using difference and transformation, a system of tridiagonal linear equations about heat conduction is obtained from the heat conduction equation; The process is established based on the tridiagonal linear equation system, which includes a main kernel group consisting of a main kernel and a slave kernel group consisting of slave kernels; data dependencies of the tridiagonal matrix equation data are eliminated by parallel elimination; a portion of the new tridiagonal matrix equation formed after parallel elimination is extracted to form a smaller tridiagonal matrix equation; and the reduced tridiagonal matrix equation is solved by the catch-up method. Each process is processed in parallel to output all remaining solutions of the tridiagonal matrix equation; and temperature change curves are plotted based on the solution results to obtain the temperature change of the heat conduction process. Before eliminating data dependencies in the tridiagonal matrix equation data using parallel elimination, a conditional operator is used to determine whether the process and the matrix size are divisible. If they are divisible, the data dependencies in the tridiagonal matrix equation data are eliminated using parallel elimination. If they are not divisible, the first and last processes are used to send and receive non-divisible data during data transmission. The specific steps for eliminating data dependencies in tridiagonal matrix equations using parallel elimination are as follows: By using segmented timing, the part with the longest time percentage, i.e. the computational hotspot, is the parallel elimination part of the tridiagonal matrix equation. This part is then placed into the kernel optimization to further shorten the solution time. By modifying the solution expression to eliminate data dependencies between blocks, the tridiagonal matrix is divided into blocks for elimination, and direct memory access operations are used to move data in main memory to the local storage space of the slave core for memory access optimization. The specific steps for eliminating elements by dividing the tridiagonal matrix into blocks are as follows: the tridiagonal matrix is divided into multiple sub-blocks, each slave core in the slave core group is responsible for processing one sub-block, and the upper diagonal of the tridiagonal matrix in the sub-block is eliminated in parallel by multiple processes, and then the lower diagonal is eliminated, and non-zero elements are introduced respectively.
2. The tridiagonal heterogeneous many-core parallel solution method for heat conduction in heat transfer equipment as described in claim 1, characterized in that, Thermal conductivity parameters include the thermal conductivity of the medium, the specific heat of the medium, the density of the medium, and the surface thermal conductivity coefficient.
3. The tridiagonal heterogeneous many-core parallel solution method for heat conduction in heat transfer equipment as described in claim 1, characterized in that, By allocating two data spaces the size of arrays, computation and communication are superimposed, allowing the next data to be obtained while computation is being performed.
4. The tridiagonal heterogeneous many-core parallel solution method for heat conduction in heat transfer equipment as described in claim 1, characterized in that, The extracted partial matrices are: the last row of data in the first sub-block after the slave core is divided into blocks in the slave core group of the first process, and the first and last rows of data in all other sub-blocks; the first row of data in the last sub-block after the slave core is divided into blocks in the slave core group of the last process, and the first and last rows of data in the other sub-blocks; and the first and last rows of data in each sub-block after the slave core is divided into blocks in the slave core groups of the remaining processes.
5. The tridiagonal heterogeneous many-core parallel solution method for heat conduction in heat transfer equipment as described in claim 1, characterized in that, The process of back-substituting each process in parallel to output all remaining solutions to the tridiagonal matrix equation includes three parts: the solution of the first process, the solution of the last process, and the solution of all other processes; the first and last processes each have two solution expressions, while all other processes have only one solution expression.
6. The tridiagonal heterogeneous many-core parallel solution method for heat conduction in heat transfer equipment as described in claim 1, characterized in that, It also includes verifying the correctness and error of the solution results. The specific steps for verifying the correctness and error of the solution results are as follows: by setting a check function, after obtaining the solution results, the residual is used to measure the degree of error.
7. A tridiagonal heterogeneous many-core parallel solution system for heat conduction in heat transfer equipment, characterized in that, include: The data acquisition module is configured to collect the heat transfer parameters of the heat transfer equipment and establish a heat transfer model; Input the heat conduction parameters into the heat transfer model and construct the heat conduction equation; The equation transformation module is configured to transform the heat conduction equation into a tridiagonal linear system of equations about heat conduction through difference and transformation. The equation solving module is configured to establish a process based on a tridiagonal linear equation system. The process includes a main kernel group consisting of a main kernel and a slave kernel group consisting of slave kernels. Data dependencies of the tridiagonal matrix equation data are eliminated through parallel elimination. A portion of the new tridiagonal matrix equation formed after parallel elimination is extracted to form a smaller tridiagonal matrix equation. The reduced tridiagonal matrix equation is solved using the catch-up method. The temperature change analysis module is configured to back-substitute all remaining solutions of the tridiagonal matrix equations in a parallel task manner; and to plot the temperature change curves based on the solution results to obtain the temperature changes in the heat conduction process. Before eliminating data dependencies in the tridiagonal matrix equation data using parallel elimination, a conditional operator is used to determine whether the process and the matrix size are divisible. If they are divisible, the data dependencies in the tridiagonal matrix equation data are eliminated using parallel elimination. If they are not divisible, the first and last processes are used to send and receive non-divisible data during data transmission. The specific steps for eliminating data dependencies in tridiagonal matrix equations using parallel elimination are as follows: By using segmented timing, the part with the longest time percentage, i.e. the computational hotspot, is the parallel elimination part of the tridiagonal matrix equation. This part is then placed into the kernel optimization to further shorten the solution time. By modifying the solution expression to eliminate data dependencies between blocks, the tridiagonal matrix is divided into blocks for elimination, and direct memory access operations are used to move data in main memory to the local storage space of the slave core for memory access optimization. The specific steps for eliminating elements by dividing the tridiagonal matrix into blocks are as follows: the tridiagonal matrix is divided into multiple sub-blocks, each slave core in the slave core group is responsible for processing one sub-block, and the upper diagonal of the tridiagonal matrix in the sub-block is eliminated in parallel by multiple processes, and then the lower diagonal is eliminated, and non-zero elements are introduced respectively.