Skip to content
Merged
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
7 changes: 6 additions & 1 deletion ext/MadNLPSolverExt/solver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,12 @@ function DirectTrajOpt.set_options!(optimizer::AbstractOptimizer, options::MadNL
if name in ignored_options
continue
end
# TODO: allow internal defaults, i.e. do not set the internal options dict unless the user actually specified the associated opt
# `nothing` means "use MadNLP's own default" — don't overwrite the optimizer's
# internal dict in that case. Applies to the pass-through fields
# (linear_solver, array_type, kkt_system, cudss_ordering).
if value === nothing
continue
end
if name == :print_level
optimizer.options[name] = MadNLP.LogLevels(value)
elseif name == :hessian_approximation
Expand Down
7 changes: 7 additions & 0 deletions src/solvers/madnlp_solver/options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ export MadNLPOptions
print_level::Int = 3 # (MadNLP.TRACE::MadNLP.LogLevels = 1, ..., MadNLP.ERROR::MadNLP.LogLevels = 6)
hessian_approximation::String = "exact" # (exact = MadNLP.ExactHessian, compact_lbfgs = MadNLP.CompactLBFGS) # no other QN methods supported in conjunction with MadNLP.SparseCallback

# Pass-throughs consumed by MadNLP's MOI layer (not by MadNLP itself);
# leave as `nothing` to use MadNLP defaults. Only forwarded when non-nothing.
linear_solver::Any = nothing # e.g. MadNLPGPU.CUDSSSolver, MadNLP.LapackCPUSolver
array_type::Any = nothing # e.g. CUDA.CuArray for GPU
kkt_system::Any = nothing # e.g. MadNLP.SparseUnreducedKKTSystem
cudss_ordering::Any = nothing # e.g. MadNLPGPU.AMD_ORDERING

# # Only supported by DirectTrajOpt._solve, as an optional kwarg override of `hessian_approximation`;
# # `hessian_approximation = eval_hessian ? "exact" : "compact_lbfgs"`
# eval_hessian::Bool = true
Expand Down
Loading