Conservation laws describing one or more conserved quantities in time arise in a multitude of different scientific areas. Mathematically, conservation laws are expressed as partial differential equations (PDEs). In this thesis, the shallow water equations are the particular system of interest, and flood simulations the main application area. There are several numerical methods for approximating the solution of hyperbolic PDEs like the shallow water equations, and finite volume methods constitute an important class. Explicit finite volume methods typically rely on stencil computations, making them inherently parallel, and therefore a near perfect match for the many-core graphics processing unit (GPU) found on today’s graphics cards. The GPU is one example of the accelerators now used in high performance computing. Accelerators are typically power efficient, and deliver higher computational performance per dollar than traditional CPUs. Through the scientific papers in this thesis, we present efficient hardware-adapted shallow water simulations on the GPU, based on a high-resolution centralupwind scheme. The topics range from best practices for stencil computations on the GPU to adaptive mesh refinement. This work extends to architectures similar to the GPU and to other hyperbolic conservation laws
In this work, we examine the performance, energy efficiency, and usability when using Python for developing high-performance computing codes running on the graphics processing unit (GPU). We investigate the portability of performance and energy efficiency between Compute Unified Device Architecture (CUDA) and Open Compute Language (OpenCL); between GPU generations; and between low-end, mid-range, and high-end GPUs. Our findings showed that the impact of using Python is negligible for our applications, and furthermore, CUDA and OpenCL applications tuned to an equivalent level can in many cases obtain the same computational performance. Our experiments showed that performance in general varies more between different GPUs than between using CUDA and OpenCL. We also show that tuning for performance is a good way of tuning for energy efficiency, but that specific tuning is needed to obtain optimal energy efficiency.