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

Sol file output #29

Closed
odow opened this issue Oct 17, 2024 · 4 comments
Closed

Sol file output #29

odow opened this issue Oct 17, 2024 · 4 comments
Assignees

Comments

@odow
Copy link
Contributor

odow commented Oct 17, 2024

Dumb question: how do I write a sol file?

I tried print_solution yes but no file is created

@odow
Copy link
Contributor Author

odow commented Oct 17, 2024

Oh, print_solution literally prints the solution as space separated values in the log.

curl https://raw.githubusercontent.com/cvanaret/Uno/refs/heads/main/uno.options -o uno.options
sed -i '' 's/subproblem QP/subproblem primal_dual_interior_point/g' uno.options
sed -i '' 's/linear_solver MA57/linear_solver MUMPS/g' uno.options
sed -i '' 's/globalization_mechanism TR/globalization_mechanism LS/g' uno.options
sed -i '' 's/print_solution no/print_solution yes/g' uno.options
julia> function main_uno()
           model = Model(() -> AmplNLWriter.Optimizer(Uno_jll.amplexe; flags = String[]))
           @variable(model, x[1:3])
           @objective(model, Min, sum((x[i] - i)^2 for i in 1:3))
           set_start_value.(x, 1:3)
           optimize!(model)
           solution_summary(model)
       end
main_uno (generic function with 1 method)

julia> main_uno()
Problem /var/folders/bg/dzq_hhvx1dxgy6gb5510pxj80000gn/T/jl_2BzD5t/model.nl_equalityconstrained_boundrelaxed
3 variables, 0 constraints

Options:
- LS_backtracking_ratio = 0.5
- LS_min_step_length = 1e-12
- LS_scale_duals_with_step_length = yes
- armijo_decrease_fraction = 1e-4
- armijo_tolerance = 1e-9
- barrier_damping_factor = 1e-5
- barrier_default_multiplier = 1
- barrier_initial_parameter = 0.1
- barrier_k_epsilon = 10
- barrier_k_mu = 0.2
- barrier_k_sigma = 1e10
- barrier_push_variable_to_interior_k1 = 1e-2
- barrier_push_variable_to_interior_k2 = 1e-2
- barrier_regularization_exponent = 0.25
- barrier_small_direction_factor = 10.
- barrier_tau_min = 0.99
- barrier_theta_mu = 1.5
- barrier_update_fraction = 10
- constraint_relaxation_strategy = feasibility_restoration
- dual_regularization_fraction = 1e-8
- filter_beta = 0.999
- filter_capacity = 50
- filter_fact = 1.25
- filter_gamma = 0.001
- filter_type = standard
- filter_ubd = 1e2
- globalization_mechanism = LS
- globalization_strategy = fletcher_filter_method
- l1_constraint_violation_coefficient = 1
- least_square_multiplier_max_norm = 1e3
- linear_solver = MUMPS
- logger = INFO
- loose_tolerance = 1e-6
- loose_tolerance_consecutive_iteration_threshold = 15
- max_iterations = 2000
- primal_regularization_decrease_factor = 3.
- primal_regularization_fast_increase_factor = 100.
- primal_regularization_initial_factor = 1e-4
- primal_regularization_lb = 1e-20
- primal_regularization_slow_increase_factor = 8.
- progress_norm = L1
- protect_actual_reduction_against_roundoff = no
- regularization_failure_threshold = 1e40
- residual_norm = INF
- residual_scaling_threshold = 100.
- scale_functions = no
- sparse_format = COO
- statistics_LS_step_length_column_order = 10
- statistics_barrier_parameter_column_order = 8
- statistics_complementarity_column_order = 105
- statistics_major_column_order = 1
- statistics_minor_column_order = 2
- statistics_objective_column_order = 100
- statistics_print_header_every_iterations = 15
- statistics_regularization_column_order = 21
- statistics_restoration_phase_column_order = 20
- statistics_stationarity_column_order = 104
- statistics_status_column_order = 200
- statistics_step_norm_column_order = 31
- subproblem = primal_dual_interior_point
- switch_to_optimality_requires_linearized_feasibility = yes
- switching_delta = 0.999
- switching_infeasibility_exponent = 2
- threshold_unsuccessful_attempts = 8
- time_limit = inf
- tolerance = 1e-8
- unbounded_objective_threshold = -1e20
┌───────┬─────────┬────────────────┬─────────────┬───────┬────────────────┬──────────────┬─────────────┬──────────────┬─────────────────┬────────────────────────┐
│ iter  │ LS iter │ barrier param. │ step length │ phase │ regularization │ step norm    │ objective   │ stationarity │ complementarity │ status                 │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 0---           │ OPT   │ --000               │ initial point          │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 111e-091           │ OPT   │ 000000 primal step          │
└───────┴─────────┴────────────────┴─────────────┴───────┴────────────────┴──────────────┴─────────────┴──────────────┴─────────────────┴────────────────────────┘

Uno (LS feasibility_restoration fletcher_filter_method primal_dual_interior_point)
Thu Oct 17 15:40:25 2024
────────────────────────────────────────
Status:					Converged with feasible KKT point
Objective value:			0
Primal feasibility:			0
┌ Stationarity residual:		0
└ Complementarity residual:		0
┌ Feasibility stationarity residual:	0
└ Feasibility complementarity residual:	0
┌ Infeasibility measure:		0
│ Objective measure:			0
└ Auxiliary measure:			0
Primal solution:			1 2 3 
┌ Constraint multipliers:		
│ Lower bound multipliers:		0 0 0 
└ Upper bound multipliers:		0 0 0 
┌ Constraint feasibility multipliers:	
│ Lower bound feasibility multipliers:	0 0 0 
└ Upper bound feasibility multipliers:	0 0 0 
Objective multiplier:			1
CPU time:				0.001291s
Iterations:				1
Objective evaluations:			2
Constraints evaluations:		0
Objective gradient evaluations:		2
Jacobian evaluations:			0
Hessian evaluations:			1
Number of subproblems solved:		1

@cvanaret
Copy link
Owner

I will implement writing to the .sol file. Should that happen systematically or only when the -AMPL option is provided?

@cvanaret
Copy link
Owner

The *.sol file is now created (commit fb12109). At the moment, this happens when the option AMPL_write_solution_to_file is set to yes (which it is by default).

@odow
Copy link
Contributor Author

odow commented Oct 17, 2024

If they're using uno_ampl, they almost certainly want the .sol file. It isn't very useful otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants