Distributed hydrological model GPU acceleration method based on grid space decomposition optimization
Through the distributed hydrological model GPU acceleration method based on grid space decomposition optimization, the problem of low efficiency of the CPU acceleration method is solved, and the rapid calculation and efficient simulation of high-precision watershed grids are realized, which meets the real-time flood forecasting needs.
Patent Information
- Application Number
- CN202411005188.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-11-26
AI Technical Summary
The existing CPU acceleration method cannot effectively improve the computing efficiency of the high-fine grid basin flood distribution model and cannot meet the needs of real-time flood forecasting.
Adopting the distributed hydrological model GPU acceleration method based on grid space decomposition optimization, by establishing the key-value pair sequence of source and sink items, grouping and performing parallel calculations under the CUDA framework, eliminating the source items step by step to achieve water depth and flow fast calculations.
The maximum acceleration ratio of parallel computing is significantly improved, the second-level computing efficiency is achieved, and the distributed hydrological model simulation calculation of high-precision grids is versatile and efficient, and the calculation results are consistent with the CPU serial parallel computing.
Smart Images

Figure CN119025265A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of basin flood simulation, and in particular to a distributed hydrological model GPU acceleration method based on grid space decomposition optimization. Background Art
[0002] Parallel computing technology has very important applications in the field of distributed hydrological model calculations for watersheds with more than one million grids. Since the early serial computing technology (Vivoni et al, 2011. Real-world hydrologicassessment of a fully-distributed hydrological model in a parallel computing environment. Journal of Hydrology, 409 (1-2): 483-496.), parallel computing of distributed hydrological models has been a hot research topic.
[0003] For the algorithm simulation of basin flood distributed model with high-precision grid, the most common method is to decompose the tree structure space of the grid and adopt the computing framework of MPI / cluster, Encore Parallel Fortran / symmetric multiprocessor, OpenMP cluster and EGEE grid to increase the maximum acceleration ratio and improve the computing efficiency. In order to maximize the maximum speedup ratio of parallel computing, many research works have proposed different parallel computing distributed models for grid space decomposition and parallel computing methods, such as (Kolditz O, Du Y, Burger C, et al. 2007. Development of a regional hydrologicsoil model and application to the Beerze-Reusel drainage basin. Environmental Pollution, 148(3): 855-866.)(Apostolopoulos TK, Georgakakos K P. 1997. Parallel computation for streamflow prediction with distributed hydrologic models. Journal of Hydrology, 197(1-4): 1-24.)(Xu R, Huang XX, Luo L, et al. 2010. A new grid-associated algorithm in the distributed hydrological models simulations. Science China: Technological Sciences, 53(1): 235-241.)(Yalew S, van Griensven A, Ray N, et al.2013.Distributed computation of large scale SWATmodels on the Grid.Environmental Modelling&Software,41:223-230.) etc. Based on these parallel computing distributed models, many spatial decomposition parallel computing methods have been proven to improve computing efficiency.Among them, (Kolditz O, Du Y, Burger C, et al. 2007. Development of a regional hydrologic soil model and application to the Beerze-Reusel drainage basin. Environmental Pollution, 148 (3): 855-866.) used MPI / cluster and adopted a parallel computing method for independent models to achieve the effect of improving the maximum speedup ratio; (Apostolopoulos TK, Georgakakos K P. 1997. Parallel computation for streamflow prediction with distributed hydrologic models. Journal of Hydrology, 197 (1-4): 1-24.) proposed a parallel computing method for sequential dependent models running on Encore Parallel Fortran / symmetric multiprocessors to calculate the flood simulation process of the sub-basin; (Xu R, Huang XX, Luo L, et al. 2010. A new grid-associated algorithm in the distributed hydrological model simulations. Science China: Technological Sciences, 53(1):235-241.) proposed a parallel computing method running on OpenMP / multi-core processors to calculate the flood simulation process of sub-basins and grid cells. However, all these methods focus on CPU-accelerated spatial decomposition parallel computing technology, which makes the maximum speedup ratio increase slowly and cannot be used in real-time flood forecasting applications.
[0004] Another related method focuses more on parallel computing with temporal parallelism, by using MPI / cluster CPU to accelerate parallel computing technology. One of the commonly used ideas is to divide the entire simulation duration into multiple time periods, and consider the upstream and downstream relationships of the computing units to interleave the calculations. For example, (Wang H.2011.A high-performance temporal-spatialdiscretization method for the parallel computing of river basins[D].Beijing,China:Tsinghua University.) uses the temporal and spatial dependency order of the computing units and sets the parallel computing rule of "upstream units immediately pass information to downstream units after completing the calculation of the current period, and downstream units start the calculation of the current period, while upstream units start the calculation of the next period" to improve the maximum speedup ratio.
[0005] In addition, there is another type of parallel computing that uses spatially decomposed tightly coupled models. This type of model increases the maximum speedup ratio by regional decomposition (Cheng JRC, Hunter RM, Cheng HP, et al. 2005. Parallelization of the WASH123D code, Phase II: Coupled two-dimensional overland and three-dimensional subsurface flows. Proceedings of World Water and Environmental Resources Congress 2005. Anchorage, Alaska, United States, May 15-19) or by dividing the large river basin into sub-basins and reducing communication overhead by weakening the information exchange between sub-basins. This improves the maximum speedup ratio while introducing certain errors (Su D Y. 2012. Study on the parallelization of a physics-based hydrologic model InHM utilizing computer cluster [D]. Hangzhou, China: Zhejiang University.).
[0006] Recently, a method based on GPU cluster parallel computing (Qin CZ, Zhan LJ. 2012. Parallelizing flow-accumulation calculations on Graphics Processing Units: From iterative DEM preprocessing algorithm to recursive multiple-flow-direction algorithm. Computers & Geosciences, 43: 7-16) can use GPU computing units to improve the efficiency of hydrological runoff accumulation calculations, but it cannot directly calculate flood flow and water depth processes. Summary of the invention
[0007] The purpose of the present invention is to provide a distributed model GPU accelerated computing method based on grid space decomposition optimization in view of the deficiencies of the prior art.
[0008] The object of the present invention is achieved through the following technical solution: a distributed hydrological model GPU acceleration method based on grid space decomposition optimization, comprising the following steps:
[0009] (1) Calculation of source and sink items of grid cells: Establish source and sink grid coding key-value pair sequences based on grid flow directions;
[0010] (2) Grouping of N-level grid cells: Filter out the grids with only sink items and no source items from the N-level remaining source and sink item grid code key-value pair sequence to form an N-level grid sequence;
[0011] (3) N+1 level grid unit grouping: remove the key-value pairs of the source item containing the N-level grid sequence from the N-level residual source and sink item grid code key-value pair sequence to form the N+1 level residual source and sink item grid code key-value pair sequence, return to step (2) until the loop ends, and complete the GPU acceleration of the hydrological model.
[0012] Furthermore, the step (1) includes the following sub-steps:
[0013] (1.1) Based on the grid D8 flow direction data, calculate the source and sink items of each grid;
[0014] (1.2) Based on the source and sink results of each grid calculated in step (1.1), a one-to-one correspondence between the source item code and the sink item code is established and stored as a sequence of source item grid code and sink item grid code key-value pair data.
[0015] Furthermore, the step (2) includes the following sub-steps:
[0016] (2.1) Starting from N=1, the key-value pair sequence of the N-level remaining source and sink grid codes is counted. The key-value pair sequence when N=1 is the entire key-value pair sequence. The grids with only sink items but no source items are screened out and their flow results are output. The remaining grids form an N-level grid sequence. The hydrological calculation of the grid cells in this level of grid sequence is independent, which meets the GPU computing requirements.
[0017] (2.2) Based on the DEM data and the N-level grid sequence obtained in step (2.1), batch input is made into the GPU computing unit, and the distributed model program is driven under the CUDA framework to calculate the water depth {h} of the N-level grid sequence N and flow {q} N , where the flow is added to the flow of the sink grid of each grid; water depth {h} N Output to the water depth results of the distributed hydrological model.
[0018] Furthermore, the sink grid of each grid in step (2.2) is specifically calculated as follows:
[0019] For any grid i∈{C} N , first calculate the flow With water depth Output the water depth to the model water depth result;
[0020] By querying the N-level remaining source and sink grids, the key-value pair sequence {C s , C c} N , that is, C s =i, you can query C c = j sink grid, the flow of grid i is fed into grid j, and the way of feeding is related to the hydrological model:
[0021] q j + = f(q i )
[0022] Where F(q i ) is the flow routing function, which depends on the flow calculation structure of the hydrological model.
[0023] Furthermore, the step (3) includes the following sub-steps:
[0024] (3.1) Based on the N-level residual source and sink grid code key-value pair sequence, the key-value pairs are screened one by one according to the source items. If the N-level grid sequence contains the source item of the key-value pair, the key-value pair is deleted from the N-level residual source and sink grid code key-value pair sequence, otherwise it is retained to form an N+1-level residual source and sink grid code key-value pair sequence;
[0025] (3.2) Based on the N+1 level remaining source and sink grid encoding key-value pair sequence generated in step (3.1), filter out the grids with only sink items but no source items, and assign their flow results {q} N Output to the distributed hydrological model flow result file, the remaining grids form an N+1 level grid sequence, the hydrological calculation of the grid cells in this level grid sequence is independent, meeting the GPU computing requirements;
[0026] (3.3) Based on the N+1 level grid sequence obtained in step (3.2), batch input is made into the GPU computing unit, and the distributed model program is driven under the CUDA framework to calculate the water depth {h} of the N+1 level grid sequence N+1 and flow {q} N+1 , where the flow is added to the flow of the sink grid of each grid; water depth {h} N+1 Output to the water depth results of the distributed model;
[0027] (3.4) Repeat step (2) until the number of N-level remaining source and sink grid code key-value pair sequences is equal to 0, and output the flow {q} of the N-1-level grid sequence N-1 , the calculation ends.
[0028] Furthermore, the sink grid of each grid in step (3.3) is specifically calculated as follows:
[0029] For any grid i∈{C} N+1 , first calculate the flow With water depth Output the water depth to the model water depth result;
[0030] By querying the N+1 level remaining source and sink grid encoding key-value pair sequence {C s ,C c} N+1 , that is, C s =i, you can query C c = j sink grid, the flow of grid i is fed into grid j, and the way of feeding is related to the hydrological model:
[0031] q j + = f(q i )
[0032] Where f(q i ) is the flow routing function, which depends on the flow calculation structure of the hydrological model.
[0033] Specifically, the flow data grid accuracy of the DEM and D8 is 8m×8m, and the number of grids is 3432×2578.
[0034] The present invention also provides a distributed hydrological model GPU acceleration device based on grid space decomposition optimization, comprising the following modules:
[0035] Grid unit source and sink calculation module: establish source and sink grid coding key-value pair sequence based on grid flow direction;
[0036] N-level grid unit grouping module: Filter out the grids with only sink items and no source items from the N-level remaining source and sink item grid code key-value pair sequence to form an N-level grid sequence;
[0037] N+1-level grid unit grouping module: remove the key-value pairs of the source item containing the N-level grid sequence from the N-level residual source and sink item grid code key-value pair sequence to form the N+1-level residual source and sink item grid code key-value pair sequence, return to the N-level grid unit grouping module until the loop ends, and complete the GPU acceleration of the hydrological model.
[0038] An electronic device, comprising:
[0039] one or more processors;
[0040] A memory for storing one or more programs;
[0041] When the one or more programs are executed by the one or more processors, the one or more processors implement the distributed hydrological model GPU acceleration method based on grid space decomposition optimization.
[0042] A computer-readable storage medium stores computer instructions, which, when executed by a processor, implement the steps of a distributed hydrological model GPU acceleration method based on grid space decomposition optimization.
[0043] The beneficial effects of the present invention are as follows:
[0044] By constructing a spatial decomposition optimization grouping method for tree-structured grids, the water depth and flow results of the distributed hydrological model are calculated in parallel under the CUDA framework, which can effectively improve the maximum acceleration ratio of parallel computing and greatly improve the calculation efficiency of the distributed hydrological model of high-precision grids. At the same time, the water volume and energy balance in the calculation process are guaranteed by alternating output. The present invention proposes for the first time a spatial decomposition optimization GPU acceleration calculation method for a high-precision tree-structured grid basin distributed hydrological model. While greatly improving the maximum acceleration ratio of parallel computing, it can achieve a calculation result that is completely consistent with the CPU serial parallel calculation. It can achieve distributed hydrological model simulation calculations with a computing efficiency of seconds for high-precision basins with more than one million grids. The effect is better than the existing methods, and it has the advantages of strong versatility and ease of use. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1is the input data diagram of the trial example using this method; (a) is the digital elevation DEM map, (b) is the grid D8 flow map generated by (a);
[0046] Figure 2 : is a grid space decomposition optimization result diagram of the trial example using the existing method; wherein (a) is the overall grid calculation unit diagram, (b) is the grid calculation sequence distribution diagram when N=1 calculated based on (a); (c) is the grid calculation sequence distribution diagram when N=2; (d) is the grid calculation sequence distribution diagram when N=3; (e) is the grid calculation sequence distribution diagram when N=4; (f) is the grid calculation sequence distribution diagram when N=5; (g) is the grid calculation sequence distribution diagram when N=6; (h) is the grid calculation sequence distribution diagram when N=7;
[0047] Figure 3 It is an input and calculation result diagram of an implementation example using the existing method; wherein (a) is a high-precision DEM data diagram, (b) is a D8 flow direction data diagram calculated based on diagram (a), (c) is a water depth result diagram calculated using the data of diagrams (a) and (b); (d) is a flow result diagram calculated using the data of diagrams (a) and (b). DETAILED DESCRIPTION
[0048] The core technology of the present invention is to construct a parallel computing GPU acceleration algorithm for spatial decomposition optimization of tree-structured grids and thereby implement GPU parallel computing in distributed hydrological models to achieve rapid calculation of flow and water depth at a high-precision basin grid scale.
[0049] The present invention proposes a GPU accelerated calculation method suitable for a tree-structured grid distributed hydrological model, comprising the following steps:
[0050] (1) Establishing source and sink grid code key-value pair sequences based on grid flow direction; specifically including the following sub-steps:
[0051] (1.1) Encode the DEM grid (digital elevation model grid) and calculate the source and sink items of each grid based on the grid D8 flow direction data generated by the DEM.
[0052] (1.2) According to the calculated source and sink results of each grid, the source term code C is established. s Sink-term coding C c One-to-one correspondence between source and sink grid codes, stored as key-value pair sequence data {C s ,C c}.
[0053] According to the above method, all the source and sink grid encoding key-value pair sequence data of the tree structure grid are obtained. s ,C c}N=1 .
[0054] (2) Starting from N=1, the N-level remaining source and sink grid code key-value pair sequence (when N=1, all source and sink grid code key-value pair sequence data {C s ,C c} N=1 ) to filter out the grids with only sink items but no source items to form an N-level grid sequence; specifically, the following sub-steps are included:
[0055] (2.1) Starting from N=1, encode the key-value pair sequence {C s ,C c} N Perform statistics, filter out the grids with only sink items but no source items, output the flow results of the grids with only sink items but no source items, and the remaining grids form an N-level grid sequence {C} N , the hydrological calculations of the grid cells in this level of grid sequence are independent, meeting the GPU computing requirements.
[0056] (2.2) Starting from N=1, based on the N-level grid sequence {C} N , batch input GPU computing unit, drive the distributed model program to calculate N-level grid sequence under the CUDA framework {C} N The water depth and flow rate are added to the flow rate of the sink grid of each grid. The specific calculation of a single grid is as follows:
[0057] For any grid i∈{C}N, first calculate the flow With water depth Output the water depth to the model water depth result;
[0058] By querying the N-level remaining source and sink grids, the key-value pair sequence {C s , C c} N , that is, C s =i, you can query C c = j sink grid, the flow of grid i is fed into grid j, and the way of feeding is related to the hydrological model:
[0059] q j + = f(q i )
[0060] Where F(q i ) is the flow routing function, which depends on the flow calculation structure of the hydrological model.
[0061] This method inputs the grid groups decomposed from the space into GPU units for parallel computing.
[0062] (3) Encode the key-value pair sequence {C s , C c} N The key-value pairs of the N-level grid sequence are eliminated to form the N+1-level remaining source and sink grid encoding key-value pair sequence {C s , C c} N+1 , repeat step 2 until the loop ends, which specifically includes the following sub-steps:
[0063] (3.1) Generate N+1 level residual source and sink grid coded key-value pair sequence: Based on the N level residual source and sink grid coded key-value pair sequence in step 2 {C s , C c} N , filter the key-value pairs one by one according to the source items, such as N-level grid sequence {C} N If the source item contains the key-value pair, the key-value pair is deleted from the N-level remaining source and sink item grid coding key-value pair sequence, otherwise it is retained to form the N+1-level remaining source and sink item grid coding key-value pair sequence {C s , C c} N+1 .
[0064] (3.2) Generate N-level grid sequence: Encode the key-value pair sequence {C s , C c} N+1 Perform statistics, filter out the grids with only sink items but no source items, output the flow results of the grids with only sink items but no source items, and the remaining grids form an N+1 level grid sequence {C} N+1 , the hydrological calculations of the grid cells in this level of grid sequence are independent, meeting the GPU computing requirements.
[0065] (3.3) Calculation result output: Based on N+1 level grid sequence {C} N+1 , batch input GPU computing unit, drive the distributed model program to calculate N+1 level grid sequence under the CUDA framework {C} N+1 The water depth and flow rate are added to the flow rate of the sink grid of each grid. The specific calculation of a single grid is as follows:
[0066] For any grid i∈{C} N+1 , first calculate the flow With water depth Output the water depth to the model water depth result;
[0067] By querying the N+1 level remaining source and sink grid encoding key-value pair sequence {C s , C c} N+1 , that is, Cs =i, you can query C c = j sink grid, the flow of grid i is fed into grid j, and the way of feeding is related to the hydrological model:
[0068] q j + = f(q i )
[0069] Where F(q i ) is the flow routing function, which depends on the flow calculation structure of the hydrological model.
[0070] (3.4) Open the loop and jump to step 2 until the number of N remaining source and sink grid code key-value pairs is equal to 0, and output the flow q of the N-1 level grid sequence N-1 , the calculation ends.
[0071] like Figure 1 and Figure 2 , which is a graph of the input data of a test case using this method; Figure 1 (a) is the digital elevation DEM map, and (b) is the grid D8 flow map generated by (a); Figure 2 This is the grid space decomposition optimization result diagram of the test case using the existing method; Figure 2 (a) is the overall grid calculation unit diagram, (b) is the grid calculation sequence distribution diagram when N=1 calculated based on (a); (c) is the grid calculation sequence distribution diagram when N=2; (d) is the grid calculation sequence distribution diagram when N=3; (e) is the grid calculation sequence distribution diagram when N=4; (f) is the grid calculation sequence distribution diagram when N=5; (g) is the grid calculation sequence distribution diagram when N=6; (h) is the grid calculation sequence distribution diagram when N=7, at which time the calculation ends.
[0072] The present invention also provides a distributed hydrological model GPU acceleration device based on grid space decomposition optimization, comprising the following modules:
[0073] Grid unit source and sink calculation module: establish source and sink grid coding key-value pair sequence based on grid flow direction;
[0074] N-level grid unit grouping module: Filter out the grids with only sink items and no source items from the N-level remaining source and sink item grid code key-value pair sequence to form an N-level grid sequence;
[0075] N+1-level grid unit grouping module: remove the key-value pairs of the source item containing the N-level grid sequence from the N-level residual source and sink item grid code key-value pair sequence to form the N+1-level residual source and sink item grid code key-value pair sequence, return to the N-level grid unit grouping module until the loop ends, and complete the GPU acceleration of the hydrological model.
[0076] An electronic device, comprising:
[0077] one or more processors;
[0078] A memory for storing one or more programs;
[0079] When the one or more programs are executed by the one or more processors, the one or more processors implement the distributed hydrological model GPU acceleration method based on grid space decomposition optimization.
[0080] A computer-readable storage medium stores computer instructions, which, when executed by a processor, implement the steps of a distributed hydrological model GPU acceleration method based on grid space decomposition optimization.
[0081] Implementation Examples
[0082] The implementation example of the present invention was implemented on a machine equipped with an Intel Core i7-8750H CPU, an NVidia GTX1050Ti GPU and 16GB of memory. The grid accuracy of the DEM and D8 flow data in this example is 8m×8m, the number of grids is 3432×2578, and all the methods listed in the specific implementation method are used to obtain the attached Figure 3 Experimental results (where (a) is a high-precision DEM data map, (b) is a D8 flow direction data map calculated based on (a), (c) is a water depth result map calculated using the data in (a) and (b); (d) is a flow result map calculated using the data in (a) and (b). The grid accuracy of the water depth and flow results in the results is also 8m×8m, and the number of grids is 3432×2578.
[0083] right Figure 3 The high-precision watershed shown in the figure was subjected to a CPU parallel comparison test on the same machine. The results show that this method can greatly improve the computing efficiency. For a watershed with 8847696 grids, it can ensure a single-step computing rate of about 5 seconds (CPU parallel single-step computing efficiency of about 1 hour), and at the same time obtain the same computing results as CPU parallel computing.
Claims
1. A GPU acceleration method for distributed hydrological model based on grid space decomposition optimization, characterized in that: The steps include: (1) Calculation of source and sink items of grid cells: Establish source and sink grid coding key-value pair sequences based on grid flow directions; (2) Grouping of N-level grid cells: Filter out the grids with only sink items and no source items from the N-level remaining source and sink item grid code key-value pair sequence to form an N-level grid sequence; (3) N+1 level grid unit grouping: remove the key-value pairs of the source item containing the N-level grid sequence from the N-level residual source and sink item grid code key-value pair sequence to form the N+1 level residual source and sink item grid code key-value pair sequence, return to step (2) until the loop ends, and complete the GPU acceleration of the hydrological model.
2. According to claim 1, a distributed hydrological model GPU acceleration method based on grid space decomposition optimization is characterized in that: The step (1) comprises the following sub-steps: (1.1) Based on the grid D8 flow direction data, calculate the source and sink items of each grid; (1.2) Based on the source and sink results of each grid calculated in step (1.1), a one-to-one correspondence between the source item code and the sink item code is established and stored as a sequence of source item grid code and sink item grid code key-value pair data.
3. The GPU acceleration method for distributed hydrological model based on grid space decomposition optimization according to claim 2 is characterized in that: The step (2) comprises the following sub-steps: (2.1) Starting from N=1, the key-value pair sequence of the N-level remaining source and sink grid codes is counted. The key-value pair sequence when N=1 is the entire key-value pair sequence. The grids with only sink items but no source items are screened out and their flow results are output. The remaining grids form an N-level grid sequence. The hydrological calculation of the grid cells in this level of grid sequence is independent, which meets the GPU computing requirements. (2.2) Based on the DEM data and the N-level grid sequence obtained in step (2.1), batch input is made into the GPU computing unit, and the distributed model program is driven under the CUDA framework to calculate the water depth of the N-level grid sequence*h+ N and flow rate*q+ N , where the flow is added to the flow of the sink grid of each grid; water depth*h+ N Output to the water depth results of the distributed hydrological model.
4. The GPU acceleration method for distributed hydrological model based on grid space decomposition optimization according to claim 3 is characterized in that: The specific calculation of the sink grid of each grid in step (2.2) is as follows: For any grid i∈*C+ N , first calculate the flow With water depth Output the water depth to the model water depth result; By querying the N-level remaining source and sink grid encoding key-value pair sequence *C s ,C c + N , that is, C s =i, you can query C c = j sink grid, the flow of grid i is fed into grid j, and the way of feeding is related to the hydrological model: q j +=f(q i ) Where f(q i ) is the flow routing function, which depends on the flow calculation structure of the hydrological model.
5. The distributed hydrological model GPU acceleration method based on grid space decomposition optimization according to claim 1 is characterized in that: The step (3) comprises the following sub-steps: (3.1) Based on the N-level residual source and sink grid code key-value pair sequence, the key-value pairs are screened one by one according to the source items. If the N-level grid sequence contains the source item of the key-value pair, the key-value pair is deleted from the N-level residual source and sink grid code key-value pair sequence, otherwise it is retained to form an N+1-level residual source and sink grid code key-value pair sequence; (3.2) Based on the N+1 level remaining source and sink grid code key-value pair sequence generated in step (3.1), filter out the grids with only sink items but no source items, and assign their flow results*q+ N Output to the distributed hydrological model flow result file, the remaining grids form an N+1 level grid sequence, the hydrological calculation of the grid cells in this level grid sequence is independent, meeting the GPU computing requirements; (3.3) Based on the N+1 level grid sequence obtained in step (3.2), batch input is made into the GPU computing unit, and the distributed model program is driven under the CUDA framework to calculate the water depth of the N+1 level grid sequence *h+ N+1 and flow rate*q+ N+1 , where the flow is added to the flow of the sink grid of each grid; water depth*h+ N+1 Output to the water depth results of the distributed model; (3.4) Repeat step (2) until the number of N-level remaining source and sink grid code key-value pair sequences is equal to 0, and output the flow rate of N-1-level grid sequence *q+ N-1 , the calculation ends.
6. The GPU acceleration method for distributed hydrological model based on grid space decomposition optimization according to claim 5 is characterized in that: The specific calculation of the sink grid of each grid in step (3.3) is as follows: For any grid i∈*C+ N+1 , first calculate the flow With water depth Output the water depth to the model water depth result; By querying the N+1 level remaining source and sink grid encoding key-value pair sequence *C s ,C c + N+1 , that is, C s =i, you can query C c = j sink grid, the flow of grid i is fed into grid j, and the way of feeding is related to the hydrological model: q j +=f(q i ) Where f(q i ) is the flow routing function, which depends on the flow calculation structure of the hydrological model.
7. The GPU acceleration method for distributed hydrological model based on grid space decomposition optimization according to claim 1 is characterized in that: The grid accuracy of the flow data of the DEM and D8 is 8m×8m, and the number of grids is 3432×2578.
8. A distributed hydrological model GPU acceleration device based on grid space decomposition optimization, characterized in that: It includes the following modules: Grid unit source and sink calculation module: establish source and sink grid encoding key-value pair sequence based on grid flow direction; N-level grid unit grouping module: Filter out the grids with only sink items and no source items from the N-level remaining source and sink item grid code key-value pair sequence to form an N-level grid sequence; N+1 level grid unit grouping module: remove the key-value pairs of the source item containing the N-level grid sequence from the N-level residual source and sink item grid code key-value pair sequence to form the N+1 level residual source and sink item grid code key-value pair sequence, return to step (2) until the loop ends, and complete the GPU acceleration of the hydrological model.
9. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement a distributed hydrological model GPU acceleration method based on grid space decomposition optimization as described in any one of claims 1 to 7.
10. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instruction is executed by the processor, the steps of a distributed hydrological model GPU acceleration method based on grid space decomposition optimization as described in any one of claims 1 to 7 are implemented.
