[Ipopt] Release/Debug mode

Stefan Vigerske stefan at math.hu-berlin.de
Thu Apr 12 23:32:13 EDT 2012


Hi,

a difference in the 13th digit of a floating point number could be due 
to different roundings between different runs.
Maybe some compiler option need to be set to make the outcome of 
floating point operations better reproducible (even though a little bit 
slower). That would also explain why it does not happen in debug mode, 
since there aggressive optimizations are often disabled.

I don't know exactly which options where used to create the DLL's, maybe 
Marcel can comment on that.

Stefan

> Hi Stefan,
>
> I am not using AMPL interface and I don't have any ipopt.opt file. Anyway,
> if I execute the program in debug mode, both results are equals. The problem
> is only in release mode.
> I have tried with a print_level of 12, and the differences between both
> starts in the first iteration.
> In my desktop:
>
> ...
> GenTMatrix "jac_d" of dimension 0 by 855 with 0 nonzero elements:
>
> LowRankUpdateSymMatrix "W" with 855 rows and columns:
>    This matrix has reduced diagonal.
>    Diagonal matrix:
>    DenseVector "W-D" with 855 elements:
>    Homogeneous vector, all elements have value 8.9891357029881096e-007
>    MultiVectorMatrix V for positive update:
>
>    MultiVectorMatrix "W-V" with 1 columns:
>      DenseVector "W-V[ 0]" with 855 elements:
>      W-V[ 0][    1]=-2.7100061676842504e-013
>      W-V[ 0][    2]=2.9424613834039645e-002
>      W-V[ 0][    3]=5.0208432823492230e-002
> 	...
>
> And in C:\:
> ...
> GenTMatrix "jac_d" of dimension 0 by 855 with 0 nonzero elements:
>
> LowRankUpdateSymMatrix "W" with 855 rows and columns:
>    This matrix has reduced diagonal.
>    Diagonal matrix:
>    DenseVector "W-D" with 855 elements:
>    Homogeneous vector, all elements have value 8.9891357029882229e-007
>    MultiVectorMatrix V for positive update:
>
>    MultiVectorMatrix "W-V" with 1 columns:
>      DenseVector "W-V[ 0]" with 855 elements:
>      W-V[ 0][    1]=-2.7100061676842332e-013
>      W-V[ 0][    2]=2.9424613834039458e-002
>      W-V[ 0][    3]=5.0208432823491918e-002
> 	...
>
> As you can see, the first difference is the value of the Homogeneous vector.
> Do you have any idea??
> Thank you in advance,
>
> Raquel
>
> -----Mensaje original-----
> De: Stefan Vigerske [mailto:stefan at math.hu-berlin.de]
> Enviado el: jueves, 12 de abril de 2012 6:23
> Para: Raquel Guardia
> CC: ipopt at list.coin-or.org
> Asunto: Re: [Ipopt] Release/Debug mode
>
> Hi,
>
> an easy guess is that you have an ipopt.opt file in your desktop, but
> not in C:\. In the AMPL interface, an ipopt.opt file is read by default,
> if available.
>
> Another guess is that the environment is a bit different when executing
> in C:\, e.g., the environment variable that holds the working path has a
> different value. Maybe this leads to a different memory usage and then
> something in Ipopt behaves differently (e.g., due to sorting something
> by pointer adresses). But this is very unlikely.
>
> You could rerun with a high print_level (10, or so) and try to see from
> which point on results are different.
>
> Stefan
>
>> Hi all,
>>
>> I am trying to solve a NLP problem with IPOPT (865 variables and 530
>> constraints). I am using the the binary (win32) DLL.
>>
>> If I run the program in debug mode, all is right. The problem comes when
>> I try to execute it in release mode. In release, IPOPT gives me the
>> optimal solution without problems, but this solution differs depending
>> on the place where it's executed.
>>
>> For example, if I execute the code in my desktop, IPOPT finds the
>> optimal solution in 193 iterations:
>>
>> iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
>>
>> 0 1.8990519e+003 2.53e+006 8.73e+001 0.0 0.00e+000 - 0.00e+000 0.00e+000 0
>>
>> 1 8.0615445e+004 2.53e+006 1.14e+002 5.5 1.68e+006 - 3.45e-008 1.52e-006f
> 1
>>
>> 2 8.4984098e+004 2.53e+006 1.14e+002 3.7 1.63e+006 - 9.21e-007 3.44e-006f
> 1
>>
>> 3 1.5133245e+005 2.53e+006 2.79e+002 4.3 1.68e+006 - 2.15e-006 1.32e-005f
> 1
>>
>> 4 2.8394936e+005 2.53e+006 2.94e+002 3.9 1.69e+006 - 1.38e-005 3.96e-005f
> 1
>>
>> 5 2.9204821e+005 2.53e+006 2.93e+002 4.8 1.01e+006 - 2.55e-006 2.71e-006f
> 1
>>
>> 6 8.2596406e+008 2.51e+006 1.02e+006 6.1 1.89e+006 - 1.72e-006 8.16e-003f
> 1
>>
>> .
>>
>> Number of Iterations....: 193
>>
>> (scaled) (unscaled)
>>
>> Objective...............: 3.1208657806952629e+005 6.1431434113783743e+006
>>
>> Dual infeasibility......: 3.5501585875953514e-009 6.9881676654085783e-008
>>
>> Constraint violation....: 4.6566128730773926e-010 4.6566128730773926e-010
>>
>> Complementarity.........: 1.0000000696763270e-011 1.9684101371515826e-010
>>
>> Overall NLP error.......: 3.5501585875953514e-009 6.9881676654085783e-008
>>
>> Number of objective function evaluations = 355
>>
>> Number of objective gradient evaluations = 180
>>
>> Number of equality constraint evaluations = 355
>>
>> Number of inequality constraint evaluations = 0
>>
>> Number of equality constraint Jacobian evaluations = 196
>>
>> Number of inequality constraint Jacobian evaluations = 0
>>
>> Number of Lagrangian Hessian evaluations = 0
>>
>> Total CPU secs in IPOPT (w/o function evaluations) = 24.172
>>
>> Total CPU secs in NLP function evaluations = 48.125
>>
>> But if I execute the same code in C:/, the number of iterations and the
>> results are different:
>>
>> iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls
>>
>> 0 1.8990519e+003 2.53e+006 8.73e+001 0.0 0.00e+000 - 0.00e+000 0.00e+000 0
>>
>> 1 8.0615445e+004 2.53e+006 1.14e+002 5.5 1.68e+006 - 3.45e-008 1.52e-006f
> 1
>>
>> 2 8.4984098e+004 2.53e+006 1.14e+002 3.7 1.63e+006 - 9.21e-007 3.44e-006f
> 1
>>
>> 3 1.5133245e+005 2.53e+006 2.79e+002 4.3 1.68e+006 - 2.15e-006 1.32e-005f
> 1
>>
>> 4 2.8394985e+005 2.53e+006 2.94e+002 3.9 1.69e+006 - 1.38e-005 3.96e-005f
> 1
>>
>> 5 2.9204809e+005 2.53e+006 2.93e+002 4.8 1.01e+006 - 2.55e-006 2.71e-006f
> 1
>>
>> 6 8.2597073e+008 2.51e+006 1.02e+006 6.1 1.89e+006 - 1.73e-006 8.16e-003f
> 1
>>
>> .
>>
>> Number of Iterations....: 111
>>
>> (scaled) (unscaled)
>>
>> Objective...............: 3.1208657753133564e+005 6.1431434007845754e+006
>>
>> Dual infeasibility......: 9.7656250000000000e-004 1.9222753906250035e-002
>>
>> Constraint violation....: 9.9999999999999969e-009 9.9999999999999969e-009
>>
>> Complementarity.........: 1.1550769498483705e-011 2.2736650188510352e-010
>>
>> Overall NLP error.......: 9.9999999999999969e-009 1.9222753906250035e-002
>>
>> Is normal this behavior?
>>
>> I have the same problem with versions 3.9.2 and 3.10.1.
>>
>> Best regards and thank you in advance
>>
>> Raquel
>>
>>
>>
>> _______________________________________________
>> Ipopt mailing list
>> Ipopt at list.coin-or.org
>> http://list.coin-or.org/mailman/listinfo/ipopt
>
>



More information about the Ipopt mailing list