Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UndefVarError: jvp_op not defined in local scope #17

Open
oscardssmith opened this issue Nov 16, 2024 · 2 comments
Open

UndefVarError: jvp_op not defined in local scope #17

oscardssmith opened this issue Nov 16, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@oscardssmith
Copy link

I ran into

  UndefVarError: `jvp_op` not defined in local scope
  Suggestion: check for an assignment to a local variable that shadows a global of the same name.
  Stacktrace:
    [1] (::LineSearch.var"#5#6")(du::Vector{Float64}, u::Vector{Float64}, fu::Vector{Float64}, p::Nothing)
      @ LineSearch ~/.julia/packages/LineSearch/Ky1ZB/src/utils.jl:42

with

Status `~/.julia/dev/DAECompiler/Manifest.toml`
  [87fe0de2] LineSearch v0.1.4

Any idea what caused this?

@oscardssmith oscardssmith added the bug Something isn't working label Nov 16, 2024
@avik-pal
Copy link
Member

Either I am blind or all branches in that function do define a jvp_op... Which algorithm triggered this?

@oscardssmith
Copy link
Author

oscardssmith commented Nov 19, 2024

The relavent stack trace is attached. This is using RobustMultiNewton(autodiff=AutoFiniteDiff()) with a singular jacobian, and a jacobian I think

