Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/DiffEqBase/Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "DiffEqBase"
uuid = "2b5f629d-d688-5b77-993f-72d75c75574e"
authors = ["Chris Rackauckas <accounts@chrisrackauckas.com>"]
version = "7.21.7"
version = "7.22.0"

[deps]
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
Expand Down
52 changes: 51 additions & 1 deletion lib/DiffEqBase/src/verbosity.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
:residual_control,
:neutral_delay,
:state_dependent_delay,
# Global error fields (GlobalDiffEq)
:global_error_event_mismatch,
:global_error_companion_order,
:global_error_final_solve,
:global_error_ad_fallback,
:global_error_grazing_event,
)

presets = (
Expand Down Expand Up @@ -59,6 +65,12 @@
residual_control = Silent(),
neutral_delay = Silent(),
state_dependent_delay = Silent(),
# Global error fields (GlobalDiffEq)
global_error_event_mismatch = Silent(),
global_error_companion_order = Silent(),
global_error_final_solve = Silent(),
global_error_ad_fallback = Silent(),
global_error_grazing_event = Silent(),
),
Minimal = (
linear_verbosity = Minimal(),
Expand Down Expand Up @@ -98,6 +110,12 @@
residual_control = Silent(),
neutral_delay = Silent(),
state_dependent_delay = WarnLevel(),
# Global error fields (GlobalDiffEq)
global_error_event_mismatch = WarnLevel(),
global_error_companion_order = Silent(),
global_error_final_solve = WarnLevel(),
global_error_ad_fallback = Silent(),
global_error_grazing_event = WarnLevel(),
),
Standard = (
linear_verbosity = Minimal(),
Expand Down Expand Up @@ -137,6 +155,12 @@
residual_control = Silent(),
neutral_delay = Silent(),
state_dependent_delay = Silent(),
# Global error fields (GlobalDiffEq)
global_error_event_mismatch = WarnLevel(),
global_error_companion_order = WarnLevel(),
global_error_final_solve = WarnLevel(),
global_error_ad_fallback = WarnLevel(),
global_error_grazing_event = WarnLevel(),
),
Detailed = (
linear_verbosity = Detailed(),
Expand Down Expand Up @@ -176,6 +200,12 @@
residual_control = InfoLevel(),
neutral_delay = InfoLevel(),
state_dependent_delay = WarnLevel(),
# Global error fields (GlobalDiffEq)
global_error_event_mismatch = WarnLevel(),
global_error_companion_order = WarnLevel(),
global_error_final_solve = WarnLevel(),
global_error_ad_fallback = WarnLevel(),
global_error_grazing_event = WarnLevel(),
),
All = (
linear_verbosity = All(),
Expand Down Expand Up @@ -215,6 +245,12 @@
residual_control = InfoLevel(),
neutral_delay = InfoLevel(),
state_dependent_delay = InfoLevel(),
# Global error fields (GlobalDiffEq)
global_error_event_mismatch = WarnLevel(),
global_error_companion_order = WarnLevel(),
global_error_final_solve = WarnLevel(),
global_error_ad_fallback = WarnLevel(),
global_error_grazing_event = WarnLevel(),
),
)

Expand Down Expand Up @@ -245,6 +281,13 @@
:neutral_delay,
:state_dependent_delay,
),
global_error = (
:global_error_event_mismatch,
:global_error_companion_order,
:global_error_final_solve,
:global_error_ad_fallback,
:global_error_grazing_event,
),
)
end

Expand Down Expand Up @@ -304,6 +347,13 @@ diagnostic messages, warnings, and errors during ODE solution.
- `neutral_delay`: Messages specific to neutral delay equations
- `state_dependent_delay`: Messages when state-dependent delays are detected/evaluated

## Global Error Group (used by GlobalDiffEq.jl)
- `global_error_event_mismatch`: Messages when the events or the terminations of the forward solve and of the true solution, as the companion of `GlobalErrorEstimation` computes it, differ
- `global_error_companion_order`: Messages when `GlobalErrorEstimation` solves its companion with a solver of order 3 or lower, which meets the tight companion tolerances poorly
- `global_error_final_solve`: Messages when the final forward solve under global error control does not repeat the accepted solve (a callback with state outside of it, or a solve that is not deterministic)
- `global_error_ad_fallback`: Messages when `GlobalAdjoint` cannot differentiate the model or a callback with ReverseDiff or ForwardDiff, and uses finite differences or a numerical VJP
- `global_error_grazing_event`: Messages when an event of `GlobalAdjoint` is grazing (the vector field is tangent to the event surface), so that its saltation matrix has no time-shift term

# Constructors

DEVerbosity(preset::AbstractVerbosityPreset)
Expand All @@ -315,7 +365,7 @@ Create an `DEVerbosity` using a preset configuration:
- `SciMLLogging.Detailed()`: Comprehensive debugging information
- `SciMLLogging.All()`: Maximum verbosity

DEVerbosity(; preset = nothing, error_control = nothing, performance = nothing, numerical = nothing, sde_specific = nothing, dde_specific = nothing, kwargs...)
DEVerbosity(; preset = nothing, error_control = nothing, performance = nothing, numerical = nothing, sde_specific = nothing, dde_specific = nothing, global_error = nothing, kwargs...)

Create an `DEVerbosity` with group-level or individual field control.

Expand Down
16 changes: 16 additions & 0 deletions lib/DiffEqBase/test/verbose_inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,19 @@ using DiffEqBase, Test
@test_throws ArgumentError DiffEqBase._process_verbose_param(true)
@test_throws ArgumentError DiffEqBase._process_verbose_param(false)
end

@testset "global_error group" begin
SL = DiffEqBase.SciMLLogging
fields = (
:global_error_event_mismatch, :global_error_companion_order, :global_error_final_solve,
:global_error_ad_fallback, :global_error_grazing_event,
)
# The group keyword sets all of its fields, and a field keyword overrides the group.
v = DEVerbosity(global_error = SL.Silent(), global_error_grazing_event = SL.WarnLevel())
@test all(f -> getproperty(v, f) == SL.Silent(), fields[1:4])
@test v.global_error_grazing_event == SL.WarnLevel()
# None silences the fields; Standard warns for all of them.
@test all(f -> getproperty(DEVerbosity(SL.None()), f) == SL.Silent(), fields)
@test all(f -> getproperty(DEVerbosity(SL.Standard()), f) == SL.WarnLevel(), fields)
@inferred DiffEqBase._process_verbose_param(v)
end
Loading