Software:OpenACC

From HandWiki
Short description: Programming standard for parallel computing
OpenACC
Developer(s)The OpenACC Organization
Stable release
3.2 / November 2021; 2 years ago (2021-11)
Written inC, C++, and Fortran
Operating systemCross-platform
PlatformCross-platform
TypeAPI
Websitewww.openacc.org

OpenACC (for open accelerators) is a programming standard for parallel computing developed by Cray, CAPS, Nvidia and PGI. The standard is designed to simplify parallel programming of heterogeneous CPU/GPU systems.[1]

As in OpenMP, the programmer can annotate C, C++ and Fortran source code to identify the areas that should be accelerated using compiler directives and additional functions.[2] Like OpenMP 4.0 and newer, OpenACC can target both the CPU and GPU architectures and launch computational code on them.

OpenACC members have worked as members of the OpenMP standard group to merge into OpenMP specification to create a common specification which extends OpenMP to support accelerators in a future release of OpenMP.[3][4] These efforts resulted in a technical report[5] for comment and discussion timed to include the annual Supercomputing Conference (November 2012, Salt Lake City) and to address non-Nvidia accelerator support with input from hardware vendors who participate in OpenMP.[6]

At ISC’12 OpenACC was demonstrated to work on Nvidia, AMD and Intel accelerators, without performance data.[7]

On November 12, 2012, at the SC12 conference, a draft of the OpenACC version 2.0 specification was presented.[8] New suggested capabilities include new controls over data movement (such as better handling of unstructured data and improvements in support for non-contiguous memory), and support for explicit function calls and separate compilation (allowing the creation and reuse of libraries of accelerated code). OpenACC 2.0 was officially released in June 2013.[9]

Version 2.5 of the specification was released in October 2015,[10] while version 2.6 was released in November 2017.[11] Subsequently, version 2.7 was released in November 2018.[12]

The latest version is version 3.2, which was released in November 2021.[13]

Compiler support

Support of OpenACC is available in commercial compilers from PGI (from version 12.6), and (for Cray hardware only) Cray.[7][14]

OpenUH[15] is an Open64 based open source OpenACC compiler supporting C and FORTRAN, developed by HPCTools group from University of Houston.

OpenARC[16] is an open source C compiler developed at Oak Ridge National Laboratory to support all features in the OpenACC 1.0 specification. An experimental[17] open source compiler, accULL, is developed by the University of La Laguna (C language only).[18]

Omni Compiler[19][20] is an open source compiler developed at HPCS Laboratory. of University of Tsukuba and Programming Environment Research Team of RIKEN Center for Computational Science, Japan, supported OpenACC, XcalableMP (ja) and XcalableACC (ja) combining XcalableMP and OpenACC.

IPMACC[21] is an open source C compiler developed by University of Victoria that translates OpenACC to CUDA, OpenCL, and ISPC. Currently, only following directives are supported: data, kernels, loop, and cache.

GCC support for OpenACC was slow in coming.[22] A GPU-targeting implementation from Samsung was announced in September 2013; this translated OpenACC 1.1-annotated code to OpenCL.[17] The announcement of a "real" implementation followed two months later, this time from NVIDIA and based on OpenACC 2.0.[23] This sparked some controversy, as the implementation would only target NVIDIA's own PTX assembly language, for which no open source assembler or runtime was available.[24][25] Experimental support for OpenACC/PTX did end up in GCC as of version 5.1. GCC6 and GCC7 release series include a much improved implementation of the OpenACC 2.0a specification.[26][27] GCC 9.1 offers nearly complete OpenACC 2.5 support.[28]

Usage

In a way similar to OpenMP 3.x on homogeneous system or the earlier OpenHMPP, the primary mode of programming in OpenACC is directives.[29] The specifications also include a runtime library defining several support functions. To exploit them, user should include "openacc.h" in C or "openacc_lib.h" in Fortran;[30] and then call acc_init() function.

Directives

OpenACC defines an extensive list of pragmas (directives),[31] for example:

#pragma acc parallel
#pragma acc kernels

Both are used to define parallel computation kernels to be executed on the accelerator, using distinct semantics[32][33]

#pragma acc data

Is the main directive to define and copy data to and from the accelerator.

#pragma acc loop

Is used to define the type of parallelism in a parallel or kernels region.

#pragma acc cache
#pragma acc update
#pragma acc declare
#pragma acc wait

Runtime API

There are some runtime API functions defined too: acc_get_num_devices(), acc_set_device_type(), acc_get_device_type(), acc_set_device_num(), acc_get_device_num(), acc_async_test(), acc_async_test_all(), acc_async_wait(), acc_async_wait_all(), acc_init(), acc_shutdown(), acc_on_device(), acc_malloc(), acc_free().

OpenACC generally takes care of work organisation for the target device however this can be overridden through the use of gangs and workers. A gang consists of workers and operates over a number of processing elements (as with a workgroup in OpenCL).

See also

