[Ipopt] Ipopt error while invoked through Bonmin
Ramesh, Ujwal (rameshul)
rameshul at mail.uc.edu
Wed Nov 5 12:24:49 EST 2014
Hi All,
I am using Bonmin to solve an unconstrained MINLP. While doing so, I am facing an isssue while Bonmin invokes Ipopt. Please do excuse me for the log detailed mail below.
Please find the details below:
Let me first a give a little background.
I was originally using wnnlp (Will Naylor Non linear solver) to solve my non linear problem. As I wanted to include Mixed integer variables, I am migrating my problem to Bonmin.
To start with I am not including my mixed integer variables and setting up Bonmin to run the nonlinear part like in wnnlp. (I have reused functions from my wnnlp and hence I know that there are no errors in calculating objective and gradients).
Also, I am first trying to solve an unconstrained optimization problem and eventually include constraints.
I am looking at ~/Bonmin-1.7/Bonmin/examples/CppExample to build my application.
Likewise, The below are the snippets of my code for an unconstrained NLP minimization ( So basically the present working part for my Bonmin is just Ipopt) .
The belew describes the hierarchy I have used to interface the solver:
using namespace Ipopt;
using namespace Bonmin;
class Design : public TMINLP {
private:
...
..
The below is the get_nlp_info subroutine for my unconstrained problem
bool Design::get_nlp_info(Index& n, Index&m, Index& nnz_jac_g,Index& nnz_h_lag, TNLP::IndexStyleEnum& index_style){
std::vector<Cell *> cellsToSolve;
getNLPCellsToSolveNew ((*this),cellsToSolve);
int size = 2*(cellsToSolve.size());
n = size;
m=0;
nnz_jac_g = 0;
nnz_h_lag = 0;
index_style = TNLP::FORTRAN_STYLE;
return true;
}
The below are the functions for constraints. As I am trying the unconstrained optimization first, i am not initializing anything: ( I need more insight here as to whether this could be the cause of my memory leak)
bool Design::eval_g(Index n, const Number* x, bool new_x, Index m, Number* g){return true;}
bool Design::eval_jac_g(Index n, const Number* x, bool new_x,
Index m, Index nele_jac, Index* iRow, Index *jCol,
Number* values){return true;}
bool Design::eval_h(Index n, const Number* x, bool new_x,
Number obj_factor, Index m, const Number* lambda,
bool new_lambda, Index nele_hess, Index* iRow,
Index* jCol, Number* values){return true;}
The below snippet is of the error and valgrind report:
Cbc3007W No integer variables - nothing to do
******************************************************************************
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
******************************************************************************
NLP0014I 3 FAILED 1.2952534e+08 3000 291.55422
Problem status: 5
Objective value: 1.79769e+308
*** glibc detected *** ./../../code/the_exec-g: double free or corruption (out): 0x00007fff63b1f3d0 ***
and the valgrind report has the kind of errors like below:
==26498== Conditional jump or move depends on uninitialised value(s)
==26498== at 0x5F2E414: Ipopt::OptimalityErrorConvergenceCheck::CurrentIsAcceptable() (in /usr/lib/libipopt.so.0)
==26498== by 0x5ED04E1: Ipopt::BacktrackingLineSearch::FindAcceptableTrialPoint() (in /usr/lib/libipopt.so.0)
==26498== by 0x5EEC8C0: Ipopt::IpoptAlgorithm::Optimize(bool) (in /usr/lib/libipopt.so.0)
==26498== by 0x5E7A1F3: Ipopt::IpoptApplication::call_optimize() (in /usr/lib/libipopt.so.0)
==26498== by 0x5E7DF6C: Ipopt::IpoptApplication::OptimizeNLP(Ipopt::SmartPtr<Ipopt::NLP> const&, Ipopt::SmartPtr<Ipopt::AlgorithmBuilder>&) (in /usr/lib/libipopt.so.0)
==26498== by 0x5E7EF17: Ipopt::IpoptApplication::OptimizeNLP(Ipopt::SmartPtr<Ipopt::NLP> const&) (in /usr/lib/libipopt.so.0)
==26498== by 0x5E79D59: Ipopt::IpoptApplication::OptimizeTNLP(Ipopt::SmartPtr<Ipopt::TNLP> const&) (in /usr/lib/libipopt.so.0)
==26498== by 0x4EF5E84: Bonmin::IpoptSolver::OptimizeTNLP(Ipopt::SmartPtr<Ipopt::TNLP> const&) (in /usr/lib/libbonmin.so.0)
==26498== by 0x4EDA733: Bonmin::OsiTMINLPInterface::solveAndCheckErrors(bool, bool, char const*) (in /usr/lib/libbonmin.so.0)
==26498== by 0x4EDC126: Bonmin::OsiTMINLPInterface::initialSolve(char const*) (in /usr/lib/libbonmin.so.0)
==26498== by 0x51E82D6: CbcModel::initialSolve() (in /usr/lib/libCbc.so.0)
==26498== by 0x4E6FE69: Bonmin::Bab::branchAndBound(Bonmin::BabSetupBase&) (in /usr/lib/libbonmin.so.0)
==26498== Uninitialised value was created by a stack allocation
==26498== at 0x4690E1: Design::eval_grad_f(int, double const*, bool, double*) (DesignTMINLP.cxx:185)
==26498==
==26498== Use of uninitialised value of size 8
==26498== at 0x5FC6D10: Ipopt::DenseVector::AmaxImpl() const (in /usr/lib/libipopt.so.0)
==26498== by 0x5ECCBF1: Ipopt::BacktrackingLineSearch::DetectTinyStep() (in /usr/lib/libipopt.so.0)
==26498== by 0x5ED0575: Ipopt::BacktrackingLineSearch::FindAcceptableTrialPoint() (in /usr/lib/libipopt.so.0)
==26498== by 0x5EEC8C0: Ipopt::IpoptAlgorithm::Optimize(bool) (in /usr/lib/libipopt.so.0)
==26498== by 0x5E7A1F3: Ipopt::IpoptApplication::call_optimize() (in /usr/lib/libipopt.so.0)
==26498== by 0x5E7DF6C: Ipopt::IpoptApplication::OptimizeNLP(Ipopt::SmartPtr<Ipopt::NLP> const&, Ipopt::SmartPtr<Ipopt::AlgorithmBuilder>&) (in /usr/lib/libipopt.so.0)
==26498== by 0x5E7EF17: Ipopt::IpoptApplication::OptimizeNLP(Ipopt::SmartPtr<Ipopt::NLP> const&) (in /usr/lib/libipopt.so.0)
==26498== by 0x5E79D59: Ipopt::IpoptApplication::OptimizeTNLP(Ipopt::SmartPtr<Ipopt::TNLP> const&) (in /usr/lib/libipopt.so.0)
==26498== by 0x4EF5E84: Bonmin::IpoptSolver::OptimizeTNLP(Ipopt::SmartPtr<Ipopt::TNLP> const&) (in /usr/lib/libbonmin.so.0)
==26498== by 0x4EDA733: Bonmin::OsiTMINLPInterface::solveAndCheckErrors(bool, bool, char const*) (in /usr/lib/libbonmin.so.0)
==26498== by 0x4EDC126: Bonmin::OsiTMINLPInterface::initialSolve(char const*) (in /usr/lib/libbonmin.so.0)
==26498== by 0x51E82D6: CbcModel::initialSolve() (in /usr/lib/libCbc.so.0)
==26498== Uninitialised value was created by a stack allocation
==26498== at 0x4690E1: Design::eval_grad_f(int, double const*, bool, double*) (DesignTMINLP.cxx:185)
As per the above report, the uninitialized value is created by the function eval_grad_f() , but I am using the same function for wnnlp and it works just fine. I tried stepping into the program using gdb but as I am interfacing using *.so files, gdb is not letting me do it.
Any inputs will definitely help.
Thanks in advance.
Ujwal Ramesh
Graduate Student,
University Of Cincinnati
Ph: +1-513-302-4771
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/ipopt/attachments/20141105/ce1dd075/attachment.html>
More information about the Ipopt
mailing list