Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: add wrapper code for ITT-NERSC implementation to ensure compatibility #153

Merged
merged 34 commits into from
Aug 7, 2024

Conversation

mk-srivastava
Copy link
Contributor

@mk-srivastava mk-srivastava commented Jul 21, 2024

In the NERSC implementation of ITT API(Link), there are 9 functions.

Each of the function is listed below with the description about the changes done to support them.

  1. resume : Have used the existing resume implementation in ittapi.
  2. pause : Have used the existing pause implementation in ittapi.
  3. detach : Have used the existing detach implementation in ittapi.
  4. domain_create : Have used the existing domain implementation in ittapi and renamed it as domain_create.
  5. task_begin : This function is same as the task_begin implementation in ittapi, so have used that API function directly with only change that in ittapi, in task_begin is expected to have task name in StringHandle format. So, this change is done and existing API is used afterward.
  6. task_end : This function is same as the task_end implementation in ittapi, so have used that API function directly.
  7. pt_region_create : pt_region is one of things that's not there ittapi implementation. So, to support this, a new structure to handle pt_region is created along with utility functions to handle them in [pt_region.hpp, pt_region.cpp]. As a new structure is created so listed that at [ittapi.cpp]
  8. pt_region_begin : This python function is binded to C function pt_region_begin which in turn is implemented in [pt_region.cpp].
  9. pt_region_end : This python function is binded to C function pt_region_end which in turn is implemented in [pt_region.cpp].

A separate module ittapi.compat for NERSC implementation is created, thus the folder ittapi/compat/ and ittapi/compat/__init__.py listing all the supported functions by the module.

To include and build the newly created cpp file pt_region.cpp, setup.py is changed.

Rest of the changes are to add the unit test cases for the module ittapi.compat added.

python/itt_NERSC/__init__.py Outdated Show resolved Hide resolved
python/itt_NERSC/collection_control.py Outdated Show resolved Hide resolved
python/itt_NERSC/domain.py Outdated Show resolved Hide resolved
python/ittapi.native/pt_region.cpp Outdated Show resolved Hide resolved
python/itt_NERSC/pt_region.py Outdated Show resolved Hide resolved
python/samples/NERSC_collection_control_sample.py Outdated Show resolved Hide resolved
python/README.md Outdated Show resolved Hide resolved
python/ittapi.native/ittapi.cpp Outdated Show resolved Hide resolved
python/README.md Outdated Show resolved Hide resolved
python/README.md Outdated Show resolved Hide resolved
python/ittapi/__init__.py Outdated Show resolved Hide resolved
@eparshut eparshut changed the title added the wrapper code for ITT-NERSC implementation python: add wrapper code for ITT-NERSC implementation to ensure compatibility Aug 6, 2024
@oleksandr-pavlyk
Copy link

ittapi.compat module is a great idea. I should perhaps reference it from itt-python README file.

I left some suggested edits, mostly nits.

@eparshut eparshut merged commit fc432d1 into intel:master Aug 7, 2024
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants