[Ipopt] Ipopt exception handling
Stefan Vigerske
stefan at math.hu-berlin.de
Tue Sep 3 05:52:54 EDT 2013
Hi,
we'll work on this, probably by adding an option to disable catching of
non-Ipopt exceptions.
Stefan
On 09/01/2013 11:34 PM, ax487 wrote:
> Hello all,
>
> first of all, I have been using Ipopt as a library in a C++ project and
> I must say that I am very pleased with the performance of Ipopt and the
> C++ interface in general.
>
> There is one thing that bothers me though: I subclassed `Ipopt::TNLP'
> and implemented the functions required to compute the objective value
> etc. Unfortunately some of the subroutines I am using to compute the
> required values throw exceptions indicating things like failed assertions.
>
> As I am sure you know it is rather simple to get an idea of what is
> causing an exception to be thrown using a debugger like gdb: As soon as
> the exception is thrown and the program is being terminated gdb provides
> a stack frame that contains the location in the code and the
> corresponding data that is causing the exception to be thrown.
>
> The problem is that Ipopt suppresses these exceptions using a
> `catch(...)' block after executing the Ipopt::TNLP routines. So instead
> of a stack trace all I get is a return status
> `NonIpopt_Exception_Thrown'. This status is pretty useless to as it does
> not tell me anything about what went wrong exactly.
>
> The developers of the boost C++ library recommend to just let exceptions
> pass through the code without doing handling them at all
> (http://www.boost.org/community/error_handling.html). I would much
> appreciate it if you could do the same. I ended up just commenting in
> the problematic `catch(...)' blocks and recompiling Ipopt which solves
> the problem for me.
>
> ax487
> _______________________________________________
> Ipopt mailing list
> Ipopt at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/ipopt
>
More information about the Ipopt
mailing list