Large scale, nonlinear, three-dimensional simulations are still very challenging to perform on present-day computers, and usually many computers have to be joined in parallel clusters to satisfy the ever-increasing demands on the computational models.
Enter graphics processing units (GPUs): These are chips which have traditionally been used to display computer graphics, but can nowadays be used as coprocessors to accelerate scientific applications. In contrast to a central processing unit, which is primarily optimized for high performance of individual threads, GPUs achieve their improved speed by employing massive parallelism employing many thousand threads at a time. The peak performance of a GPU can currently be hundreds of times as high as that of a CPU, and the ratio is expected to increase in the future.
To take advantage of this computational power, the HORIZON code is a fully GPU-based simulation tool for general relativistic magnetohydrodynamics. This study presents the code, describes engineering tradeoffs made, and compares the performance in both single and double precision floating point accuracy with the CPU code THOR used in previous studies.
We observe substantial gains in performance in line with the expected peak performance ratio between GPUs and CPUs: a GPU will outperform a single CPU core (in single precision) by a factor of over 200, which is in part also made possible by the high arithmetic intensity of general relativistic magnetohydrodynamics, that is, the comparatively high ratio of compute to memory operations, which maps very well to GPU architectures. Speedup ratios to all four cores of a quad-core CPU are 50 in single precision and over 10 in double precision.
Overall, GPUs offer a substantial improvement in compute performance over traditional CPUs in all scenarios, even in cases where double precision accuracy is required (and that may not always be the case, as the investigation has demonstrated). In single precision computations, the differences are very substantial, and as they are expected to even increase in the future, we expect massively data-parallel computations to become commonplace in demanding applications in science and engineering.
Reference / Figure
Zink, B. (submitted). HORIZON: Accelerated General Relativistic Magnetohydrodynamics, arXiv:1102.5202v1 [gr-qc]