Remove expensive equilibrium deepcopying#43
Merged
georgeholt1 merged 4 commits intoOct 8, 2025
Conversation
8bc51b3 to
5c09a5f
Compare
2137a24 to
4d709b3
Compare
4d709b3 to
57ca425
Compare
kpentland
approved these changes
Oct 8, 2025
Collaborator
kpentland
left a comment
There was a problem hiding this comment.
Changes look great Tim, thanks!
I've run the examples and also tested examples 6a/b to ensure everything still works for MAST-U equilibria. Seems to be working nicely.
We'll update the freegs4e version, get the tests run, and then merge in.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NOTE: this PR requires FusionComputingLab/freegs4e#47 and should probably be pinned to version 0.12+ of freegs4e.
Removes expensive deepcopies of equilibrium objects inside the evolutive loop.
The following table shows the % of the runtime for a 60 iteration example evolutive run that is spent deep copying objects.
main (10615f0)Overall, this results in a reduction in runtime spent in$21.12$ % on main to $16.96$ % on this branch.
stepping.nlstepper(linear evolutive example): going fromI have compared history arrays of the coil currents, o-points, elongation, triangularity, squareness, separatrix area, and separatrix length between
mainand this PR. There is a 0 MAE between the non-linear example histories on main and in this PR, and a 0 MAE between the linear histories on main and in this PR.I have confirmed that example 01, 02, 03, 04, 05, 09, and 10 can run on this branch and produce the same results as on main (the example are all non-deterministic because the RNG is not seeded but they are qualitatively similar to examples as run on
main)