Giter VIP home page Giter VIP logo

itt-python's Introduction

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

itt-python's People

Contributors

oleksandr-pavlyk avatar rcthomas avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.