In this deck from the University of Houston CACDS HPC Workshop, Jeff Larkin from Nvidia presents: The Past, Present, and Future of OpenACC.
"OpenACC is an open specification for programming accelerators with compiler directives. It aims to provide a simple path for accelerating existing applications for a wide range of devices in a performance portable way. This talk with discuss the history and goals of OpenACC, how it is being used today, and what challenges it will address in the future."
Watch the video presentation: http://wp.me/p3RLHQ-dTm
4. 4
WHAT ARE COMPILER DIRECTIVES?
program myscience
... serial code ...
do k = 1,n1
do i = 1,n2
...
enddo
enddo
...
end program myscience
CPU GPU
Your original
Fortran, C, or C++
code
Insert portable compiler
directives
Compiler parallelizes code and
manages data movement
Programmer optimizes
incrementally
Designed for multi-core CPUs,
GPUs & many-core Accelerators
program myscience
... serial code ...
!$acc parallel loop
do k = 1,n1
do i = 1,n2
...
enddo
enddo
...
end program myscience
5. 5
WHY USE COMPILER DIRECTIVES?
Single Source Code
No need to maintain multiple code paths
High Level
Abstract away device details, focus on expressing the parallelism and data
locality
Low Learning Curve
Programmer remains in same language and adds directives to existing code
Rapid Development
Fewer code changes means faster development
9. 9
COMPILER DIRECTIVES TODAY
OpenACC
Focused solely on compiler
directives for accelerators
Quickly moving
Performance Portability a
primary consideration
Descriptive approach to parallel
programming
OpenMP
Addresses a broad range of
parallel programming challenges
More measured approach
Less focus on performance
portability
Prescriptive approach to parallel
programming
Choice of two great options
10. 10
OPENACC IMPLEMENTATIONS
OpenACC 2.0
launched
December 2013
OpenACC 2.0
launched
January 2014
OpenACC 2.0
Targeted for
Late 2014
Tremendous interest in academia:
• accULL – U. La Laguna/EPCC
• Omni – U. of Tsukuba
• OpenARC – Oak Ridge NL
• OpenUH – U. of Houston
• RoseACC – U of DE & LLNL
Compilers
Debuggers and Profilers
OpenACC 2.0
Targeted for
2015
11. 11 11
OPENACC 2.NEXT
Deep-Copy
Support for more complex data structures
Improves C++ class support
Tools API
Standard API for profiling tools
Default to present_or behavior for data clauses
Tell us what else you need feedback@openacc.org
12. 12
WHAT IS DEEP COPY?
On Host
Shallow Copy
Deep Copy
Deep copy is required for structures with pointer members to work properly, but also useful
where only part of a structure is needed on the device.
• Users can do this today manually, but we want it to be automatic
13. 13
SOLVING DEEP COPY
Inform the compiler of the
shape of the data behind the
pointer.
struct T1 {
int N;
float* A;
#pragma acc policy(“shape")
shape( A[0:N] )
};
Develop policies for how the
data should be relocated.
struct T1 {
int N;
float* A;
#pragma acc policy(“shape")
shape( A[0:N] )
#pragma acc policy("boundary")
update(A[0:1],A[N-1:1)
};
Self-describing Structures Data Policies
*Syntax and functionality subject to change
14. 14
OPENACC & UNIFIED MEMORY
With Unified Memory (or equivalent) shallow copying no longer
results in runtime error, so does deep-copy become irrelevant?
Dereferencing the copied pointer no-longer results in error.
Hardware support for Unified Memory would allow for data to migrate on
access.
Deep Copy support in OpenACC is still beneficial because
Data can be moved before it’s needed without penalty
Code will be portable to devices without Unified Memory support
15. 17 17
THE “MERGE”
Both specifications bring value to the market
OpenACC – more focused, more agile, descriptive approach
OpenMP – more cautious, more mature overall, prescriptive approach
The specifications are constantly converging, even if they never
eventually merge.
Use the best tool available to you today, the restructuring and
knowledge from each are portable.
In other words: the syntax isn’t the hard part.
Does having 2 specifications cause confusion?