[Ipopt] Re： A small bug
八重雾中渡
darknesswind at qq.com
Tue Nov 12 22:17:15 EST 2013
Hi,
it is all right if you don't open the assert in debug version.
In release version, no one will initialize the memory of the
member "homogeneous_" in DenseVector if the DenseVector
is uninitialized, so the issue in my first mail will happen.
I don't use any interface and I think the difference
between 3.11.1 and 3.11.5 is not important.
List of options:
Name Value # times used
accept_every_trial_step = no 1
acceptable_compl_inf_tol = 1e-006 1
acceptable_constr_viol_tol = 1e-006 1
acceptable_obj_change_tol = 1e+020 1
acceptable_tol = 0.0001 1
bound_mult_init_method = mu-based 1
bound_relax_factor = 0 2
compl_inf_tol = 1e-008 2
constr_viol_tol = 1e-008 2
diverging_iterates_tol = 1e+020 1
dual_inf_tol = 1e-008 1
file_print_level = 6 1
hessian_approximation = limited-memory 4
max_cpu_time = 1.79769e+308 1
max_iter = 2147483647 1
max_soc = 4 1
mu_max = 1e+020 1
mu_max_fact = 1e+008 1
mu_min = 1e-020 1
mu_oracle = quality-function 2
mu_strategy = adaptive 2
nlp_lower_bound_inf = -2e+024 1
nlp_scaling_method = gradient-based 1
nlp_upper_bound_inf = 2e+024 1
obj_scaling_factor = -1 1
output_file = ipopt.out 1
tol = 1e-006 2
watchdog_shortened_iter_trigger = 10 1
watchdog_trial_iter_max = 3 1
This is Ipopt version 3.11.1, running with linear solver mumps.
Number of nonzeros in equality constraint Jacobian...: 1
Number of nonzeros in inequality constraint Jacobian.: 0
Number of nonzeros in Lagrangian Hessian.............: 0
Hessian approximation will be done in the space of all 1 x variables.
Scaling parameter for objective function = 1.000000e+000
objective scaling factor = -1
No x scaling provided
No c scaling provided
No d scaling provided
Initial values of x sufficiently inside the bounds.
Initial values of s sufficiently inside the bounds.
Total number of variables............................: 1
variables with only lower bounds: 0
variables with lower and upper bounds: 0
variables with only upper bounds: 0
Total number of equality constraints.................: 1
Total number of inequality constraints...............: 0
inequality constraints with only lower bounds: 0
inequality constraints with lower and upper bounds: 0
inequality constraints with only upper bounds: 0
**************************************************
*** Summary of Iteration: 0:
**************************************************
iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
0 0.0000000e+000 0.00e+000 0.00e+000 0.0 0.00e+000 - 0.00e+000 0.00e+000 0 s
**************************************************
*** Beginning Iteration 0 from the following point:
**************************************************
Current barrier parameter mu = 1.0000000000000000e+000
Current fraction-to-the-boundary parameter tau = 0.0000000000000000e+000
||curr_x||_inf = 0.0000000000000000e+000
||curr_s||_inf = 0.0000000000000000e+000
||curr_y_c||_inf = 0.0000000000000000e+000
||curr_y_d||_inf = 0.0000000000000000e+000
||curr_z_L||_inf = 0.0000000000000000e+000
||curr_z_U||_inf = 0.0000000000000000e+000
||curr_v_L||_inf = 0.0000000000000000e+000
||curr_v_U||_inf = 0.0000000000000000e+000
***Current NLP Values for Iteration 0:
(scaled) (unscaled)
Objective...............: -0.0000000000000000e+000 0.0000000000000000e+000
Dual infeasibility......: 0.0000000000000000e+000 0.0000000000000000e+000
Constraint violation....: 0.0000000000000000e+000 0.0000000000000000e+000
Complementarity.........: 0.0000000000000000e+000 -0.0000000000000000e+000
Overall NLP error.......: 0.0000000000000000e+000 -0.0000000000000000e+000
MUMPS used permuting_scaling 5 and pivot_order 2.
scaling will be 77.
Number of doubles for MUMPS to hold factorization (INFO(9)) = 4
Number of integers for MUMPS to hold factorization (INFO(10)) = 16
Factorization successful.
Number of Iterations....: 0
(scaled) (unscaled)
Objective...............: -0.0000000000000000e+000 0.0000000000000000e+000
Dual infeasibility......: 0.0000000000000000e+000 0.0000000000000000e+000
Constraint violation....: 0.0000000000000000e+000 0.0000000000000000e+000
Complementarity.........: 0.0000000000000000e+000 -0.0000000000000000e+000
Overall NLP error.......: 0.0000000000000000e+000 -0.0000000000000000e+000
Number of objective function evaluations = 1
Number of objective gradient evaluations = 1
Number of equality constraint evaluations = 1
Number of inequality constraint evaluations = 0
Number of equality constraint Jacobian evaluations = 1
Number of inequality constraint Jacobian evaluations = 0
Number of Lagrangian Hessian evaluations = 0
Total CPU secs in IPOPT (w/o function evaluations) = 0.026
Total CPU secs in NLP function evaluations = 0.007
EXIT: Optimal Solution Found.
>------------------ 原始邮件 ------------------
>发件人: "Stefan Vigerske";<stefan at math.hu-berlin.de>;
>发送时间: 2013年11月12日(星期二) 晚上6:35
>收件人: "八重雾中渡"<darknesswind at qq.com>;
>抄送: "ipopt"<ipopt at list.coin-or.org>;
>主题: Re: [Ipopt] A small bug
>
>Hi,
>
>sorry, I can't reproduce this.
>If I run Ipopt 3.11 (current stable branch, Linux 64bit) through the
>GAMS interface on your instance,
> Variables x1, x2, x3, y;
> Equations obj, e1, e2;
> obj.. y =e= x1 * x2 + eps*x3;
> e1.. x1 * x2 =e= x3;
> e2.. x3 =e= 0;
> x1.fx = 0; x2.fx = 0;
> model m / all /;
> solve m min y using nlp;
>
>then I get
>
>
>List of user-set options:
>
> Name Value used
> bound_mult_init_method = mu-based yes
>
>******************************************************************************
>This program contains Ipopt, a library for large-scale nonlinear
>optimization.
> Ipopt is released as open source code under the Eclipse Public License
>(EPL).
> For more information visit http://projects.coin-or.org/Ipopt
>******************************************************************************
>
>This is Ipopt version 3.11, running with linear solver ma27.
>
>Too few degrees of freedom (n_x = 1, n_c = 2).
> Trying fixed_variable_treatment = RELAX_BOUNDS
>
>Number of nonzeros in equality constraint Jacobian...: 4
>Number of nonzeros in inequality constraint Jacobian.: 0
>Number of nonzeros in Lagrangian Hessian.............: 1
>
>Total number of variables............................: 3
> variables with only lower bounds: 0
> variables with lower and upper bounds: 2
> variables with only upper bounds: 0
>Total number of equality constraints.................: 2
>Total number of inequality constraints...............: 0
> inequality constraints with only lower bounds: 0
> inequality constraints with lower and upper bounds: 0
> inequality constraints with only upper bounds: 0
>
>iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du
>alpha_pr ls
> 0 0.0000000e+00 0.00e+00 0.00e+00 0.0 0.00e+00 - 0.00e+00
>0.00e+00 0
> 1 0.0000000e+00 0.00e+00 0.00e+00 -7.0 0.00e+00 - 1.00e+00
>1.00e+00 0
>
>Number of Iterations....: 1
>
> (scaled) (unscaled)
>Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00
>Dual infeasibility......: 0.0000000000000000e+00 0.0000000000000000e+00
>Constraint violation....: 0.0000000000000000e+00 0.0000000000000000e+00
>Complementarity.........: 1.0000000000000001e-07 1.0000000000000001e-07
>Overall NLP error.......: 1.0000000000000000e-08 1.0000000000000001e-07
>
>
>Number of objective function evaluations = 2
>Number of objective gradient evaluations = 2
>Number of equality constraint evaluations = 2
>Number of inequality constraint evaluations = 0
>Number of equality constraint Jacobian evaluations = 2
>Number of inequality constraint Jacobian evaluations = 0
>Number of Lagrangian Hessian evaluations = 1
>Total CPU secs in IPOPT (w/o function evaluations) = 2.637
>Total CPU secs in NLP function evaluations = 0.052
>
>EXIT: Optimal Solution Found.
>
>
>
>And this is under valgrind.
>
>Stefan
>
>On 11/11/2013 04:16 AM, 八重雾中渡 wrote:
>> I am very sorry, I had made a mistake on describing the problem.
>> The problem we actually used is difference form the user input.
>>
>> Here is the problem to run the solver:
>> y = x1 * x2 + 0 * x3
>> subject to:
>> x1 * x2 - x3 = 0
>> x3 = 0
>>
>> x1, x2 = 0; x3: unbound
>>
>> the Ipopt version is 3.11.1
>> bound_mult_init_method = mu-based
>>
>> ------------------ Original ------------------
>> From: "Stefan Vigerske";<stefan at math.hu-berlin.de>;
>> Date: Sun, Nov 10, 2013 00:48 AM
>> To: "八重雾中渡"<darknesswind at qq.com>;
>> Cc: "ipopt"<ipopt at list.coin-or.org>;
>> Subject: Re: [Ipopt] A small bug
>>
>> Hi,
>>
>> I cannot reproduce this issue.
>> If all variables are fixed, the code should not even get to the place
>> you show in your stacktrace.
>> In DefaultIterateInitializer::SetInitialIterates(), the call to
>> IpData().InitializeDataStructures() just at the beginning (line 194)
>> should throw an exception, so that it doesn't get to line 278
>> (iterates->z_L_NonConst()->ElementWiseDivide(*IpCq().trial_slack_x_L())).
>>
>> The exception is thrown by IpTNLPAdapter.cpp:684,
>>
>> if (status == SUCCESS) {
>> jnlst_->Printf(J_WARNING, J_INITIALIZATION,
>> "All variables are fixed and constraint
>> violation %e\n is below tolerance %e. Declaring success.\n", max_viol,
>> tol_);
>>
>> and catched again in IpIpoptApplication.cpp:1048 (end of
>> IpoptApplication::call_optimize()).
>>
>> Can you specify more which Ipopt version you are using and which interface?
>>
>> Stefan
>>
>> On 11/08/2013 08:48 AM, darknesswind wrote:
>>> When I run the solver on a problem with all fixed variables, I found the DenseVector "ip_data_->curr()->z_L()" is uninitialized in function IpoptCalculatedQuantities::trial_slack_x_L.It may cause a crash in release version because of access violation.
>>>
>>> The problem is:
>>> y = x1 * x2
>>> subject to:
>>> x1 * x2 = 0
>>> x1 = 0
>>> x2 = 0
>>>
>>> Here is the call stack: The dense_x->homogeneous_ equal to false but the dense_x->values_ is null.
>>>
>>>> ipopt.dll!Ipopt::DenseVector::ElementWiseDivideImpl(const Ipopt::Vector & x) Line 240 C++
>>> ipopt.dll!Ipopt::Vector::ElementWiseDivide(const Ipopt::Vector & x) Line 602 + 0x13 bytes C++
>>> ipopt.dll!Ipopt::IpoptCalculatedQuantities::CalculateSafeSlack(Ipopt::SmartPtr<Ipopt::Vector> & slack, const Ipopt::SmartPtr<Ipopt::Vector const > & bound, const Ipopt::SmartPtr<Ipopt::Vector const > & curr_point, const Ipopt::SmartPtr<Ipopt::Vector const > & multiplier) Line 481 C++
>>> ipopt.dll!Ipopt::IpoptCalculatedQuantities::trial_slack_x_L() Line 365 + 0x5b bytes C++
>>> ipopt.dll!Ipopt::DefaultIterateInitializer::SetInitialIterates() Line 278 + 0x16 bytes C++
>>> ipopt.dll!Ipopt::IpoptAlgorithm::InitializeIterates() Line 545 + 0x26 bytes C++
>>> ipopt.dll!Ipopt::IpoptAlgorithm::Optimize(bool isResto) Line 274 C++
>>> ipopt.dll!Ipopt::IpoptApplication::call_optimize() Line 860 + 0xd bytes C++
>>> ipopt.dll!Ipopt::IpoptApplication::OptimizeNLP(const Ipopt::SmartPtr<Ipopt::NLP> & nlp, Ipopt::SmartPtr<Ipopt::AlgorithmBuilder> & alg_builder) Line 754 + 0x8 bytes C++
>>> ipopt.dll!Ipopt::IpoptApplication::OptimizeNLP(const Ipopt::SmartPtr<Ipopt::NLP> & nlp) Line 717 + 0x17 bytes C++
>>> ipopt.dll!Ipopt::IpoptApplication::OptimizeTNLP(const Ipopt::SmartPtr<Ipopt::TNLP> & tnlp) Line 696 + 0x16 bytes C++
>>>
>>> _______________________________________________
>>> Ipopt mailing list
>>> Ipopt at list.coin-or.org
>>> http://list.coin-or.org/mailman/listinfo/ipopt
>>>
>>
>> .
>>
>
>.
More information about the Ipopt
mailing list