Skip to content

Commit dbf28e6

Browse files
committed
fixes for LinearVerbosity
1 parent 3085323 commit dbf28e6

File tree

2 files changed

+19
-40
lines changed

2 files changed

+19
-40
lines changed

src/LinearSolve.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ using SciMLOperators: SciMLOperators, AbstractSciMLOperator, IdentityOperator,
2222
MatrixOperator,
2323
has_ldiv!, issquare
2424
using SciMLLogging: SciMLLogging, @SciMLMessage, verbosity_to_int, AbstractVerbositySpecifier, AbstractMessageLevel, AbstractVerbosityPreset,
25-
Silent, InfoLevel, WarnLevel, ErrorLevel, None, Minimal, Standard, Detailed, All
25+
Silent, InfoLevel, WarnLevel, ErrorLevel, CustomLevel, None, Minimal, Standard, Detailed, All
2626
using Setfield: @set, @set!
2727
using UnPack: @unpack
2828
using DocStringExtensions: DocStringExtensions

src/verbosity.jl

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LinearSolve.@concrete struct LinearVerbosity <:
55
# Performance
66
no_right_preconditioning
77
# Numerical
8-
using_iterative_solvers
98
using_IterativeSolvers
109
IterativeSolvers_iterations
1110
KrylovKit_verbosity
@@ -47,18 +46,17 @@ function LinearVerbosity(;
4746
default_args = (
4847
default_lu_fallback = WarnLevel(),
4948
no_right_preconditioning = WarnLevel(),
50-
using_iterative_solvers = WarnLevel(),
51-
using_IterativeSolvers = WarnLevel(),
52-
IterativeSolvers_iterations = WarnLevel(),
53-
KrylovKit_verbosity = WarnLevel(),
49+
using_IterativeSolvers = Silent(),
50+
IterativeSolvers_iterations = Silent(),
51+
KrylovKit_verbosity = CustomLevel(1), # WARN_LEVEL in KrylovKit.jl
5452
KrylovJL_verbosity = Silent(),
5553
HYPRE_verbosity = InfoLevel(),
5654
pardiso_verbosity = Silent(),
57-
blas_errors = WarnLevel(),
58-
blas_invalid_args = WarnLevel(),
55+
blas_errors = ErrorLevel(),
56+
blas_invalid_args = ErrorLevel(),
5957
blas_info = Silent(),
6058
blas_success = Silent(),
61-
condition_number = Silent()
59+
condition_number=Silent()
6260
)
6361

6462
# Apply group-level settings
@@ -90,7 +88,6 @@ function LinearVerbosity(verbose::AbstractVerbosityPreset)
9088
LinearVerbosity(
9189
default_lu_fallback = Silent(),
9290
no_right_preconditioning = Silent(),
93-
using_iterative_solvers = Silent(),
9491
using_IterativeSolvers = Silent(),
9592
IterativeSolvers_iterations = Silent(),
9693
KrylovKit_verbosity = Silent(),
@@ -105,52 +102,35 @@ function LinearVerbosity(verbose::AbstractVerbosityPreset)
105102
)
106103
elseif verbose isa Standard
107104
# Standard: Everything from Minimal + non-fatal warnings
108-
LinearVerbosity(
109-
default_lu_fallback = WarnLevel(),
110-
no_right_preconditioning = WarnLevel(),
111-
using_iterative_solvers = WarnLevel(),
112-
using_IterativeSolvers = WarnLevel(),
113-
IterativeSolvers_iterations = WarnLevel(),
114-
KrylovKit_verbosity = WarnLevel(),
115-
KrylovJL_verbosity = Silent(),
116-
HYPRE_verbosity = InfoLevel(),
117-
pardiso_verbosity = Silent(),
118-
blas_errors = ErrorLevel(),
119-
blas_invalid_args = ErrorLevel(),
120-
blas_info = Silent(),
121-
blas_success = Silent(),
122-
condition_number = Silent()
123-
)
105+
LinearVerbosity()
124106
elseif verbose isa Detailed
125107
# Detailed: Everything from Standard + debugging/solver behavior
126108
LinearVerbosity(
127-
default_lu_fallback = InfoLevel(),
109+
default_lu_fallback = WarnLevel(),
128110
no_right_preconditioning = InfoLevel(),
129-
using_iterative_solvers = InfoLevel(),
130111
using_IterativeSolvers = InfoLevel(),
131-
IterativeSolvers_iterations = InfoLevel(),
132-
KrylovKit_verbosity = InfoLevel(),
133-
KrylovJL_verbosity = WarnLevel(),
112+
IterativeSolvers_iterations = Silent(),
113+
KrylovKit_verbosity = CustomLevel(2), # STARTSTOP_LEVEL in KrylovKit.jl
114+
KrylovJL_verbosity = CustomLevel(1), # verbose = true in Krylov.jl
134115
HYPRE_verbosity = InfoLevel(),
135-
pardiso_verbosity = WarnLevel(),
116+
pardiso_verbosity = CustomLevel(1), # verbose = true in Pardiso.jl
136117
blas_errors = ErrorLevel(),
137118
blas_invalid_args = ErrorLevel(),
138119
blas_info = InfoLevel(),
139120
blas_success = InfoLevel(),
140-
condition_number = InfoLevel()
121+
condition_number = Silent()
141122
)
142123
elseif verbose isa All
143124
# All: Maximum verbosity - every possible logging message at InfoLevel
144125
LinearVerbosity(
145-
default_lu_fallback = InfoLevel(),
126+
default_lu_fallback = WarnLevel(),
146127
no_right_preconditioning = InfoLevel(),
147-
using_iterative_solvers = InfoLevel(),
148128
using_IterativeSolvers = InfoLevel(),
149129
IterativeSolvers_iterations = InfoLevel(),
150-
KrylovKit_verbosity = InfoLevel(),
151-
KrylovJL_verbosity = InfoLevel(),
130+
KrylovKit_verbosity = CustomLevel(3), # EACHITERATION_LEVEL in KrylovKit.jl
131+
KrylovJL_verbosity = CustomLevel(1),
152132
HYPRE_verbosity = InfoLevel(),
153-
pardiso_verbosity = InfoLevel(),
133+
pardiso_verbosity = CustomLevel(1), # verbsoe = true in Pardiso.jl
154134
blas_errors = ErrorLevel(),
155135
blas_invalid_args = ErrorLevel(),
156136
blas_info = InfoLevel(),
@@ -174,7 +154,6 @@ end
174154
Silent(),
175155
Silent(),
176156
Silent(),
177-
Silent(),
178157
Silent())
179158
end
180159

@@ -194,7 +173,7 @@ end
194173
# Group classifications
195174
const error_control_options = (:default_lu_fallback, :blas_errors, :blas_invalid_args)
196175
const performance_options = (:no_right_preconditioning,)
197-
const numerical_options = (:using_iterative_solvers, :using_IterativeSolvers, :IterativeSolvers_iterations,
176+
const numerical_options = (:using_IterativeSolvers, :IterativeSolvers_iterations,
198177
:KrylovKit_verbosity, :KrylovJL_verbosity, :HYPRE_verbosity, :pardiso_verbosity,
199178
:blas_info, :blas_success, :condition_number)
200179

0 commit comments

Comments
 (0)