<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none"><!--P{margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p><br>
</p>
<p>Hi All,</p>
<p><br>
</p>
<p>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.<br>
</p>
<p><br>
</p>
<p>Please find the details below:</p>
<p><br>
</p>
<span dir="ltr"><font color="black" face="Calibri,Arial,Helvetica,sans-serif" size="3"><span style="font-size:12pt;background-color:white;"><font face="Calibri,Arial,Helvetica,sans-serif">
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif">Let me first a give a little background.
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif">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. </font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif">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). <br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif">Also, I am first trying to solve an unconstrained optimization problem and eventually include constraints.</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><font face="Calibri,Arial,Helvetica,sans-serif">I am looking at
</font><font face="Courier New,monospace"> ~/Bonmin-1.7/Bonmin/examples/CppExample </font><font face="Calibri,Arial,Helvetica,sans-serif">to build my application. </font></font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><font face="Calibri,Arial,Helvetica,sans-serif">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) .</font></font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif">The belew describes the hierarchy I have used to interface the solver:</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><font face="Courier New,monospace">using namespace Ipopt;</font><font face="Courier New,monospace"><br>
using namespace Bonmin;</font><font face="Courier New,monospace"><br>
class Design : public TMINLP { </font><font face="Courier New,monospace"><br>
private:</font><font face="Courier New,monospace"><br>
</font></font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><font face="Courier New,monospace">...
</font></font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><font face="Courier New,monospace">..</font></font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif">The below is the get_nlp_info subroutine for my unconstrained problem</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><font face="Courier New,monospace">bool Design::get_nlp_info(Index& n, Index&m, Index& nnz_jac_g,Index& nnz_h_lag, TNLP::IndexStyleEnum& index_style){</font><br>
<font face="Courier New,monospace">std::vector<Cell *> cellsToSolve;</font><br>
<font face="Courier New,monospace">getNLPCellsToSolveNew ((*this),cellsToSolve);</font><br>
<font face="Courier New,monospace">int size = 2*(cellsToSolve.size());</font><br>
<font face="Courier New,monospace">n = size;</font><br>
<font face="Courier New,monospace">m=0;</font><br>
<font face="Courier New,monospace">nnz_jac_g = 0;</font><br>
<font face="Courier New,monospace">nnz_h_lag = 0;</font><br>
<font face="Courier New,monospace">index_style = TNLP::FORTRAN_STYLE;</font><br>
<font face="Courier New,monospace">return true;</font><br>
<font face="Courier New,monospace">}</font><br>
<br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif">The below are the functions for constraints. As I am trying the unconstrained optimization first, i am not initializing anything: (
<strong>I need more insight here as to whether this could be the cause of my memory leak</strong>)
<br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><font face="Courier New,monospace">bool Design::eval_g(Index n, const Number* x, bool new_x, Index m, Number* g){return true;}</font><font face="Courier New,monospace"><br>
</font><font face="Courier New,monospace"><br>
bool Design::eval_jac_g(Index n, const Number* x, bool new_x,</font><font face="Courier New,monospace"><br>
Index m, Index nele_jac, Index* iRow, Index *jCol,</font><font face="Courier New,monospace"><br>
Number* values){return true;}</font><font face="Courier New,monospace"><br>
</font><font face="Courier New,monospace"><br>
bool Design::eval_h(Index n, const Number* x, bool new_x,</font><font face="Courier New,monospace"><br>
Number obj_factor, Index m, const Number* lambda,</font><font face="Courier New,monospace"><br>
bool new_lambda, Index nele_hess, Index* iRow,</font><font face="Courier New,monospace"><br>
Index* jCol, Number* values){return true;}</font><font face="Courier New,monospace"><br>
</font><font face="Courier New,monospace"><br>
</font></font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><font face="Calibri,Arial,Helvetica,sans-serif">The below snippet is of the error and valgrind report:</font></font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><font face="Courier New,monospace">Cbc3007W No integer variables - nothing to do
</font><font face="Courier New,monospace"><br>
</font><font face="Courier New,monospace"><br>
******************************************************************************</font><font face="Courier New,monospace"><br>
This program contains Ipopt, a library for large-scale nonlinear optimization.</font><font face="Courier New,monospace"><br>
Ipopt is released as open source code under the Eclipse Public License (EPL).</font><font face="Courier New,monospace"><br>
For more information visit http://projects.coin-or.org/Ipopt</font><font face="Courier New,monospace"><br>
******************************************************************************</font></font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><font face="Courier New,monospace">NLP0014I 3 FAILED 1.2952534e+08 3000 291.55422</font><br>
<font face="Courier New,monospace">Problem status: 5</font><br>
<font face="Courier New,monospace">Objective value: 1.79769e+308</font><br>
<font face="Courier New,monospace">*** glibc detected *** ./../../code/the_exec-g: double free or corruption (out): 0x00007fff63b1f3d0 ***</font><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif">and the valgrind report has the kind of errors like below:</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><font face="Courier New,monospace">==26498== Conditional jump or move depends on uninitialised value(s)</font><br>
<font face="Courier New,monospace">==26498== at 0x5F2E414: Ipopt::OptimalityErrorConvergenceCheck::CurrentIsAcceptable() (in /usr/lib/libipopt.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x5ED04E1: Ipopt::BacktrackingLineSearch::FindAcceptableTrialPoint() (in /usr/lib/libipopt.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x5EEC8C0: Ipopt::IpoptAlgorithm::Optimize(bool) (in /usr/lib/libipopt.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x5E7A1F3: Ipopt::IpoptApplication::call_optimize() (in /usr/lib/libipopt.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x5E7DF6C: Ipopt::IpoptApplication::OptimizeNLP(Ipopt::SmartPtr<Ipopt::NLP> const&, Ipopt::SmartPtr<Ipopt::AlgorithmBuilder>&) (in /usr/lib/libipopt.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x5E7EF17: Ipopt::IpoptApplication::OptimizeNLP(Ipopt::SmartPtr<Ipopt::NLP> const&) (in /usr/lib/libipopt.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x5E79D59: Ipopt::IpoptApplication::OptimizeTNLP(Ipopt::SmartPtr<Ipopt::TNLP> const&) (in /usr/lib/libipopt.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x4EF5E84: Bonmin::IpoptSolver::OptimizeTNLP(Ipopt::SmartPtr<Ipopt::TNLP> const&) (in /usr/lib/libbonmin.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x4EDA733: Bonmin::OsiTMINLPInterface::solveAndCheckErrors(bool, bool, char const*) (in /usr/lib/libbonmin.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x4EDC126: Bonmin::OsiTMINLPInterface::initialSolve(char const*) (in /usr/lib/libbonmin.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x51E82D6: CbcModel::initialSolve() (in /usr/lib/libCbc.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x4E6FE69: Bonmin::Bab::branchAndBound(Bonmin::BabSetupBase&) (in /usr/lib/libbonmin.so.0)</font><br>
<font face="Courier New,monospace">==26498== Uninitialised value was created by a stack allocation</font><br>
<font face="Courier New,monospace">==26498== at 0x4690E1: Design::eval_grad_f(int, double const*, bool, double*) (DesignTMINLP.cxx:185)</font><br>
<font face="Courier New,monospace">==26498==</font><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><font face="Courier New,monospace">==26498== Use of uninitialised value of size 8</font><br>
<font face="Courier New,monospace">==26498== at 0x5FC6D10: Ipopt::DenseVector::AmaxImpl() const (in /usr/lib/libipopt.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x5ECCBF1: Ipopt::BacktrackingLineSearch::DetectTinyStep() (in /usr/lib/libipopt.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x5ED0575: Ipopt::BacktrackingLineSearch::FindAcceptableTrialPoint() (in /usr/lib/libipopt.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x5EEC8C0: Ipopt::IpoptAlgorithm::Optimize(bool) (in /usr/lib/libipopt.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x5E7A1F3: Ipopt::IpoptApplication::call_optimize() (in /usr/lib/libipopt.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x5E7DF6C: Ipopt::IpoptApplication::OptimizeNLP(Ipopt::SmartPtr<Ipopt::NLP> const&, Ipopt::SmartPtr<Ipopt::AlgorithmBuilder>&) (in /usr/lib/libipopt.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x5E7EF17: Ipopt::IpoptApplication::OptimizeNLP(Ipopt::SmartPtr<Ipopt::NLP> const&) (in /usr/lib/libipopt.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x5E79D59: Ipopt::IpoptApplication::OptimizeTNLP(Ipopt::SmartPtr<Ipopt::TNLP> const&) (in /usr/lib/libipopt.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x4EF5E84: Bonmin::IpoptSolver::OptimizeTNLP(Ipopt::SmartPtr<Ipopt::TNLP> const&) (in /usr/lib/libbonmin.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x4EDA733: Bonmin::OsiTMINLPInterface::solveAndCheckErrors(bool, bool, char const*) (in /usr/lib/libbonmin.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x4EDC126: Bonmin::OsiTMINLPInterface::initialSolve(char const*) (in /usr/lib/libbonmin.so.0)</font><br>
<font face="Courier New,monospace">==26498== by 0x51E82D6: CbcModel::initialSolve() (in /usr/lib/libCbc.so.0)</font><br>
<font face="Courier New,monospace">==26498== Uninitialised value was created by a stack allocation</font><br>
<font face="Courier New,monospace">==26498== at 0x4690E1: Design::eval_grad_f(int, double const*, bool, double*) (DesignTMINLP.cxx:185)</font><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif">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.<br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"> </font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif">Any inputs will definitely help.</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif">Thanks in advance.</font></div>
<div style="margin-top:0;margin-bottom:0;"><font face="Calibri,Arial,Helvetica,sans-serif"><br>
</font></div>
</font></span></font></span>
<p> <br>
</p>
<div id="Signature">
<div style="font-family:Tahoma; font-size:13px"><font face="Verdana" size="4">Ujwal Ramesh</font>
<div><font face="Verdana" size="2">Graduate Student,</font></div>
<div><font face="Verdana" size="2">University Of Cincinnati</font></div>
<div><font face="Verdana" size="2">Ph: +1-513-302-4771</font></div>
</div>
</div>
</div>
</body>
</html>