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

Write solver in C/C++ and vectorize #4

Open
bgmeulem opened this issue Dec 17, 2023 · 5 comments
Open

Write solver in C/C++ and vectorize #4

bgmeulem opened this issue Dec 17, 2023 · 5 comments
Labels
enhancement New feature or request

Comments

@bgmeulem
Copy link
Owner

A lot of points need to be sampled, and there are currently no significant matters taken for speedup.
The biggest bottleneck is solving the elliptic integral in equation 13. While scipy solves this in C, it is an annoying overhead having the solver itself in Python. A lot of time is wasted on communicating back and forth the solutions. The code should either be vectorized, so that all solutions can be communicated at once, or I should write my math.py in C/C++ to speed up the biggest bottleneck of the code. Preferably both should be done.

@bgmeulem bgmeulem added this to the Publish on PyPI milestone Dec 17, 2023
@bgmeulem bgmeulem added the enhancement New feature or request label Dec 17, 2023
@Niohori
Copy link
Collaborator

Niohori commented Jan 14, 2024

Hello, I'm currently porting your code to C++. It is still a work in progress and still trying to decode the finesses of the Python version. If you want and can help you, I can upload what I already have on Github.

@bgmeulem
Copy link
Owner Author

Hi Niohori

That's absolutely wonderful! By any means, feel free to make contributions.

The python code could use some cleaning and restructuring to make it more clear (there is some superfluous code, plotting methods I used during debugging, and hooks for future extensions that were never finished), but the main "juice" of it is solving equation 13 (currently done with a midpoint solver). If you have any questions about the code, do let me know! I won't be able to add to your contribution for the next week or so, but after that, I would love to join in on the C++ conversion.

@Niohori
Copy link
Collaborator

Niohori commented Jan 14, 2024

OK, I will upload in the coming days what I have on Github.

@Niohori
Copy link
Collaborator

Niohori commented Jan 23, 2024

FYI: I uploaded some code

@bgmeulem
Copy link
Owner Author

Lovely! Feel free to create a pull request. I'll run it over when I get the chance. I've skimmed through it and it looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants