OpenACC Tutorial - Profiling: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 23: Line 23:
What is so important about the hotspots of the code ?  
What is so important about the hotspots of the code ?  
The Amdahl's law says that "Parallelizing the most time-consuming (i.e. the hotspots) routines will have the most impact".
The Amdahl's law says that "Parallelizing the most time-consuming (i.e. the hotspots) routines will have the most impact".
== Build the Sample Code ? ==
For this example we will use a code from the [https://github.com/calculquebec/cq-formation-openacc repositories]. Download the package and change to the '''cpp''' or '''f90''' directory. The point of this exercise is to compile&link the code, obtain executable, and then profile them.
{{Callout
|title=<translate>Which compiler ?</translate>
|content=
<translate>
As of May 2016, compiler support for OpenACC is still relatively scarce. Being pushed by [http://www.nvidia.com/content/global/global.php NVidia], through its [http://www.pgroup.com/ Portland Group] division, as well as by [http://www.cray.com/ Cray], these two lines of compilers offer the most advanced OpenACC support. [https://gcc.gnu.org/wiki/OpenACC GNU Compiler] support for OpenACC exists, but is considered experimental in version 5. It is expected to be officially supported in version 6 of the compiler.
For the purpose of this tutorial, we use version 16.3 of the Portland Group compilers. We note that [http://www.pgroup.com/support/download_pgi2016.php?view=current Portland Group compilers] are free for academic usage.
</translate>
}}
{{Command
|make
|result=
pgc++ -fast  -c -o main.o main.cpp
"vector.h", line 30: warning: variable "vcoefs" was declared but never
      referenced
      double *vcoefs=v.coefs;
                    ^
pgc++ main.o -o cg.x -fast
}}
Bureaucrats, cc_docs_admin, cc_staff
337

edits