Code Parallelization¶
HydroBID Flood CPU¶
HydroBID Flood uses Hydronia's shared RiverFlow2D engine, whose CPU code has been parallelized using OpenMP directives available in the Intel C++ compiler. OpenMP Application Program Interface (API) supports multi-platform shared-memory parallel programming in C/C++ and Fortran on architectures, including MAC OS, Unix and Windows platforms (OpenMP, 2009). OpenMP provides instructions to parallelize existing serial codes to run in shared-memory platforms ranging from affordable and widely available multiple-core computers to supercomputers. Using this parallelization approach, the engine dynamically distributes the computational workload between as many processors or cores as are available. In this way the model optimizes its computations to the particular architecture of each computer.
Figure shows the speedup of the model with respect to the number of processors/cores on a DELL Precision 7400 computer with 2 Intel Xeon CPU X5472 \@3.00GHz and 16GB of RAM. With 8 cores, the model runs more than 4 times faster than with the non-parallelized model. One hour simulation takes approximately 6 minutes using the parallelized model in this particular computer platform.
HydroBID Flood GPU¶
The HydroBID Flood GPU model uses the GPU version of the shared RiverFlow2D engine to reduce run times. It combines OpenMP parallelization with GPU techniques. Since the number of wet cells changes during transient inundation simulations, the OpenMP implementation dynamically assigns tasks to processors to keep the workload balanced. The engine's strict method for controlling volume conservation (errors of Order \(10^{-14} \%\)) when modeling wetting and drying fronts involves a correction step that is not fully local, which requires special handling to avoid degrading model performance. The GPU version reduces the computational time by factors of up to 700X when compared with non-parallelized CPU (1-core) runs. The figure shows performance tests using recent GPU hardware technology, demonstrating that the parallelization techniques implemented in the HydroBID Flood GPU model can significantly reduce computational cost.

