@@ -180,15 +180,15 @@ function construct_concrete_adtype(f::NonlinearFunction, ad::AbstractADType)
180
180
if f. sparsity === nothing
181
181
if f. jac_prototype === nothing
182
182
if SciMLBase. has_colorvec (f)
183
- @warn " `colorvec` is provided but `sparsity` and `jac_prototype` is not \
184
- specified. `colorvec` will be ignored."
183
+ @SciMLMessage ( " `colorvec` is provided but `sparsity` and `jac_prototype` is not \
184
+ specified. `colorvec` will be ignored." , nonlinear_verbosity[], :colorvec_no_prototype , :performance )
185
185
end
186
186
return ad # No sparse AD
187
187
else
188
188
if ! sparse_or_structured_prototype (f. jac_prototype)
189
189
if SciMLBase. has_colorvec (f)
190
- @warn " `colorvec` is provided but `jac_prototype` is not a sparse \
191
- or structured matrix. `colorvec` will be ignored."
190
+ @SciMLMessage ( " `colorvec` is provided but `jac_prototype` is not a sparse \
191
+ or structured matrix. `colorvec` will be ignored." , nonlinear_verbosity[], :colorvec_non_sparse , :performance )
192
192
end
193
193
return ad
194
194
end
@@ -223,18 +223,18 @@ function construct_concrete_adtype(f::NonlinearFunction, ad::AbstractADType)
223
223
sparsity_detector = f. sparsity
224
224
if f. jac_prototype === nothing
225
225
if SciMLBase. has_colorvec (f)
226
- @warn " `colorvec` is provided but `jac_prototype` is not specified. \
227
- `colorvec` will be ignored."
226
+ @SciMLMessage ( " `colorvec` is provided but `jac_prototype` is not specified. \
227
+ `colorvec` will be ignored." , nonlinear_verbose[], :colorvec_no_prototype , :performance )
228
228
end
229
229
coloring_algorithm = select_fastest_coloring_algorithm (nothing , f, ad)
230
230
coloring_algorithm === nothing && return ad
231
231
return AutoSparse (ad; sparsity_detector, coloring_algorithm)
232
232
else
233
233
if sparse_or_structured_prototype (f. jac_prototype)
234
234
if ! (sparsity_detector isa NoSparsityDetector)
235
- @warn " `jac_prototype` is a sparse matrix but sparsity = $(f. sparsity) \
235
+ @SciMLMessage ( " `jac_prototype` is a sparse matrix but sparsity = $(f. sparsity) \
236
236
has also been specified. Ignoring sparsity field and using \
237
- `jac_prototype` sparsity."
237
+ `jac_prototype` sparsity." , nonlinear_verbose[], :sparsity_using_jac_prototype , :performance )
238
238
end
239
239
sparsity_detector = KnownJacobianSparsityDetector (f. jac_prototype)
240
240
end
255
255
function select_fastest_coloring_algorithm (
256
256
prototype, f:: NonlinearFunction , ad:: AbstractADType )
257
257
if ! Utils. is_extension_loaded (Val (:SparseMatrixColorings ))
258
- @warn " `SparseMatrixColorings` must be explicitly imported for sparse automatic \
259
- differentiation to work. Proceeding with Dense Automatic Differentiation."
258
+ @SciMLMessage ( " `SparseMatrixColorings` must be explicitly imported for sparse automatic \
259
+ differentiation to work. Proceeding with Dense Automatic Differentiation." , :sparse_matrix_colorings_not_loaded , :performance )
260
260
return nothing
261
261
end
262
262
return select_fastest_coloring_algorithm (Val (:SparseMatrixColorings ), prototype, f, ad)
0 commit comments