OpenACC¶
OpenACC is a directive based programming model for C, C++ and Fortran primarily focused on offloading work to accelerators like GPUs. The API consists of compiler directives, library routines, and environment variables. The OpenACC specification is a short and approachable document that is worth reading.
Using OpenACC on Perlmutter¶
While several compiler toolchains list support for OpenACC we recommend users start with NVIDIA's implementation for Perlmutter.
The PrgEnv-nvidia
module should be used to compile OpenACC code:
Vendor | PrgEnv | Language(s) | OpenACC flag |
---|---|---|---|
NVIDIA | PrgEnv-nvidia | C/C++/Fortran | -acc |
GPU target must be set
Either load the cudatoolkit
and craype-accel-nvidia80
modules or use the the -acc=gpu
option.
NVIDIA Compiler Documentation covers the currently available set of features, examples and a Getting started guide.
References¶
- The OpenACC specificification
- OpenACC resources for guides, tutorials, code samples, etc.
- NERSC OpenACC Training Series, 2020