References

  1. "Nvidia, Cray, PGI, and CAPS launch 'OpenACC' programming standard for parallel computing". 4 November 2011. http://www.theinquirer.net/inquirer/news/2124878/nvidia-cray-pgi-caps-launch-openacc-programming-standard-parallel-computing. 
  2. "OpenACC standard version 2.5". https://www.openacc.org/sites/default/files/inline-files/OpenACC_2pt5_0.pdf. 
  3. "How does the OpenACC API relate to the OpenMP API?". http://www.openacc.org/?q=node/49. 
  4. "How did the OpenACC specifications originate?". http://www.openacc.org/?q=node/47. 
  5. "The OpenMP Consortium Releases First Technical Report". 5 November 2012. http://openmp.org/wp/2012/11/the-openmp-consortium-releases-first-technical-report/. 
  6. "OpenMP at SC12". 29 August 2012. http://openmp.org/wp/sc12. 
  7. 7.0 7.1 "OpenACC Group Reports Expanding Support for Accelerator Programming Standard". 20 June 2012. http://www.hpcwire.com/hpcwire/2012-06-20/openacc_group_reports_expanding_support_for_accelerator_programming_standard.html. 
  8. "OpenACC Version 2.0 Posted for Comment". 12 November 2012. http://www.openacc.org/?q=node/173. 
  9. "OpenACC 2.0 Spec | www.openacc.org". http://www.openacc.org/node/297. 
  10. "OpenACC Standards Group Announces Release of the 2.5 Specification; Member Vendors Add Support for ARM & x86 as Parallel Devices | www.openacc.org". http://www.openacc.org/content/openacc-standards-group-announces-release-25-specification-member-vendors-add-support-arm. 
  11. "What's new in OpenACC 2.6? | OpenACC" (in en). https://www.openacc.org/blog/whats-new-openacc-26. 
  12. "What's new in OpenACC 2.7! | OpenACC" (in en). https://www.openacc.org/blog/whats-new-openacc-27. 
  13. "The OpenACC© Application Programming Interface". September 2021. https://www.openacc.org/sites/default/files/inline-images/Specification/OpenACC-3.2-final.pdf. 
  14. "OpenACC Standard to Help Developers to Take Advantage of GPU Compute Accelerators". 16 November 2011. http://www.xbitlabs.com/news/other/display/20111116234815_OpenACC_Standard_to_Help_Developers_to_Take_Advantage_of_GPU_Compute_Accelerators.html. 
  15. "OpenUH Compiler". http://web.cs.uh.edu/~openuh/. 
  16. "OpenARC Compiler". http://ft.ornl.gov/research/openarc/. 
  17. 17.0 17.1 Larabel, Michael (30 September 2013). "GCC Support Published For OpenACC On The GPU". https://www.phoronix.com/scan.php?page=news_item&px=MTQ3Mjg. 
  18. "accULL The OpenACC research implementation". http://accull.wordpress.com/. 
  19. "Omni Compiler". https://omni-compiler.org/. 
  20. Omni Compiler for C and Fortran programs with XcalableMP and OpenACC directives: omni-compiler/omni-compiler, omni-compiler, 2019-10-17, https://github.com/omni-compiler/omni-compiler, retrieved 2019-11-17 
  21. "IPMACC Compiler". https://www.github.com/lashgar/ipmacc. 
  22. Larabel, Michael (4 December 2012). "OpenACC Still Not Loved By Open Compilers". https://www.phoronix.com/scan.php?page=news_item&px=MTI0MjM. 
  23. Larabel, Michael (14 November 2013). "OpenACC 2.0 With GPU Support Coming To GCC". https://www.phoronix.com/scan.php?page=news_item&px=MTUxNTE. 
  24. Larabel, Michael (15 November 2013). "NVIDIA, Mentor Graphics May Harm GCC". https://www.phoronix.com/scan.php?page=news_item&px=MTUxNjM. 
  25. Larabel, Michael (21 November 2013). "In-Fighting Continues Over OpenACC In GCC". https://www.phoronix.com/scan.php?page=news_item&px=MTUyMjA. 
  26. "OpenACC - GCC Wiki". https://gcc.gnu.org/wiki/OpenACC. 
  27. Schwinge, Thomas (15 January 2015). "Merge current set of OpenACC changes from gomp-4_0-branch". gcc (Mailing list). gcc.gnu.org. Retrieved 15 January 2015.
  28. Jelinek, Jakub (3 May 2019). "GCC 9.1 Released". https://lwn.net/ml/gcc/20190503114328.GE2706%40tucnak/. 
  29. "Easy GPU Parallelism with OpenACC". 11 June 2012. http://www.drdobbs.com/parallel/easy-gpu-parallelism-with-openacc/240001776. 
  30. "OpenACC API QuickReference Card, version 1.0". November 2011. http://www.nvidia.com/docs/IO/116711/OpenACC-API.pdf. 
  31. "OpenACC standard version 2.0". http://www.openacc.org/sites/default/files/OpenACC%202%200.pdf. 
  32. "OpenACC Kernels and Parallel Constructs". August 2012. http://www.pgroup.com/lit/articles/insider/v4n2a1.htm. 
  33. "OpenACC parallel section VS kernels". 3 January 2013. http://kb.caps-entreprise.com/openacc-parallel-section-vs-kernels/. 

External links