[Ipopt] Huge number of variables problem

Stefan Vigerske stefan at math.hu-berlin.de
Mon Apr 29 23:01:36 EDT 2019


Hi,

if-else and for-loops are not incompatible to each other in general.

ADOL-C and CppAD are C++ AD tools that provide specialized interfaces to 
Ipopt.
See also the list at https://coin-or.github.io/Ipopt/index.html#HOWTOUSE

Stefan

On 4/29/19 6:53 PM, To To wrote:
> Hi Stefan,
> 
> Thank you for your suggestion. It was found that the evaluation of jacobian
> of constraints took too much time, and it was due to the if-else used in
> the for-loop when forming the jacobian. Another version of jacobian was
> done without any if-else, then the evaluation of jacobian becomes much much
> quicker. For now, it was shown that the searching direction calculation
> take most of the time (which is supposed to be I guess?), all function and
> derivative evaluations take very little time.
> 
> May I ask is this simply due to the extra calls of if-else that costs much
> more time? Or some other mechanism related with C++ when including if-else
> in the for loop?
> 
> Moreover, is that possible to use automatic differentiation tools to
> generate source transformation codes for jacobian and hessian? I tried some
> AD tools using operator overloading, but with large number of variables
> these tools crash often. If possible, could you recommend AD tools with
> source transformation to be used with IPOPT C++ interface?
> 
> Thank you very much.
> 
> On Mon, Apr 29, 2019 at 4:36 AM Stefan Vigerske <stefan at math.hu-berlin.de>
> wrote:
> 
>> Hi,
>>
>> loops are ok, as long as you use them efficiently.
>> You can run Ipopt with option print_timing_statistics set to yes to get
>> more information about where time is spend.
>>
>> Stefan
>>
>> On 4/28/19 8:15 PM, To To wrote:
>>> Dear all,
>>>
>>> I'm using IPOPT 3.12.12 with the provided C++ interface under Ubuntu
>> 18.04.
>>> I formulated a relatively simple NLP and it works.
>>>
>>> I am totally new to C++, so I form my constraint and jacobian all with
>> for
>>> loop. May I ask is it the best way to formulate constraints and jacobian
>>> using for loop? I tired to increase the number of NLP variables to around
>>> 300000, and I have around 200000 constraints (very sparse). I found that
>> it
>>> is very slow when computing.
>>>
>>> Should I be careful when forming such a big problem with provided C++
>>> interface? Or should I use some other libraries such as EIGEN to better
>>> form the jacobian?
>>>
>>> Thank you very much.
>>>
>>>
>>> _______________________________________________
>>> Ipopt mailing list
>>> Ipopt at list.coin-or.org
>>> https://list.coin-or.org/mailman/listinfo/ipopt
>>>
>>
>>
> 



More information about the Ipopt mailing list