Skip to content

Rearchitect and jit CS fatigue#2984

Merged
timothy-nunn merged 3 commits intoukaea:mainfrom
je-cook:cs_fatigue
Nov 3, 2023
Merged

Rearchitect and jit CS fatigue#2984
timothy-nunn merged 3 commits intoukaea:mainfrom
je-cook:cs_fatigue

Conversation

@je-cook
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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