Skip to content

Conversation

@jClugstor
Copy link
Member

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

Adds a fallback for when a verbose is Bool. Also adds a two-argument SciMLMessage macro that takes a Bool, if verb is true emit a warning with the message.

@jClugstor
Copy link
Member Author

jClugstor commented Nov 7, 2025

@ChrisRackauckas this would fix downstream tests for SciML/OrdinaryDiffEq.jl#2895 and also adds a (maybe not very useful) way to use the SciMLMessage macro.

I've tested it locally with current versions of LinearSolve and NonlinearSolve and the branch of OrdinaryDiffEq in that PR to make sure that no overhead was introduced, and that the SciMLLogging code is able to be compiled out.

Also made sure JET test_opt still works for LinearSolve.

using LinearSolve 

A = [1.0 0 0 0
    0 1 0 0
    0 0 1 0
    0 0 0 0]
b = rand(4)
prob = LinearProblem(A, b)

@test_opt solve(prob, LUFactorization(), verbose = SciMLLogging.None())
Test Passed

(Demo) pkg> st 
Status `~/Documents/Work/dev/VerbosityDemo/Demo/Project.toml`
  [7ed4a6bd] LinearSolve v3.46.1
  [e6f89c97] LoggingExtras v1.2.0
  [8913a72c] NonlinearSolve v4.12.0
  [1dea7af3] OrdinaryDiffEq v6.103.0 `~/Documents/Work/dev/OrdinaryDiffEq.jl`
  [6ad6398a] OrdinaryDiffEqBDF v1.11.0 `~/Documents/Work/dev/OrdinaryDiffEq.jl/lib/OrdinaryDiffEqBDF`
  [bbf590c4] OrdinaryDiffEqCore v1.37.0 `~/Documents/Work/dev/OrdinaryDiffEq.jl/lib/OrdinaryDiffEqCore`
  [127b3ac7] OrdinaryDiffEqNonlinearSolve v1.16.0 `~/Documents/Work/dev/OrdinaryDiffEq.jl/lib/OrdinaryDiffEqNonlinearSolve`
  [a6db7da4] SciMLLogging v1.4.0 `~/Documents/Work/dev/SciMLLogging.jl`
  [4536629a] OpenBLAS_jll v0.3.29+0

@ChrisRackauckas ChrisRackauckas merged commit 4a34dbd into SciML:main Nov 8, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants