Practical work with OpenACC
Contents: Write your own code in OpenACC
Tasks:
- Download the move example and the
scalar product example
- unzip the files in your account on plexi
- change into the directory (T1 or skalar)
- make run
- Change the data
clauses in the files and watch out for changes wrt. run
time or results
- What is the difference between copy, copyin, present ?
- How is this related to input, output and global variables in the
classical subroutine programming?
- Take your shared memory codes from module 5
(exercise sheet, description of
A-D) and convert them into OpenACC
- mkdir matvec
- copy source files from shm-version into your directory
- copy Makefile and file david.sh from directory OpenAcc/skalar into your directory
- change codes into C (header files, cout --> printf)
- make
- Add OpenACC pragma directives
- make run
- Check the performance
Material
for OpenACC (PGI):
Available compilers for OpenACC:
- PGI:
- compilers: pgcc, pgfortran (OpenACC is not supported for C++)
- see §7 in manual
for OpenACC directives.
- compiler options: pgcc
-help
- Profiling: pgcollect, pgprof
- Debugger: pgdbg
- Info in Accelerator: pgaccelinfo