Skip to content

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.

2 participants