Repository navigation
Conversation
…ump; warn on another SUNDIALS (lanl#1335) KINSOL's difference quotient (method="newton", jacobian="fd") and the steady-state march's colored sparse one (forced KLU) have no mend for a step across a jump, and nothing pinned that they need none. They now start on a threshold and 1e-9 either side of it, and beside a species held at 0, and are checked against closed forms on each path, each test asserting the path it took. All pass on main: no wrong answer, as lanl#1302 found. dq_jacobian.hpp reproduces the vendored CVODE 7.2's dense quotient. A configure against a system SUNDIALS of another release now says so, and docs/installation.md documents it, in place of a CI leg.
This branch has not been deployed
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.
Closes #1335.
#1335 lists three paths that #1302 (#1002) left without a test or a decision. No wrong answer was known on any of them, and this PR finds none. It pins each one and documents the third.
1 and 2: the two steady-state quotients with no jump mend
#1302 mends a difference-quotient row whose step crosses a jump for runs (dense and colored) and for the dense steady-state march. Two quotients were left as they were:
method="newton"withjacobian="fd". A declined law sendsnewtonto the march instead, so that path is reached only with"fd".New tests in
test_difference_quotient_jump.pyrun each path, plus KINSOL on KLU, from:X' = s − kx·k(X)·Xwithk = 0.04above 5 and0.02at or below. With s = 0.08 the one steady state is X = 4, below the threshold; with s = 0.4 it is X = 10, above;Each is checked against its closed form (
< 1e-4relative, the file'sOK), and the held species against exactly 0.Each test also asserts the path it took:
method_used,linear_solver(dense/klu) andsolver_jacobian_source == "finite-difference". Prototyping showed why that matters: with a declined law,method="newton"silently converges by the march instead, and would have "tested" KINSOL without touching it.The KLU paths skip on a KLU-off build, with the reason
conftest.pyalready declares.These pin the current behaviour rather than fix a defect. They are the "nothing pins that" #1335 asks for, and they agree with #1302's 72 and 24 variants that found no wrong answer.
3: SUNDIALS other than the vendored 7.2
include/bngsim/dq_jacobian.hppreproducescvLsDenseDQJacof the vendored SUNDIALS (v7.2.1) bit for bit. With-DBNGSIM_USE_SYSTEM_SUNDIALS=ONand another release, it is still a valid quotient, but not necessarily that release's own. #1335 asks for a CI leg or a documented refusal. This does the documented half:CMakeLists.txt: in the system-SUNDIALS branch, compareSUNDIALS_VERSION's major.minor withVENDOR.json'sauthoritative_release_tag, and warn on a mismatch:docs/installation.md: the same note besideBNGSIM_USE_SYSTEM_SUNDIALS.Verified by running the block in
cmake -PwithSUNDIALS_VERSIONset to each of these:The default (vendored) configure does not enter the branch. Every CI leg uses the vendored path, so the full configure is exercised there.
A warning, not a refusal: a system SUNDIALS of another 7.x is supported (
find_package(SUNDIALS 7.0 …)), and refusing it would drop HPC builds that link a site SUNDIALS.Measured
test_difference_quotient_jump.pywith the new cases, plustest_skip_audit.py,test_ci_run_list_coverage.pyandtest_docs_api_examples.py: 120 passed.