Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 19e716e
Previous suggestions✅ Suggestions up to commit cafc085
|
||||||||||||||||||||||||||
|
Please merge after #38 |
2dc26ca to
a587ecc
Compare
GeorgGrassler
left a comment
There was a problem hiding this comment.
repeat of golden record test on machine faepop31 (reference and now new version with fast splines). Checked on a rough s grid (13 points), exhibits differences in order 1e-10 for important output like lambda_bB and 1e-8 for check quantities like qflux_e. Changes is to be expected, as it is a different kind of splining, but not fundamental different values.
In terms of total runtime, no significant difference was noticed, as only few flux surfaces

There was a problem hiding this comment.
Even a more realistic .bc file of 70 flux surfaces, not significant difference
On a 2000 surface file, the new version was about 15% faster in the setup i.e. neo_spline radial of quantities e.g. fourier modes (34s vs 40s)
@krystophny should the speed up be not that significant?
Otherwise, I will let the pipeline run one more time (adapted the golden record test tolerance for the new splines) and if both pass, you can make the merge.
GeorgGrassler
left a comment
There was a problem hiding this comment.
General though: @krystophny I do not know about the rest of the code, but I would really rethink if not interpolation of any kind would be smarter for the initial radial setup part. Keep in mind Neo-2 operates on a per flux surface basis, so per run we only evaluate for one surface the coefficients once and then throw away the radial splines. So we do not gain anything from the initial radial splining over all points. Instead, one could quickly check ones location on the radial grid and interpolate just there, cause that is all one needs for this initial setup. Sure one could also locally spline. The big time gain would be not spline vs interpolate, but rather to do either approach just in the relegant region.
I am not sure if these current fast splines even are used for this radial part. Where did you experience a time improvement in the NEO-2 operation?
|
Thanks for the thoughtful analyses! This PR is now superseded by #40 . The fast spline here still has bugs that are also fixed there, in addition to the complete rewrite with proper sparse matrices. On the general philosophy: personally, my feeling is that the fix in #40 makes this so fast that the impact could be negligible. So then no significant rewrite with Lagrange polynomials would be required. The advantage would be that we can re-use the splined fields in orbit codes if we have higher continuity. But we could also implement the alternative. Let's discuss this then. |
User description
Summary
Test plan
🤖 Generated with Claude Code
PR Type
Enhancement
Description
Add fast spline implementation with optimized algorithm
Create new
fastsplinemodule withsplinecof3_fastsubroutineIntegrate fast path in existing spline routine
Add Claude Code development documentation
Changes diagram
Changes walkthrough 📝
spline_cof.f90
Fast spline implementation with LAPACK optimizationCOMMON/spline_cof.f90
fastsplinemodule with optimizedsplinecof3_fastsubroutinesplinecof3_afor natural boundaryconditions
dptsvsolver for improved performanceCLAUDE.md
Add Claude Code development documentationCLAUDE.md