Commit b9744dd8 authored by Martin Marinov's avatar Martin Marinov
Browse files

Use PRGORESS_RESUME_ABORT in the IPOPT error handler instead of throwing PROGRESS_ABORTED directly.

parent 5de94f73
...@@ -171,15 +171,16 @@ static void throw_ipopt_solve_failure(Ipopt::ApplicationReturnStatus const statu ...@@ -171,15 +171,16 @@ static void throw_ipopt_solve_failure(Ipopt::ApplicationReturnStatus const statu
// Internal_Error=-199 // Internal_Error=-199
// }; // };
//------------------------------------------------------ //------------------------------------------------------
switch(status) { switch (status)
{
case Ipopt::Maximum_Iterations_Exceeded: case Ipopt::Maximum_Iterations_Exceeded:
COMISO_THROW(IPOPT_MAXIMUM_ITERATIONS_EXCEEDED); COMISO_THROW(IPOPT_MAXIMUM_ITERATIONS_EXCEEDED);
case Ipopt::NonIpopt_Exception_Thrown: case Ipopt::NonIpopt_Exception_Thrown:
if (Progress::actv_node != nullptr && Progress::actv_node->aborting()) // this could be due to a thrown PROGRESS_ABORTED exception, ...
COMISO_THROW(PROGRESS_ABORTED); PROGRESS_RESUME_ABORT; // ... so check if we need to resume it
default: default:
COMISO_THROW(IPOPT_OPTIMIZATION_FAILED); COMISO_THROW(IPOPT_OPTIMIZATION_FAILED);
} // endswicth }
} }
static void check_ipopt_status(Ipopt::ApplicationReturnStatus const _stat) static void check_ipopt_status(Ipopt::ApplicationReturnStatus const _stat)
...@@ -188,7 +189,6 @@ static void check_ipopt_status(Ipopt::ApplicationReturnStatus const _stat) ...@@ -188,7 +189,6 @@ static void check_ipopt_status(Ipopt::ApplicationReturnStatus const _stat)
throw_ipopt_solve_failure(_stat); throw_ipopt_solve_failure(_stat);
} }
void IPOPTSolverLean::solve(NProblemInterface* _problem, void IPOPTSolverLean::solve(NProblemInterface* _problem,
const std::vector<NConstraintInterface*>& _constraints) const std::vector<NConstraintInterface*>& _constraints)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment