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

Rearchitect and jit CS fatigue #2984

Merged
merged 3 commits into from
Nov 3, 2023
Merged

Rearchitect and jit CS fatigue #2984

merged 3 commits into from
Nov 3, 2023

Conversation

je-cook
Copy link
Collaborator

@je-cook je-cook commented Nov 2, 2023

Description

I have jitted and reduced recalculation of the same quantities in cs fatigue and reduced calls to np.zeros in pfcoils.
I've also reduced unneeded variable assignment (assigned and then used once) because it is a slow operation in python.
Also * is faster than /

I thought it was worth it for a routine where 50% of time was spent in my run

Speeds up my convergence by >x10 🤯 (2207 iterations -> 134 iterations)

Checklist

I confirm that I have completed the following checks:

  • I have justified any large differences in the regression tests caused by this pull request in the comments.
  • I have added new tests where appropriate for the changes I have made.
  • If I have had to change any existing unit or integration tests, I have justified this change in the pull request comments.
  • If I have made documentation changes, I have checked they render correctly.
  • I have added documentation for my change, if appropriate.

Speeds up my convergence by x10 🤯
@je-cook je-cook requested a review from timothy-nunn November 2, 2023 12:34
@je-cook
Copy link
Collaborator Author

je-cook commented Nov 2, 2023

from my side is there any reason to write 1.0e0 as opposed to 1.0? I would suggest the latter is clearer if there isn't a reason

Copy link
Collaborator

@ajpearcey ajpearcey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@timothy-nunn timothy-nunn merged commit 7e5e043 into ukaea:main Nov 3, 2023
10 checks passed
@je-cook je-cook deleted the cs_fatigue branch November 3, 2023 11:19
chris-ashe pushed a commit that referenced this pull request Apr 22, 2024
* Rearchitect and jit CS fatigue

Speeds up my convergence by x10 🤯

* black format

* Update cs_fatigue.py
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.

3 participants