Skip to main content

Python bindings to Intel Instrumentation and Tracing Technology (ITT) API.

Project description

PyPI - Python Version PyPI

pyitt

pyitt is a Python binding to Intel Instrumentation and Tracing Technology (ITT) API. It provides a convenient way to mark up the Python code for further performance analysis using performance analyzers from Intel like Intel VTune or others.

pyitt supports following ITT APIs:

  • Collection Control API
  • Domain API
  • String Handle API
  • Id API (partial support)
  • Task API (partial support)
  • Thread Naming API

Usage

The main goal of the project is to provide the ability to instrument a Python code using ITT API in the Pythonic way. pyitt provides wrappers that simplify markup of Python code.

import pyitt

@pyitt.task
def workload():
  pass

workload()

pyitt.task can be used as a decorator. In this case, the name of a callable object (workload function in this example) will be used as a name of the task and the task will be attributed to a default domain named 'pyitt'. If you want to change the default name and/or other parameters for the task (e.g. task domain), you can pass them as arguments to pyitt.task:

import pyitt

@pyitt.task('My Task', domain='My Task Domain')
def workload():
  pass

workload()

Also, pyitt.task returns the object that can be used as a context manager:

import pyitt

with pyitt.task():
    # some code here...
    pass

If the task name is not specified, the pyitt.task uses call site information (filename and line number) to give the name to the task. A custom name for the task and other task parameters can be specified via arguments for pyitt.task in the same way as for the decorator form.

Build

The native part of pyitt module is written using C++20 standard, therefore you need a compiler that supports this standard, for example GCC-13 for Linux and Visual Studio 2022 for Windows.

Ubuntu 22.04

  1. Install the compiler and Python utilities to build module:

    sudo add-apt-repository ppa:ubuntu-toolchain-r/test
    sudo apt update
    sudo apt install gcc-13 g++-13 python3-pip
    
  2. Clone the repository:

    git clone --recurse-submodules https://github.com/esuldin/pyitt.git
    
  3. Prepare the build environment: specify the compiler and the path to ITT header and static library.

    export CC=`which gcc-13`
    export CXX=`which g++-13`
    export VTUNE_PROFILER_DIR=/opt/intel/oneapi/vtune/latest
    
  4. Build and install pyitt:

    cd pyitt
    pip install .
    

Windows 10/11

  1. Install Python 3.8+ together with pip utility.

  2. Install Visual Studio 2022. Make sure that "Desktop development with C++" workload is selected.

  3. Clone the repository

    git clone --recurse-submodules https://github.com/esuldin/pyitt.git
    
  4. Prepare the build environment: specify the paths to Python and to ITT header and static library.

    set PATH=C:\Program Files\Python38;C:\Program Files\Python38\Scripts;%PATH%
    set VTUNE_PROFILER_DIR=C:\Program Files (x86)\Intel\oneAPI\vtune\latest
    
  5. Build and install pyitt

    cd pyitt
    pip install .
    

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyitt-1.0.1.tar.gz (10.5 MB view hashes)

Uploaded Source

Built Distributions

pyitt-1.0.1-pp310-pypy310_pp73-win_amd64.whl (37.1 kB view hashes)

Uploaded PyPy Windows x86-64

pyitt-1.0.1-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (46.8 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyitt-1.0.1-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (46.4 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

pyitt-1.0.1-pp39-pypy39_pp73-win_amd64.whl (37.1 kB view hashes)

Uploaded PyPy Windows x86-64

pyitt-1.0.1-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (46.8 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyitt-1.0.1-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (46.4 kB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

pyitt-1.0.1-cp312-cp312-win_amd64.whl (37.0 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

pyitt-1.0.1-cp312-cp312-win32.whl (32.5 kB view hashes)

Uploaded CPython 3.12 Windows x86

pyitt-1.0.1-cp312-cp312-musllinux_1_2_x86_64.whl (1.0 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.2+ x86-64

pyitt-1.0.1-cp312-cp312-musllinux_1_2_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.2+ i686

pyitt-1.0.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (154.2 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyitt-1.0.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (139.9 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

pyitt-1.0.1-cp311-cp311-win_amd64.whl (37.0 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

pyitt-1.0.1-cp311-cp311-win32.whl (32.4 kB view hashes)

Uploaded CPython 3.11 Windows x86

pyitt-1.0.1-cp311-cp311-musllinux_1_2_x86_64.whl (1.0 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.2+ x86-64

pyitt-1.0.1-cp311-cp311-musllinux_1_2_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.2+ i686

pyitt-1.0.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (152.7 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyitt-1.0.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (139.7 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

pyitt-1.0.1-cp310-cp310-win_amd64.whl (37.0 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

pyitt-1.0.1-cp310-cp310-win32.whl (32.4 kB view hashes)

Uploaded CPython 3.10 Windows x86

pyitt-1.0.1-cp310-cp310-musllinux_1_2_x86_64.whl (1.0 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.2+ x86-64

pyitt-1.0.1-cp310-cp310-musllinux_1_2_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.2+ i686

pyitt-1.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (151.4 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyitt-1.0.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (138.4 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

pyitt-1.0.1-cp39-cp39-win_amd64.whl (37.0 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

pyitt-1.0.1-cp39-cp39-win32.whl (32.4 kB view hashes)

Uploaded CPython 3.9 Windows x86

pyitt-1.0.1-cp39-cp39-musllinux_1_2_x86_64.whl (1.0 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.2+ x86-64

pyitt-1.0.1-cp39-cp39-musllinux_1_2_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.2+ i686

pyitt-1.0.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (150.7 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyitt-1.0.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (137.5 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

pyitt-1.0.1-cp38-cp38-win_amd64.whl (37.0 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

pyitt-1.0.1-cp38-cp38-win32.whl (32.4 kB view hashes)

Uploaded CPython 3.8 Windows x86

pyitt-1.0.1-cp38-cp38-musllinux_1_2_x86_64.whl (1.0 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.2+ x86-64

pyitt-1.0.1-cp38-cp38-musllinux_1_2_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.2+ i686

pyitt-1.0.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (151.4 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyitt-1.0.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (138.7 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page