<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">I'd try something along the lines of<br>
OMP_NUM_THREADS=1 matlab -singleCompThread<br>
when launching from the command line in linux to cover as many
options as possible.<br>
<br>
You can presumably monitor the number of threads being used, for
example I tend to use<br>
top -d 0.5<br>
<br>
Jonathan<br>
<br>
On 17/12/12 17:02, AliReza Khoshgoftar Monfared wrote:<br>
</div>
<blockquote
cite="mid:CABoSzTuCYUTEVEEFhgeQ-wD_YjBai65Bub8Ao+2Ya4gy+fZF6A@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<div dir="ltr"><br>
<div>Thanks Vivek and Jonathan,</div>
<div><br>
</div>
<div>I also suspect that this issue has something to do with
MATLAB (or settings of BLAS and LAPACK).</div>
<div>
<div>My original MATLAB code should be single-threaded, but I
am suspicious that when I call Ipopt(), which uses the
corresponding mex file, there might be multiple threads
involved.</div>
<div>Is there a way to force a single thread in MATLAB though?</div>
<div><br>
</div>
<div>Alireza</div>
<div><br>
</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Might
also be worth seeing if you can force everything to run<br>
single-threaded and seeing if that has any effect. Some
parallel<br>
algorithms will produce different results on different runs,
and even<br>
small changes in the descend direction can produce different
results as<br>
you describe.<br>
Jonathan.<br>
On 15/12/12 11:52, Vivek Periaraj wrote:<br>
><i> Maybe the data structures interfaced from MATLAB to
IPOPT are in different orders in each run? Sometimes the
order in which the variables are created affect the
solution the algorithm converges to in the end. Especially
true when multiple optimal solutions exists.<br>
</i>><br>
><i> Regards,<br>
</i>><i> Vivek<br>
</i>><br>
><br>
><i> Hi,<br>
</i>><br>
><i> I have been trying to solve an optimization with
Ipopt.<br>
</i>><br>
><i> I'm using the MATLAB interface of Ipopt, and my
optimization problem is a<br>
</i>><i> not so complicated quadratic problem satisfying
a number of distance<br>
</i>><i> inequalities for some points.<br>
</i>><br>
><i> I have noticed that in different cases of my
problem, whether it is solved<br>
</i>><i> (status 0), detected infeasible (status 2) or
exceeded maximum iterations<br>
</i>><i> (status -2), even if I run the code with the
exact same initial point and<br>
</i>><i> exact same options, I get results that are
different.<br>
</i>><i> Now, I know that my problem does not have a
unique solution, e.g. in case<br>
</i>><i> of instances that are solved completely I get
different results while all<br>
</i>><i> satisfy the constraints. But still, I expect
ipopt to give<br>
</i>><i> me similar results when I run it with similar
conditions.<br>
</i>><br>
><i> Is there any option in Ipopt that accounts to
randomness. Or is it a<br>
</i>><i> behavior of MATLAB?<br>
</i>><br>
><i> I have noticed that building Ipopt with various
versions of BLAS and LAPACK<br>
</i>><i> does not affect this in my case (I tried third
party versions provided, and<br>
</i>><i> also ATLAS implementations of libraries in
Liunx), but forcing MALTAB to<br>
</i>><i> use different BLAS and LAPACK versions (through
environment variables
<br>
</i>><i> BLAS_VERSION and LAPACK_VERSION) has an effect
(although in no case, I get<br>
</i>><i> exactly similar results) .<br>
</i>><br>
><i> Has anybody else had such an experience with IpOpt?
Should I change a
<br>
</i>><i> setting in Ipopt ot MATLAB?<br>
</i>><br>
><i> Thanks<br>
</i>><i> ALireza<br>
</i>><br>
><br>
><i> PS: If it helps, here is a summary of Ipopt options
I have changed:<br>
</i>><br>
><i> ipopt.hessian_approximation = 'limited-memory';<br>
</i>>><i> ipopt.mu_strategy = 'adaptive'; > tols =
[1e-6; Options.MaxR; Options.MaxR]; > ipopt.tol =
sum(tols); > ipopt.constr_viol_tol = tols(1); >
ipopt.compl_inf_tol = tols(2); > ipopt.dual_inf_tol =
tols(3); > hessian_constant = 'yes'; >
ipopt.warm_start_init_point = 'yes';<br>
</i>><i> _______________________________________________<br>
</i>><i> Ipopt mailing list<br>
</i>><i> <a moz-do-not-send="true"
href="http://list.coin-or.org/mailman/listinfo/ipopt">Ipopt
at list.coin-or.org<br>
</a>
</i>><i> <a moz-do-not-send="true"
href="http://list.coin-or.org/mailman/listinfo/ipopt">http://list.coin-or.org/mailman/listinfo/ipopt<br>
</a>
</i>
--<br>
Scanned by iCritical.<br>
<br>
</blockquote>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Fri, Dec 14, 2012 at 7:11 PM,
AliReza Khoshgoftar Monfared <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:khoshgoftar@gmail.com"
target="_blank">khoshgoftar@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi,
<div><br>
</div>
<div>I have been trying to solve an optimization with
Ipopt.</div>
<div><br>
</div>
<div>
I'm using the MATLAB interface of Ipopt, and my
optimization problem is a not so complicated quadratic
problem satisfying a number of distance inequalities for
some points.</div>
<div><br>
</div>
<div>I have noticed that in different cases of my problem,
whether it is solved (status 0), detected infeasible
(status 2) or exceeded maximum iterations (status -2),
even if I run the code with the exact same initial point
and exact same options, I get results that are
different.</div>
<div>Now, I know that my problem does not have a unique
solution, e.g. in case of instances that are
solved completely I get different results while all
satisfy the constraints. But still, I expect ipopt to
give me similar results when I run it with similar
conditions.</div>
<div><br>
</div>
<div>Is there any option in Ipopt that accounts to
randomness. Or is it a behavior of MATLAB?</div>
<div><br>
</div>
<div>I have noticed that building Ipopt with various
versions of BLAS and LAPACK does not affect this in my
case (I tried third party versions provided, and also
ATLAS implementations of libraries in Liunx),
but forcing MALTAB to use different BLAS and LAPACK
versions (through environment variables BLAS_VERSION and
LAPACK_VERSION) has an effect (although in no case, I
get exactly similar results) .</div>
<div><br>
</div>
<div>Has anybody else had such an experience with IpOpt?
Should I change a setting in Ipopt ot MATLAB?</div>
<div><br>
</div>
<div>Thanks</div>
<div>ALireza</div>
<div><br>
</div>
<div><br>
</div>
<div>PS: If it helps, here is a summary of Ipopt options I
have changed:</div>
<div><br>
</div>
<div>
<blockquote class="gmail_quote" style="margin:0px 0px
0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">ipopt.hessian_approximation
= 'limited-memory';<br>
ipopt.mu_strategy = 'adaptive';<br>
tols = [1e-6; Options.MaxR; Options.MaxR];<br>
ipopt.tol = sum(tols);<br>
ipopt.constr_viol_tol = tols(1);<br>
ipopt.compl_inf_tol = tols(2);<br>
ipopt.dual_inf_tol = tols(3);<br>
hessian_constant = 'yes';<br>
ipopt.warm_start_init_point = 'yes';</blockquote>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
<br>
<p>--
<BR>Scanned by iCritical.
</p><br>
</body>
</html>