Title :
Accelerating a C++ CFD Code with OpenACC
Author :
Kraus, Jiri ; Schlottke, Michael ; Adinetz, Andrew ; Pleiter, Dirk
Author_Institution :
NVIDIA GmbH, Wurselen, Germany
Abstract :
Todays HPC systems are increasingly utilizing accelerators to lower time to solution for their users and reduce power consumption. To utilize the higher performance and energy efficiency of these accelerators, application developers need to rewrite at least parts of their codes. Taking the C++ flow solver ZFS as an example, we show that the directive-based programming model allows one to achieve good performance with reasonable effort, even for mature codes with many lines of code. Using OpenACC directives permitted us to incrementally accelerate ZFS, focusing on the parts of the program that are relevant for the problem at hand. The two new OpenACC 2.0 features, unstructured data regions and atomics, are required for this. OpenACC´s interoperability with existing GPU libraries via the host_data use_device construct allowed to use CUDAaware MPI to achieve multi-GPU scalability comparable to the CPU version of ZFS. Like many other codes, the data structures of ZFS have been designed with traditional CPUs and their relatively large private caches in mind. This leads to suboptimal memory access patterns on accelerators, such as GPUs. We show how the texture cache on NVIDIA GPUs can be used to minimize the performance impact of these suboptimal patterns without writing platform specific code. For the kernel most affected by the memory access pattern, we compare the initial array of structures memory layout with a structure of arrays layout.
Keywords :
C++ language; application program interfaces; computational fluid dynamics; graphics processing units; message passing; open systems; parallel architectures; C++ flow solver; CFD code; CUDA aware MPI; NVIDIA GPU; OpenACC interoperability; computational fluid dynamics; directive-based programming model; Acceleration; Computer architecture; Graphics processing units; Kernel; Microprocessors; Programming;
Conference_Titel :
Accelerator Programming using Directives (WACCPD), 2014 First Workshop on
DOI :
10.1109/WACCPD.2014.11