[4] solve!(cache::LineSearch.LineSearchesJLCache{NonlinearFunction{true, SciMLBase.FullSpecialize, 
OrdinaryDiffEqNonlinearSolve.var"#_initialize_dae!##"{ODEFunction{true, SciMLBase.FullSpecialize, Funtion, SparseArrays.SparseMatrixCSC{Float64, Int64}, Nothing, Function, Function, Nothing, Nothing, Matrix{Float64}, Matrix{Float64}, Nothing, Nothing, Nothing, Nothing, Function, Nothing, TransformedIRODESystem, Nothing, Nothing}, Type{ForwardDiff.Dual}, Bool, PreallocationTools.DiffCache{Vector{Float64}, Vector{Float64}}, PreallocationTools.DiffCache{Vector{Float64}, Vector{Float64}}, Vector{Float64}, Vector{Bool}, Float64, Vector{Bool}, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Matrix{Float64}, Matrix{Float64}, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing, Nothing}, Nothing, LineSearch.var"#64#65"{typeof(+), typeof(*), SciMLBase.NLStats}, LineSearch.var"#66#67"{typeof(+), typeof(*), SciMLBase.NLStats}, LineSearch.var"#68#69"{typeof(+), typeof(*), SciMLBase.NLStats}, LineSearches.BackTracking{Float64, Int64}, Float64, Float64, LineSearch.var"#5#6", Vector{Float64}, Vector{Float64}, SciMLBase.NLStats, LineSearch.LineSearchesJL{LineSearches.BackTracking{Float64, Int64}, Bool, Nothing}}, u::SubArray{Float64, 1, Vector{Float64}, Tuple{Vector{Int64}}, false}, du::Vector{Float64})
  @ LineSearch ~/.julia/packages/LineSearch/Ky1ZB/src/line_searches_ext.jl:105
[5] __step!(cache::NonlinearSolve.GeneralizedFirstOrderAlgorithmCache{true, :LineSearch, false, Vector{Float64}, SubArray{Float64, 1, Vector{Float64}, Tuple{Vector{Int64}}, false}, Vector{Float64}, Nothing, Vector{Float64}, Matrix{Float64}, 
    NonlinearSolve.GeneralizedFirstOrderAlgorithm{nothing, :NewtonRaphson, LineSearch.LineSearchesJL{LineSearches.BackTracking{Float64, Int64}, Bool, Nothing}, Missing, NonlinearSolve.NewtonDescent{Nothing, typeof(NonlinearSolve.DEFAULT_PRECS)},         ADTypes.AutoFiniteDiff{Val{:forward}, Val{:forward}, Val{:hcentral}}, ADTypes.AutoFiniteDiff{Val{:forward}, Val{:forward}, Val{:hcentral}}, Nothing}, NonlinearProblem{SubArray{Float64, 1, Vector{Float64}, Tuple{Vector{Int64}}, false}, true, Nothing, NonlinearFunction{true, SciMLBase.FullSpecialize, OrdinaryDiffEqNonlinearSolve.var"#_initialize_dae!##30#_initialize_dae!##31"{ODEFunction{true, SciMLBase.FullSpecialize, Function, SparseArrays.SparseMatrixCSC{Float64, Int64}, Nothing, Function, Function, Nothing, Nothing, Matrix{Float64}, Matrix{Float64}, Nothing, Nothing, Nothing, Nothing, Function, Nothing, TransformedIRODESystem, Nothing, Nothing}, Type{ForwardDiff.Dual}, Bool, PreallocationTools.DiffCache{Vector{Float64}, Vector{Float64}}, PreallocationTools.DiffCache{Vector{Float64}, Vector{Float64}}, Vector{Float64}, Vector{Bool}, Float64, Vector{Bool}, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Matrix{Float64}, Matrix{Float64}, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardNonlinearProblem}, NonlinearSolve.JacobianCache{true, Matrix{Float64}, NonlinearFunction{true, SciMLBase.FullSpecialize, OrdinaryDiffEqNonlinearSolve.var"#_initialize_dae!##30#_initialize_dae!##31"{ODEFunction{true, SciMLBase.FullSpecialize, Function, SparseArrays.SparseMatrixCSC{Float64, Int64}, Nothing, Functon, Function, Nothing, Nothing, Matrix{Float64}, Matrix{Float64}, Nothing, Nothing, Nothing, Nothing, Function, Nothing, TransformedIRODESystem, Nothing, Nothing}, Type{ForwardDiff.Dual}, Bool, PreallocationTools.DiffCache{Vector{Float64}, Vector{Float64}}, PreallocationTools.DiffCache{Vector{Float64}, Vector{Float64}}, Vector{Float64}, Vector{Bool}, Float64, Vector{Bool}, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Matrix{Float64}, Matrix{Float64}, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing, Nothing}, Vector{Float64}, SubArray{Float64, 1, Vector{Float64}, Tuple{Vector{Int64}}, false}, Nothing, ADTypes.AutoSparse{ADTypes.AutoFiniteDiff{Val{:forward}, Val{:forward}, Val{:hcentral}}, ADTypes.KnownJacobianSparsityDetector{Matrix{Float64}}, SparseMatrixColorings.GreedyColoringAlgorithm{:direct, SparseMatrixColorings.LargestFirst}}, DifferentiationInterfaceSparseMatrixColoringsExt.PushforwardSparseJacobianPrep{DifferentiationInterface.BatchSizeSettings{1, false, true}, SparseMatrixColorings.ColumnColoringResult{Matrix{Float64}, SparseMatrixColorings.BipartiteGraph{Int64}, Vector{SubArray{Int64, 1, Vector{Int64}, Tuple{UnitRange{Int64}}, true}}}, Matrix{Float64}, Vector{Tuple{Vector{Float64}}}, Vector{Tuple{Vector{Float64}}}, DifferentiationInterface.NoPushforwardPrep}}, NonlinearSolve.NewtonDescentCache{false, false, Vector{Float64}, Nothing, NonlinearSolve.LinearSolverCache{LinearSolve.LinearCache{Matrix{Float64}, Vector{Float64}, Vector{Float64}, SciMLBase.NullParameters, LinearSolve.DefaultLinearSolver, LinearSolve.DefaultLinearSolverInit{LinearAlgebra.LU{Float64, Matrix{Float64}, Vector{Int64}}, LinearAlgebra.QRCompactWY{Float64, Matrix{Float64}, Matrix{Float64}}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, LinearAlgebra.LU{Float64, Matrix{Float64}, Vector{Int64}}, Tuple{LinearAlgebra.LU{Float64, Matrix{Float64}, Vector{Int64}}, Vector{Int64}}, Nothing, Nothing, Nothing, LinearAlgebra.SVD{Float64, Float64, Matrix{Float64}, Vector{Float64}}, LinearAlgebra.Cholesky{Float64, Matrix{Float64}}, LinearAlgebra.Cholesky{Float64, Matrix{Float64}}, Tuple{LinearAlgebra.LU{Float64, Matrix{Float64}, Vector{Int32}}, Base.RefValue{Int32}}, Tuple{LinearAlgebra.LU{Float64, Matrix{Float64}, Vector{Int64}}, Base.RefValue{Int64}}, LinearAlgebra.QRPivoted{Float64, Matrix{Float64}, Vector{Float64}, Vector{Int64}}, Nothing, Nothing}, IdentityOperator, IdentityOperator, Float64, Bool, LinearSolve.LinearSolveAdjoint{Missing}}, Nothing, Nothing, Nothing, typeof(NonlinearSolve.DEFAULT_PRECS)}, Nothing, Nothing, Nothing}, LineSearch.LineSearchesJLCache{NonlinearFunction{true, SciMLBase.FullSpecialize, OrdinaryDiffEqNonlinearSolve.var"#_initialize_dae!##30#_initialize_dae!##31"{ODEFunction{true, SciMLBase.FullSpecialize, Function, SparseArrays.SparseMatrixCSC{Float64, Int64}, Nothing, Function, Function, Nothing, Nothing, Matrix{Float64}, Matrix{Float64}, Nothing, Nothing, Nothing, Nothing, Function, Nothing, TransformedIRODESystem, Nothing, Nothing}, Type{ForwardDiff.Dual}, Bool, PreallocationTools.DiffCache{Vector{Float64}, Vector{Float64}}, PreallocationTools.DiffCache{Vector{Float64}, Vector{Float64}}, Vector{Float64}, Vector{Bool}, Float64, Vector{Bool}, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Matrix{Float64}, Matrix{Float64}, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing, Nothing}, Nothing, LineSearch.var"#64#65"{typeof(+), typeof(*), SciMLBase.NLStats}, LineSearch.var"#66#67"{typeof(+), typeof(*), SciMLBase.NLStats}, LineSearch.var"#68#69"{typeof(+), typeof(*), SciMLBase.NLStats}, LineSearches.BackTracking{Float64, Int64}, Float64, Float64, LineSearch.var"#5#6", Vector{Float64}, Vector{Float64}, SciMLBase.NLStats, LineSearch.LineSearchesJL{LineSearches.BackTracking{Float64, Int64}, Bool, Nothing}}, Nothing, Nothing, Nothing, DiffEqBase.NonlinearTerminationModeCache{false, AbsSafeBestTerminationMode{:Inf, Int64, Base.Fix1{typeof(maximum), typeof(abs)}, Nothing, Int64, Float64}, SciMLBase.ReturnCode.T, Vector{Float64}, Float64, Float64, Float64, Float64, Vector{Float64}, Nothing, Nothing, Vector{Float64}, Int64, Vector{Float64}}, NonlinearSolve.NonlinearSolveTrace{false, false, NonlinearSolve.TraceMinimal, Nothing, NonlinearProblem{SubArray{Float64, 1, Vector{Float64}, Tuple{Vector{Int64}}, false}, true, Nothing, NonlinearFunction{true, SciMLBase.FullSpecialize, OrdinaryDiffEqNonlinearSolve.var"#_initialize_dae!##30#_initialize_dae!##31"{ODEFunction{true, SciMLBase.FullSpecialize, Function, SparseArrays.SparseMatrixCSC{Float64, Int64}, Nothing, Function, Function, Nothing, Nothing, Matrix{Float64}, Matrix{Float64}, Nothing, Nothing, Nothing, Nothing, Function, Nothing, TransformedIRODESystem, Nothing, Nothing}, Type{ForwardDiff.Dual}, Bool, PreallocationTools.DiffCache{Vector{Float64}, Vector{Float64}}, PreallocationTools.DiffCache{Vector{Float64}, Vector{Float64}}, Vector{Float64}, Vector{Bool}, Float64, Vector{Bool}, Nothing}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Matrix{Float64}, Matrix{Float64}, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED_NO_TIME), Nothing, Nothing, Nothing, Nothing}, @Kwargs{}, SciMLBase.StandardNonlinearProblem}}, @Kwargs{verbose::Bool}}; recompute_jacobian::Nothing, kwargs::@Kwargs{})
  @ NonlinearSolve ~/.julia/packages/NonlinearSolve/sBl1H/src/core/generalized_first_order.jl:276

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants