/itt-python

Includes Python bindings to instrumentation and tracing technology (ITT) APIs for VTune

Primary LanguageCOtherNOASSERTION

itt-python

Includes Python bindings to instrumentation and tracing technology (ITT) APIs for VTune.

Intel VTune Amplifier works great on Python code. This package exposes some limited features of the ITT API in Python to help focus analysis. Right now it only has the collection and control API and some of the user task API.

Synopsis

Collection and Control

import itt
# ... uninteresting code
itt.resume()
# ... very interesting code
itt.pause()
# ... boring stuff again
itt.resume()
# ... interesting code
itt.detach()
# ... uninteresting code like writing output (sheesh)

Here one would actually run

> amplxe-cl -start-paused ... python script.py ...

So execution begins with collection paused and only the interesting code is profiled.

User Task Labels

import itt
# ... 
domain = itt.domain_create("domain")
itt.task_begin(domain, "awesome")
# ... do the awesome ...
itt.task_end(domain)

To get the user task labels into your VTune timeline you need to add enable-user-task knob

> amplxe-cl -collect hotspots -knob enable-user-tasks ... python script.py

Installation

Provide the build_ext step with the path to the root VTune install directory. For instance,

python setup.py build_ext --vtune=$VTUNE_AMPLIFIER_XE_2018_DIR
python setup.py install

The build assumes:

$VTUNE_AMPLIFIER_XE_2018_DIR/include
$VTUNE_AMPLIFIER_XE_2018_DIR/lib64/libittnotify.a

Functions

pause()

Run without collecting data. Reduces overhead from collection.

resume()

Resume data collection.

detach()

Detaches all collectors from all processes. Application continues to work but no data is collected for the running collection.

domain_create(name)

Create domain with the given name name. URI naming style is recommended. No mechanism to destroy domain (expected to be static over execution). Returns a domain, which is just a Capsule.

task_begin(domain, name)

Create task instance on a thread called name. Becomes current task instance for that thread. Call task_end() on same thread to end current task instance.

task_begin_fn()

Not implemented.

task_end(domain)

End a task instance on a thread.

References

Thanks

  • Sergey Maidanov and Vasilij Litvinov at Intel
  • Brian Friesen and Brandon Cook at NERSC