Enable test_sympl_stell to cover the fortnum multiroot quasi path#391
Open
krystophny wants to merge 4 commits into
Open
Enable test_sympl_stell to cover the fortnum multiroot quasi path#391krystophny wants to merge 4 commits into
krystophny wants to merge 4 commits into
Conversation
orbit_symplectic_quasi was the sole consumer of the vendored MINPACK hybrd1. Replace each of the eight hybrd1 calls with fortnum's multiroot_hybrids (Newton step with a backtracking line search and a finite-difference Jacobian), which provides the same warm-started, Jacobian-free root solve the call sites relied on. Each f_*_quasi residual now conforms to the multiroot_fn_t interface (assumed-shape x/f, optional ctx, no iflag); state still travels through the existing module globals f, fs, si. The f_midpoint_quasi double field evaluation ordering (midpoint stage saved, then endpoint) is preserved. xtol and ftol are both set to si%rtol to track the former hybrd1 stopping behavior. Wire fortnum via CMake FetchContent (GIT_TAG a7faa3c, guarded by NOT TARGET fortnum) and link it into the simple library. Delete src/contrib/minpack.f90, minpack_interfaces.f90, and LICENSE.minpack.
fortnum a7faa3c installed its C ABI header from CMAKE_SOURCE_DIR, which resolves to the consumer tree under FetchContent and failed SIMPLE's install step. fortnum main now sources the header from PROJECT_SOURCE_DIR (9595e51); pin to the merge commit that carries the fix.
test_sympl_stell drives the quasi-symplectic steps (timestep_*_quasi), the only code path that calls the root solver behind the quasi method (fortnum multiroot_hybrids on this branch, MINPACK hybrd1 on main). The quasi block sat behind an unconditional stop and the executable had no add_test, so the solver swap ran zero times in the suite. Remove the dead stop so the quasi integrators run, set coord_input and field_input before init_field (now required since the reference-coordinate init was added), and register test_sympl_stell as an integration test. Verified on faepop31 deterministic-FP build: the quasi run calls multiroot_hybrids 359952 times; the run completes in 72 s under ctest.
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.
Merge order
Merge sequence: #390, then #391. This PR carries the
test_sympl_stellmultiroot coverage test that stacks on #390 (the MINPACK-to-fortnum
multiroot swap).
Both PRs are based on
mainindividually, so each diff is cumulative againstmainand the two overlap. Merge #390 first. Once it lands, this PR's diffshrinks to its increment: the
test_sympl_stellcoverage alone.Enables the test_sympl_stell unit driver (previously dead code behind an unconditional stop) so the quasi symplectic integrators that call fortnum multiroot_hybrids (MINPACK hybrd1 on main) are actually exercised.
Verification
ref-vs-cur on faepop31 deterministic-FP build: multiroot_hybrids called 359952 times on cur; 10 quasi integrator outputs, 375000 values, all match at RTOL 1e-7/ATOL 1e-12 (worst rel 5.9e-8, convergence-tolerance level). Registered as ctest test_sympl_stell (TIMEOUT 120). This is the only reachable path that exercises the MINPACK->fortnum multiroot swap; production simple.in cases use the orbit_timestep_sympl/newton1 path and never call it.