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

Attempt to improve performance of calling Python callbacks #747

Merged
merged 16 commits into from
Nov 14, 2024

Conversation

dmitry-kabanov
Copy link
Collaborator

This PR's main goal is to improve performance of Open Interfaces in the case when non-Python implementations invoke Python callbacks via C wrapper with OIF data types. Previously, this C wrapper (which is actually a Python function wrapped with ctypes) was converting data types in Python directly. This PR changes conversion function to be completely in C.

Changes:

  • Add library _convert.c that convert OIF data types to Python data types
  • Use the above library when calling Python callbacks in attempt to improve performance
  • Update Julia dependencies
  • Fix a memory bug in OIFConfigDict C data structure
  • Add print_stats method to scipy_ode and jl_diffeq implementations

@dmitry-kabanov
Copy link
Collaborator Author

Actually, I had to disable using a C function for type conversion as it gives a segmentation fault in unit tests.

Because we with Stephan have decided to concentrate on comparing the performance between C and Julia for now, I postpone working on this to later time, in the branch py-callback-c-wrapper.

@dmitry-kabanov dmitry-kabanov merged commit cf0b12f into MaRDI4NFDI:main Nov 14, 2024
4 checks passed
@dmitry-kabanov dmitry-kabanov deleted the py-oif-wrapper branch November 14, 2024 16:28
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.

1 participant