# High-Performance Computing and Parallel Algorithms for Urban Water Demand Forecasting
## 3 Results and Discussion
### Computational Performance: Serial vs. Parallel Pipeline  
The execution times presented in Table 1 highlight the significant computational improvements achieved through high-performance computing (HPC) techniques. A comparison across Single-Rank Training (serial execution), 8-Rank Training (parallel execution with 8 MPI processes), and 8-Rank Inference (pre-trained models) demonstrates the impact of multi-core CPU processing, Spark-based data distribution, and GPU acceleration on various stages of the forecasting pipeline. The Spark-based parallel implementation significantly reduced the data preprocessing time from 538 s (~9 min) in serial execution to 175 s (~3 min) in the 8-rank configuration, resulting in a 3\(\times\) speedup. The speedup was limited by I/O operations (e.g., disk read/write) and Spark's job scheduling overhead. However, the observed reduction indicates that distributed data processing significantly enhances computational efficiency. Further reductions in execution time could be achieved by increasing the number of processing cores or deploying a multi-node Spark cluster. \begin{table}
\begin{tabular}{l l l l} \hline \hline
**Script** & **Single-Rank Training** & **8-Rank Training** &
\begin{tabular}{l} **8-Rank Inference** \\ **(Pretrain Models)** \\ \end{tabular} \\ \hline Data Preprocess & 538 s & 175 s & 175 s—no pre-trained model \\ Outlier Detection & 104 s & 61 s & 61 s—no pre-trained model \\ Bi-LSTM Optimization (Optuna) & 13,320 s & 2340 s & – Skipped \\ Bi-LSTM Imputation & 7920 s & 2460 s & 50 s \\ F-LSTM Forecast & 4680 s & 1620 s & 50 s \\ Random Forest Forecast (Spark MLlib) & 4800 s & 900 s & 200 s \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Average execution times per script under three configurations. Execution time for outlier detection was reduced from 104 s (serial) to 61 s (parallel execution, \(\sim\)1.7\(\times\) speedup). The smaller relative speedup can be attributed to Python-based computations under MPI, which do not scale as efficiently as Spark-based transformations. Despite the parallelization overhead, the reduction in execution time validates the effectiveness of distributed anomaly detection methods. Bi-LSTM Hyperparameter Optimization (HPO)  
The hyperparameter tuning phase for the Bi-LSTM models exhibited substantial performance improvements. In serial execution, this stage required 13,320 s (\(\sim\)3.7 h), whereas parallel execution reduced it to 2340 s (\(\sim\)39 min), achieving a 5.7\(\times\) speedup. The efficiency gain is attributed to MPI-distributed trials, which enable simultaneous evaluation of multiple hyperparameter configurations. In inference mode, hyperparameter tuning is skipped, leading to additional computational savings. Training the Bi-LSTM imputation models for all reservoirs required 7920 s (\(\sim\)2.2 h) in the serial configuration, which was reduced to 2460 s (\(\sim\)41 min) under parallel execution, yielding a 3.2\(\times\) speedup. The acceleration resulted from parallel execution across multiple MPI processes and GPU utilization, enabling concurrent model training. In inference mode, execution time increased to 50 s as pre-trained models were loaded from the disk and applied to the dataset. The 50 s inference time accounts for TensorFlow session initialization, weight loading, and batch processing across all 48 reservoirs. Despite this overhead, the execution time remains acceptable for real-time forecasting applications. f-LSTM Forecasting  
Training the forecasting LSTM (f-LSTM) models required 4680 s (\(\sim\)1.3 h) in serial execution, which was reduced to 1620 s (\(\sim\)27 min) in parallel execution, achieving a 2.9\(\times\) speedup. The improvements are attributed to GPU acceleration, allowing multiple LSTM models to be trained concurrently. During inference mode, execution time remained at 50 s, similar to Bi-LSTM inference, primarily due to model weight loading and sequential batch inference across reservoirs.