Vtune: Difference between revisions

From Alliance Doc
Jump to navigation Jump to search
mNo edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 9: Line 9:
[https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/vtune-profiler.html VTune] is Intel's Performance Analysis tool for applications and systems. It is capable of [https://software.intel.com/content/www/us/en/develop/documentation/itac-vtune-mpi-openmp-tutorial-lin/top.html Analyzing both OpenMP and MPI] based applications.
[https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/vtune-profiler.html VTune] is Intel's Performance Analysis tool for applications and systems. It is capable of [https://software.intel.com/content/www/us/en/develop/documentation/itac-vtune-mpi-openmp-tutorial-lin/top.html Analyzing both OpenMP and MPI] based applications.


= Software Module = <!--T:2-->
= Software module = <!--T:2-->


<!--T:21-->
<!--T:21-->
To load the module on any Compute Canada cluster run:
To load the module on any Alliance cluster run:
{{Command|module load vtune}}
{{Command|module load vtune}}


= Tool Re-Naming = <!--T:3-->
= Tool renaming = <!--T:3-->


<!--T:31-->
<!--T:31-->
The content of this wiki is mostly discussed in terms of the legacy named Intel® VTune™ Amplifier.  Please note the tool has been renamed throughout Intels documentation in latest versions (newer than the latest vtune module versions presently available on Compute Canada systems) from Intel® VTune™ Amplifier too Intel® VTune™ Profiler.  Likewise the application commands amplxe-cl and amplxe-gui have been renamed too vtune and vtune-gui for both the command line and gui tools respectively.  Once a version with the newer naming convention is available as a loadable module in the forthcoming default StdEnv/2020 environment this wiki page will be updated accordingly.  Further information can be found [https://software.intel.com/content/www/us/en/develop/documentation/vtune-help/top/launch.html here].  
The content of this page is largely concerned with the legacy version named Intel® VTune™ Amplifier.  Please note this tool has been renamed throughout Intel's documentation in latest versions (newer than the latest <tt>vtune</tt> module versions presently available on Alliance clusters) from Intel® VTune™ Amplifier to Intel® VTune™ Profiler.  Likewise the application commands amplxe-cl and amplxe-gui have been renamed to vtune and vtune-gui for both the command line and graphical tools respectively.  Further information can be found [https://software.intel.com/content/www/us/en/develop/documentation/vtune-help/top/launch.html here].


= Collect Analysis = <!--T:4-->
= Analysis types = <!--T:4-->


<!--T:41-->
<!--T:41-->
To collect analysis information run:
To collect analysis information run:
{{Command|amplxe-cl -collect <analysis-type> <target_exe> <exe_arguments>}}
{{Command|vtune -collect <analysis-type> <target_exe> <exe_arguments>}}
where <analysis-type> should be replaced by one of the available analysis, e.g. hotspots, and <target_exe> is the path to the executable you would like to analyze.  It is recommended to compile your executable with the "-g" option and to use the same optimization level as normal so as to obtain accurate results.  A listing of version specific argument options and several usage examples maybe displayed on the command line by running <code>amplxe-cl -help</code>, after loading the vtune module.  Complete downloadable documentation for Parallel Studio XE (including VTune) for all recent versions can be found [https://software.intel.com/content/www/us/en/develop/articles/download-documentation-intel-parallel-studio-xe-current-previous.html here].  The latest version of the Intel VTune Profiler User Guide may be found [https://software.intel.com/content/www/us/en/develop/documentation/vtune-help/top.html here].
where <analysis-type> should be replaced by one of the available analysis, e.g. hotspots, and <target_exe> is the path to the executable you would like to analyze.  It is recommended to compile your executable with the "-g" option and to use the same optimization level as normal so as to obtain accurate results.  A listing of version specific argument options and several usage examples maybe displayed on the command line by running <code>vtune -help</code>, after loading the vtune module.  Complete downloadable documentation for Parallel Studio XE (including VTune) for all recent versions can be found [https://software.intel.com/content/www/us/en/develop/articles/download-documentation-intel-parallel-studio-xe-current-previous.html here].  The latest version of the Intel VTune Profiler User Guide may be found [https://software.intel.com/content/www/us/en/develop/documentation/vtune-help/top.html here].


= Create Report = <!--T:5-->
= Create reports = <!--T:5-->


<!--T:51-->
<!--T:51-->
To create a report run this command:
To create a report run this command:
{{Command|amplxe-cl -report <report-type> }}
{{Command|vtune -report <report-type> }}
where <report-type> is the type of the report to generate, e.g. hotspots.  See also:
where <report-type> is the type of the report to generate, e.g. hotspots.  See also:
* [https://software.intel.com/en-us/vtune-amplifier-help-generating-command-line-reports https://software.intel.com/en-us/vtune-amplifier-help-generating-command-line-reports]
* [https://software.intel.com/en-us/vtune-amplifier-help-generating-command-line-reports https://software.intel.com/en-us/vtune-amplifier-help-generating-command-line-reports]


= Matrix Example = <!--T:6-->
= Matrix example = <!--T:6-->


<!--T:61-->
<!--T:61-->
Line 42: Line 42:
<!--T:62-->
<!--T:62-->
  salloc --time=1:00:00 --cpus-per-task=4 --ntasks=1 --mem=16G --account=def-yours
  salloc --time=1:00:00 --cpus-per-task=4 --ntasks=1 --mem=16G --account=def-yours
  module load StdEnv/2016.4 *OR* StdEnv/2018.3
  module load StdEnv/2020 vtune
module load intel/2019.3 (optional)
  cp -a $EBROOTVTUNE/vtune/$EBVERSIONVTUNE*/samples/en/C++/matrix . cd matrix/linux
module load vtune/2019.3
  cp -a $EBROOTVTUNE/vtune_amplifier/samples/en/C++/matrix .
cd matrix/linux
  make icc
  make icc
  amplxe-cl -collect hotspots ../matrix
  vtune -collect hotspots ../matrix
  amplxe-cl -report summary  
  vtune -report summary  


<!--T:63-->
<!--T:63-->
The latest version of matrix_multiply (uses cmake to build) can be found [https://github.com/oneapi-src/oneAPI-samples/tree/master/Tools/VTuneProfiler here].
The latest version of matrix_multiply (uses cmake to build) can be found [https://github.com/oneapi-src/oneAPI-samples/tree/master/Tools/VTuneProfiler here].


= Graphical Use = <!--T:7-->
= Graphical mode = <!--T:7-->


<!--T:71-->
<!--T:71-->
The Intel Matrix Sample Project an also be run using Vtune in GUI mode as explored here [https://software.intel.com/content/www/us/en/develop/documentation/vtune-hotspots-tutorial-linux-c/top/run-hotspots-analysis.html].  To run VTune over VNC follow the below directions depending on which system you wish to use.  Running VTune graphically can be useful to generate command line configurations as discussed in [https://software.intel.com/content/www/us/en/develop/documentation/vtune-help/top/analyze-performance/control-data-collection/generating-command-line-configuration-from-gui.html].
The Intel Matrix Sample Project can also be run using Vtune in GUI mode as explored here [https://software.intel.com/content/www/us/en/develop/documentation/vtune-hotspots-tutorial-linux-c/top/run-hotspots-analysis.html].  To run VTune over VNC follow the below directions depending on which system you wish to use.  Running VTune graphically can be useful to generate command line configurations as discussed in [https://software.intel.com/content/www/us/en/develop/documentation/vtune-help/top/analyze-performance/control-data-collection/generating-command-line-configuration-from-gui.html].


== Cluster Nodes == <!--T:72-->
== Cluster nodes == <!--T:72-->


<!--T:721-->
<!--T:721-->
# Connect to a cluster compute or login node with [https://docs.computecanada.ca/wiki/VNC#Connect TigerVNC]
# Connect to a cluster compute or login node with [https://docs.alliancecan.ca/wiki/VNC#Connect TigerVNC]
# <code>module load StdEnv/2016.4 *OR* StdEnv/2018.3</code>   
# <code>module load StdEnv/2020 vtune</code>   
# <code>module load intel/2019.3</code> (optional)
# <code>vtune-gui</code><br>
# <code>module load vtune/2019.3</code>
# <code>amplxe-gui</code><br>


== VDI Nodes == <!--T:73-->
== VDI nodes == <!--T:73-->


<!--T:731-->
<!--T:731-->
# Connect to gra-vdi.computecanada.ca with [https://docs.computecanada.ca/wiki/VNC#VDI_Nodes TigerVNC]
# Connect to gra-vdi.alliancecan.ca with [https://docs.alliancecan.ca/wiki/VNC#VDI_Nodes TigerVNC]
# <code>module load CcEnv StdEnv/2016.4 *OR* StdEnv/2018.3</code>  
# <code>module load CcEnv StdEnv/2020 vtune</code>  
# <code>module load intel/2019.3</code> (optional)
# <code>vtune-gui</code><br>
# <code>module load vtune/2019.3</code>
# <code>amplxe-gui</code><br>


</translate>
</translate>


== MPI example ==
= MPI example =


First, load the latest VTune module.
First, load the latest VTune module.

Latest revision as of 19:54, 12 February 2024

Other languages:


Introduction[edit]

VTune is Intel's Performance Analysis tool for applications and systems. It is capable of Analyzing both OpenMP and MPI based applications.

Software module[edit]

To load the module on any Alliance cluster run:

Question.png
[name@server ~]$ module load vtune

Tool renaming[edit]

The content of this page is largely concerned with the legacy version named Intel® VTune™ Amplifier. Please note this tool has been renamed throughout Intel's documentation in latest versions (newer than the latest vtune module versions presently available on Alliance clusters) from Intel® VTune™ Amplifier to Intel® VTune™ Profiler. Likewise the application commands amplxe-cl and amplxe-gui have been renamed to vtune and vtune-gui for both the command line and graphical tools respectively. Further information can be found here.

Analysis types[edit]

To collect analysis information run:

Question.png
[name@server ~]$ vtune -collect <analysis-type> <target_exe> <exe_arguments>

where <analysis-type> should be replaced by one of the available analysis, e.g. hotspots, and <target_exe> is the path to the executable you would like to analyze. It is recommended to compile your executable with the "-g" option and to use the same optimization level as normal so as to obtain accurate results. A listing of version specific argument options and several usage examples maybe displayed on the command line by running vtune -help, after loading the vtune module. Complete downloadable documentation for Parallel Studio XE (including VTune) for all recent versions can be found here. The latest version of the Intel VTune Profiler User Guide may be found here.

Create reports[edit]

To create a report run this command:

Question.png
[name@server ~]$ vtune -report <report-type>

where <report-type> is the type of the report to generate, e.g. hotspots. See also:

Matrix example[edit]

Analyze and generate a summary report for the Intel Matrix Sample Project run from the command line with 4 cores:

salloc --time=1:00:00 --cpus-per-task=4 --ntasks=1 --mem=16G --account=def-yours
module load StdEnv/2020 vtune
cp -a $EBROOTVTUNE/vtune/$EBVERSIONVTUNE*/samples/en/C++/matrix . cd matrix/linux
make icc
vtune -collect hotspots ../matrix
vtune -report summary 

The latest version of matrix_multiply (uses cmake to build) can be found here.

Graphical mode[edit]

The Intel Matrix Sample Project can also be run using Vtune in GUI mode as explored here [1]. To run VTune over VNC follow the below directions depending on which system you wish to use. Running VTune graphically can be useful to generate command line configurations as discussed in [2].

Cluster nodes[edit]

  1. Connect to a cluster compute or login node with TigerVNC
  2. module load StdEnv/2020 vtune
  3. vtune-gui

VDI nodes[edit]

  1. Connect to gra-vdi.alliancecan.ca with TigerVNC
  2. module load CcEnv StdEnv/2020 vtune
  3. vtune-gui


MPI example[edit]

First, load the latest VTune module.

module load StdEnv/2020
module load vtune

Then compile your MPI program as you usually would and run it inside a job or in an interactive session started by a salloc command using:

srun aps your_mpi_program.x

After the program finishes, the profiling data will be stored in a directory called aps_result_YYYYMMDD where YYYYMMDD is the current date.

There is a lot of information you can extract from that data. To get the basic summary report of your program's performance, run:

aps-report  -D aps_result_YYYYMMDD

where you would replace YYYYMMDD to match the actual directory that has been created. This command creates an HTML file, which can be copied to your own computer and viewed in a browser. The report will clearly identify performance issues that are affecting your code.

Example report generated by aps for an MPI program