Introduction
You can now access the Intel® Advisor database using our new Python API. We have provided several reference examples on how to use this new functionality. The API provides a flexible way to report on useful program metrics (Over 500 metric elements can be displayed). This article will describe how to use this new functionality.
Getting started
To get started, you first need to setup the Intel Advisor environment.
> source advixe-vars.sh
Next, to setup the Intel Advisor database, you need to run some collections. Some of the program metrics require additional analysis such as tripcounts, memory access patterns and dependencies.
> advixe-cl --collect survey --project-dir ./your_project -- <your-executable-with-parameters>
> advixe-cl --collect tripcounts -flops-and-masks -callstack-flops --project-dir ./your_project -- <your-executable-with-parameters>
> advixe-cl --collect map –mark-up-list=1,2,3,4 --project-dir ./your_project -- <your-executable-with-parameters>
> advixe-cl --collect dependencies –mark-up-list=1,2,3,4 --project-dir ./your_project -- <your-executable-with-parameters>
Finally you will need to copy the Intel Advisor reference examples to a test area.
cp –r /opt/intel/advisor_2018/python_api/examples .
Using the Intel Advisor Python API
The reference examples we have provided are just small set of the reporting possible using this flexible way to access your program data. The file columns.txt provides a list of the metrics we currently support. Here is are some example showing the python api in action:
- Generate a combined report showing all data collected
python joined.py ./your_project >& report.txt - Generate an html report
python to_html.py ./your_project - Generate a Roofline html chart
python to_html.py ./your_project - Generate cache simulation statistics
Before doing your data collection set the following environment variable: export ADVIXE_EXPERIMENTAL=cachesim- You need to do a memory access pattern collection to collect cache statistics
advixe-cl --collect map –mark-up-list=4 --project-dir ./your_project -- <your-executable-with-parameters> - Setup cache collection in Project properties
- cache.py ./your_project
- You need to do a memory access pattern collection to collect cache statistics
Conclusion/Summary
The new Intel Advisor Python API provides a powerful way to generate meaningful program statistics and reports. The provided examples gives a framework of scripts showing the power of this this new interface.