Sundials v7.8.0 - #1601
Closed
AnHeuermann wants to merge 2 commits into
Closed
Conversation
Bump 3rdParty, which replaces the patched sundials-5.4.0 source copy with a pristine submodule pinned to v7.8.0, and port the solvers to the new API. In the integrated OpenModelica build (OPENMODELICA_NEW_CMAKE_BUILD) this block is skipped and we link the SUNDIALS that OMC configured, so the two option sets have to stay in agreement. Going from 5.4.0 to 7.8.0 crosses two breaking releases: - Every SUNDIALS object is now created against a SUNContext. SystemSC, SystemSC3 and KinsolSolver each own one and pass it to N_VNew_Serial, SUNDenseMatrix, SUNLinSol_Dense, CVodeCreate and KINCreate. It has to be created before the first such object and freed after the last one. - realtype -> sunrealtype. - KINSetErrHandlerFn is gone; the error handler is pushed onto the SUNContext with SUNContext_PushErrHandler and now reports a source location plus a SUNErrCode instead of a module name and message string. Package level codes (KIN_* and friends) are not SUNErrCodes, so SUNGetErrMsg() is only used when SUNDIALS did not supply a message, the same rule its own default handler uses. - KINSetPrintLevel and KINSetInfoHandlerFn are gone with no equivalent, so sundialsInfoHandlerFunction is dropped. KINSOL's progress output only exists via the SUNLogger, which is compiled out at the logging level SUNDIALS is built with here. - SUNDIALS no longer writes to a FILE* of its own. Up to SUNDIALS 5 CVODE printed to cv_errfp, which defaulted to stderr; the same messages now go through the SUNContext error handler chain, whose default handler writes to the SUNLogger's error stream. Either way that bypasses OMSimulator's logger, so the logger's error and warning streams are muted per context and we report through logError as before. While in here, report the allocation failures in KinsolSolver::NewKinsolSolver that were silently ignored: the five N_VNew_Serial calls, SUNDenseMatrix and SUNLinSol_Dense were used without checking for NULL. Also correct two copy-pasted messages that blamed N_VNew_Serial for a failing SUNDenseMatrix. Also follow the oms::3rd::cvode/kinsol -> oms::3rd::sundials::cvode/kinsol alias rename from 3rdParty. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Related Issues
Fresh PR for #1600.