Remove expensive equilibrium deepcopying #43
Merged
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)