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

Optimise/spline interpolation #28

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Waqar-ukaea
Copy link
Collaborator

Opening a PR so that I have a log of where this branch is currently at. I attempted to optimise the main Aegis run loop by removing the need to perform a spline differentiation at each particle position along its track. This takes place in a particularly hot part of the code (called for every step in the particle track of every particle) and is used to update a particle's direction vector. So some concerted effort to make this function as fast as possible would not go amiss.

However, this actually resulted in the code actually being slower than before I had made the changes. Alex suggested that perhaps this is due to the way alglib evaluates the spline at a given (R,Z) coordinate. It is entirely possible that alglib calculates the derivatives already as part of the spline evaluation in which case those derivatives are essentially free and by explicitly calling two more spline evaluations I am actually slowing down the computation of this particularly hot function.

This PR will remain parked for now in case I decide to do any more with attempting to optimise the way that the alglib functions are called.

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