From 919de0eccf7365e850e72e1436a071f11e3bade9 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Sat, 12 Oct 2024 11:20:50 +0200 Subject: [PATCH] Fix duplicated log messages (#2542) We need to remove the default error handler, otherwise sundials error message will be printed twice. --- src/solver.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/solver.cpp b/src/solver.cpp index 5c96855d97..7dc3980c5c 100644 --- a/src/solver.cpp +++ b/src/solver.cpp @@ -1205,6 +1205,7 @@ void Solver::initializeNonLinearSolverSens(Model const* model) const { } void Solver::setErrHandlerFn() const { + SUNContext_ClearErrHandlers(sunctx_); auto sunerr = SUNContext_PushErrHandler( sunctx_, wrapErrHandlerFn, reinterpret_cast(const_cast(this))