Study on Large-Scale Urban Water Distribution Network Computation Method Based on a GPU Framework
Abstract
:1. Introduction
2. Computing Methods and Architecture
2.1. GGA “Direct” Flow-Pressure d(H) Approach
2.2. CPU Computing Architecture
- (1)
- Load data from the main memory to the L3 cache.
- (2)
- Perform partial computations and move data to the L2 cache.
- (3)
- Continue computations and move data to the L1 cache.
- (4)
- Complete computations and move data to the CPU core.
- (5)
- Compute L and U matrices in the CPU core and store results back in the L1 cache.
- (6)
- Use L and U to compute the inverse matrix in the CPU core and store results in the L1 cache.
- (7)
- Results are stored back from the L1 cache -> L2 cache -> L3 cache -> main memory.
2.3. GPU Computing Architecture
- (1)
- Data is loaded from global memory to the shared memory of thread blocks.
- (2)
- Data is loaded from shared memory to the registers of each thread.
- (3)
- Each GPU core performs computations, storing results back in registers, then shared memory, and finally back in global memory.
3. Model Calculation Results
3.1. Validation of Computational Model Stability
3.2. Validation of GPU Acceleration Performance
3.3. Comparison of GPU Acceleration Performance across Different Devices
4. Discussion
4.1. Analysis of GPU Model Computational Efficiency
4.2. Analysis of Differences in GPU Computational Performance
5. Conclusions
6. Future Prospects
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Wang, J.; Liu, G.H.; Wang, J.; Xu, X.; Shao, Y.; Zhang, Q.; Liu, Y.; Qi, L.; Wang, H. Current status, existent problems, and coping strategy of urban drainage pipeline network in China. Environ. Sci. Pollut. Res. Int. 2021, 28, 43035–43049. [Google Scholar] [CrossRef] [PubMed]
- Chi, X.; Zhenyang, P.; Hongya, Z.; Zijie, H. Study of Comprehensive Utilization of Water Resources of Urban Water Distribution Network. Water 2021, 13, 2791. [Google Scholar] [CrossRef]
- Cieślak, B.T.; Szpak, D.; Żywiec, J.; Rożnowski, M. The concept of estimating the risk of water losses in the water supply network. J. Environ. Manag. 2024, 359, 120965. [Google Scholar] [CrossRef] [PubMed]
- Carlos, J.-A.; Ivan, S. Pipe breaks and estimating the impact of pressure control in water supply networks. Reliab. Eng. Syst. Saf. 2021, 210, 107525. [Google Scholar]
- Junling, W.; Honghong, W.; Liantao, N. Hydraulic Simulation of Water Supply Network Leakage Based on EPANET. J. Pipeline Syst. Eng. Pract. 2024, 15, 05023006. [Google Scholar]
- Qian, J.; Du, Y.; Liang, F.; Yi, J.; Wang, N.; Tu, W.; Huang, S.; Pei, T.; Ma, T.; Burghardt, K.; et al. Evaluating resilience of urban lifelines against flooding in China using social media data. Int. J. Disaster Risk Reduct. 2024, 106, 104453. [Google Scholar] [CrossRef]
- Liu, H.; Savić, D.A.; Kapelan, Z.; Creaco, E.; Yuan, Y. Reliability Surrogate Measures for Water Distribution System Design: Comparative Analysis. J. Water Resour. Plan. Manag. 2016, 143, 04016072. [Google Scholar] [CrossRef]
- Wannapop, R.; Jearsiripongkul, T.; Jiamjiroch, K. Adaptive urban drinking water supply model using the effect of node elevation and head loss formula: A case study. Heliyon 2024, 10, e26181. [Google Scholar] [CrossRef]
- Avrin, A.-P.M.L. China’s Power Sector Decarbonization: Modeling Emission Reduction Potential, Technical Feasibility and Cost Efficiency of Inter-sectoral Approaches. Ph.D. Thesis, University of California, Berkeley, CA, USA, 2018. [Google Scholar]
- He, G.; Zhang, T.; Zheng, F.; Zhang, Q. An efficient multi-objective optimization method for water quality sensor placement within water distribution systems considering contamination probability variations. Water Res. 2018, 143, 165–175. [Google Scholar] [CrossRef]
- Avesani, D.; Righetti, M.; Righetti, D.; Bertola, P. The extension of EPANET source code to simulate unsteady flow in water distribution networks with variable head tanks. J. Hydroinform. 2012, 14, 960–973. [Google Scholar] [CrossRef]
- Todini, E. Extending the global gradient algorithm to unsteady flow extended period simulations of water distribution systems. J. Hydroinform. 2011, 13, 167–180. [Google Scholar] [CrossRef]
- Nikita, P.; Vishnu, P.; Ruchi, K. A new multi-objective evolutionary algorithm for the optimization of water distribution networks. Water Supply 2022, 22, 8972–8987. [Google Scholar]
- Dan, L.; Pei, M.; Shixuan, L.; Wei, L.; Danhui, F. Graph Convolutional Neural Network for Pressure Prediction in Water Distribution Network Sites. Water Resour. Manag. 2024, 38, 2581–2599. [Google Scholar]
- Avila-Melgar, E.Y.; Cruz-Chávez, M.A.; Martínez-Bahena, B.; Eraña-Díaz, M.L.; Cruz-Rosales, M.H. Parallel evolutionary algorithm for Water Distribution Network Design, using the Masters–Students model in distributed environment. Appl. Soft Comput. J. 2023, 135, 109986. [Google Scholar] [CrossRef]
- Ivetic, D.; Vasilic, Z.; Stanic, M.; Prodanovic, D. Speeding up the water distribution network design optimization using the Delta Q method. J. Hydroinform. 2016, 18, 33–48. [Google Scholar] [CrossRef]
- Vasilic, Z.; Stanic, M.; Kapelan, Z.; Ivetic, D.; Prodanovic, D. Improved Loop-Flow Method for Hydraulic Analysis of Water Distribution Systems. J. Water Resour. Plan. Manag. 2018, 144, 04018012. [Google Scholar] [CrossRef]
- Diao, K.; Wang, Z.; Burger, G.; Chen, C.-H.; Rauch, W.; Zhou, Y. Speedup of water distribution simulation by domain decomposition. Environ. Model. Softw. 2014, 52, 253–263. [Google Scholar] [CrossRef]
- Zecchin, A.C.; Thum, P.; Simpson, A.R.; Tischendorf, C. Steady-State Behavior of Large Water Distribution Systems: Algebraic Multigrid Method for the Fast Solution of the Linear Step. J. Water Resour. Plan. Manag. 2012, 138, 639–650. [Google Scholar] [CrossRef]
- Ali, S.; Azim, F.; Morteza, S.Z. A parallel computing architecture based on cellular automata for hydraulic analysis of water distribution networks. J. Parallel Distrib. Comput. 2023, 178, 11–28. [Google Scholar]
- Duan, H.-f.; Yu, G.-p. Spanning tree-based algorithm for hydraulic simulation of large-scale water supply networks. Water Sci. Eng. 2010, 3, 23–35. [Google Scholar]
- Crous, P.A.; Zyl, J.E.v.; Roodt, Y. The potential of graphical processing units to solve hydraulic network equations. J. Hydroinform. 2012, 14, 603–612. [Google Scholar] [CrossRef]
- Guidolin, M.; Kapelan, Z.; Savić, D. Using high performance techniques to accelerate demand-driven hydraulic solvers. J. Hydroinform. 2013, 15, 38–54. [Google Scholar] [CrossRef]
- Yang, Z.; Han, L.; Li, B.; Xie, J.; Han, P.; Liu, Y. Large-Scale Pipe Network Simulation Based on the “Songshan” Supercomputer System. Comput. Eng. 2022, 48, 155–161. [Google Scholar]
- Carlo, C.; Enrico, C. Comparison of Pressure-Driven Formulations for WDN Simulation. Water 2018, 10, 523. [Google Scholar] [CrossRef]
- Deuerlein, J.W.; Piller, O.; Elhay, S.; Simpson, A.R. Content-Based Active-Set Method for the Pressure-Dependent Model of Water Distribution Systems. J. Water Resour. Plan. Manag. 2019, 145, 04018082. [Google Scholar] [CrossRef]
- Sherri, F.; Mahvi, A.H.; Eshlaghy, A.T.; Hassani, A.H. A new approach in simultaneous calibration of Hazen-Williams coefficients and demand of nodes in of water distribution systems. Desalination Water Treat. 2017, 74, 137–148. [Google Scholar] [CrossRef]
- Caroline, B.; Filippo, P.; Ivan, S. Prior Assumptions for Leak Localisation in Water Distribution Networks with Uncertainties. Water Resour. Manag. 2021, 35, 5105–5118. [Google Scholar]
- Menapace, A.; Avesani, D. Global Gradient Algorithm Extension to Distributed Pressure Driven Pipe Demand Model. Water Resour. Manag. 2019, 33, 1717–1736. [Google Scholar] [CrossRef]
- Giustolisi, O.; Moosavian, N. Testing linear solvers for global gradient algorithm. J. Hydroinform. 2014, 16, 1178–1193. [Google Scholar] [CrossRef]
- Todini, E.; Santopietro, S.; Gargano, R.; Rossman, L.A. Pressure Flow–Based Algorithms for Pressure-Driven Analysis of Water Distribution Networks. J. Water Resour. Plan. Manag. 2021, 147, 04021048. [Google Scholar] [CrossRef]
- Sela, L.; Salomons, E.; Housh, M. Plugin prototyping for the EPANET software. Environ. Model. Softw. 2019, 119, 49–56. [Google Scholar] [CrossRef]
- Iglesias-Rey, P.L.; Martínez-Solano, F.J.; Ribelles-Aquilar, J.V. Extending EPANET Capabilities with Add-In Tools. Procedia Eng. 2017, 186, 626–634. [Google Scholar] [CrossRef]
- Arandia, E.; Eck, B.J. An R package for EPANET simulations. Environ. Model. Softw. 2018, 107, 59–63. [Google Scholar] [CrossRef]
- Yucong, L.; Simiao, J.; Lek-Heng, L. LU decomposition and Toeplitz decomposition of a neural network. Appl. Comput. Harmon. Anal. 2024, 68, 101601. [Google Scholar]
- Al-Kurdi, A.; Kincaid, D.R. LU-decomposition with iterative refinement for solving sparse linear systems. J. Comput. Appl. Math. 2005, 185, 391–403. [Google Scholar] [CrossRef]
- Ozcan, C.; Sen, B. Investigation of the performance of LU decomposition method using CUDA. Procedia Technol. 2012, 1, 50–54. [Google Scholar] [CrossRef]
- Jiang, Z.; Jiazhi, J.; Jiangsu, D.; Dan, H.; Yutong, L. Optimizing massively parallel sparse matrix computing on ARM many-core processor. Parallel Comput. 2023, 117, 103035. [Google Scholar]
- Sanderson, C.; Curtin, R.R. Armadillo: A template-based C++ library for linear algebra. J. Open Source Softw. 2016, 1, 26. [Google Scholar] [CrossRef]
- Sanderson, C.; Curtin, R. Practical Sparse Matrices in C++ with Hybrid Storage and Template-Based Expression Optimisation. Math. Comput. Appl. 2019, 24, 70. [Google Scholar] [CrossRef]
- Yoshida, K.; Miwa, S.; Yamaki, H.; Honda, H. Analyzing the impact of CUDA versions on GPU applications. Parallel Comput. 2024, 120, 103081. [Google Scholar] [CrossRef]
- Sharma, G.; Agarwala, A.; Bhattacharya, B. A fast parallel Gauss Jordan algorithm for matrix inversion using CUDA. Comput. Struct. 2013, 128, 31–37. [Google Scholar] [CrossRef]
- Pieter, G.; Ryan, S. High performance sparse multifrontal solvers on modern GPUs. Parallel Comput. 2022, 110, 102897. [Google Scholar]
- GPU Programming in MATLAB; Elsevier Inc.: Amsterdam, The Netherlands, 2016.
- Robert, S.; Mohsen, H.; Sina, H.; Kegong, D. Dual graph characteristics of water distribution networks-how optimal are design solutions? Complex Intell. Syst. 2023, 9, 147–160. [Google Scholar]
- Garland, M.; Kirk, D.B. Understanding throughput-oriented architectures. Commun. ACM 2010, 53, 58–66. [Google Scholar] [CrossRef]
- Ben-Nun, T.; Hoefler, T. Demystifying Parallel and Distributed Deep Learning. ACM Comput. Surv. (CSUR) 2019, 52, 65. [Google Scholar] [CrossRef]
#include <iostream> #include <armadillo> int main() { double s ; //Computed value of s (Calculated according to Equation (3)) const double n = 1.852; //Define constant s and parameter n //Q represents flow rates, shown here as constants for demonstration arma::vec Q = {10.0, 20.0, 30.0, 40.0} // Create a diagonal matrix A11 arma::mat A11 = arma::diagmat(arma::abs(s * arma::pow(Q, n − 1))); arma::mat A11_inv = arma::inv(A11); // Compute and print inverse A11_inv.print(“Inverse of A11:”); return 0; } |
PIPE | Node | Reservoir | ||
---|---|---|---|---|
Length/m | Diameter/mm | Roughness | Base Demand/(L\s) | Total Head\m |
100 | 200 | 130 | 1 | 189000 |
#include <cusolverDn.h> #include <cublas_v2.h> int main() { // Assuming A11 is computed on the CPU and the GPU parameters are set //Copy A11 from CPU to GPU cudaMemcpy(d_A11, h_A11, N * N * sizeof(double), cudaMemcpyHostToDevice); //Perform LU decomposition cusolverDnDgetrf(handle, N, N, d_A11, N, NULL, d_ipiv, d_info); //Solve for the inverse using the LU factorization cusolverDnDgetrs(handle, CUBLAS_OP_N, N, N, d_A11, N, d_ipiv, d_A11, N, d_info); //Free resources return 0; } |
Model | T = 1 h | T = 6 h | T = 11 h |
---|---|---|---|
GPU | 98.45% | 99.61% | 99.61% |
CPU | 98.45% | 98.45% | 98.45% |
Device Type | Computational Architecture | Number of Transistors (Hundred Million) | Number of Stream Processors | Memory Capacity (MB) | Single-Precision Floating-Point (TFLOPS) | Memory Bandwidth (GB/s) |
---|---|---|---|---|---|---|
GPU-RTX3070 | Ampere | 714 | 5888 | 8192 | 20.37 | 448 |
Device Type | Number of Cores/Threads | Base Frequency (GHz) | Maximum Turbo Frequency (GHz) | Level 3 Cache (MB) | Integrated Graphics | TDP(W) |
CPU-i7-12700 | 12(8P + 4E)/20 | 2.1 | 4.9 | 25 | Intel UHD Graphics 770 | 65 |
Device Type | Computational Architecture | Number of Transistors (Hundred Million) | Number of Stream Processors | Memory Capacity (MB) | Single-Precision Floating-Point (TFLOPS) | Memory Bandwidth (GB/s) |
---|---|---|---|---|---|---|
NVIDIA GeForce GPU-GTX1080 | Pascal | 72 | 2560 | 8192 | 8.89 | 320 |
NVIDIA GeForce GPU-RTX2080 SUPER | Turing | 136 | 3072 | 8192 | 11.15 | 496 |
NVIDIA GeForce GPU-RTX3070 | Ampere | 714 | 5888 | 8192 | 20.37 | 448 |
NVIDIA GeForce GPU-RTX4090 | Ada Lovelace | 762 | 16,384 | 24,576 | 83 | 1008 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Zhang, R.; Hou, J.; Li, J.; Wang, T.; Imran, M. Study on Large-Scale Urban Water Distribution Network Computation Method Based on a GPU Framework. Water 2024, 16, 2642. https://doi.org/10.3390/w16182642
Zhang R, Hou J, Li J, Wang T, Imran M. Study on Large-Scale Urban Water Distribution Network Computation Method Based on a GPU Framework. Water. 2024; 16(18):2642. https://doi.org/10.3390/w16182642
Chicago/Turabian StyleZhang, Rongbin, Jingming Hou, Jingsi Li, Tian Wang, and Muhammad Imran. 2024. "Study on Large-Scale Urban Water Distribution Network Computation Method Based on a GPU Framework" Water 16, no. 18: 2642. https://doi.org/10.3390/w16182642
APA StyleZhang, R., Hou, J., Li, J., Wang, T., & Imran, M. (2024). Study on Large-Scale Urban Water Distribution Network Computation Method Based on a GPU Framework. Water, 16(18), 2642. https://doi.org/10.3390/w16182642