mdolab / pyoptsparse

pyOptSparse is an object-oriented framework for formulating and solving nonlinear constrained optimization problems in an efficient, reusable, and portable manner.
https://mdolab-pyoptsparse.readthedocs-hosted.com/en/latest/
GNU Lesser General Public License v3.0
228 stars 109 forks source link

Documentation for fail flags #136

Closed andrewtrainor closed 4 years ago

andrewtrainor commented 4 years ago

Type of issue

What types of issue is it?

Description

I am currently working on bench-marking different solvers in multiple frameworks. I need to get my solution to return if it was successful or not. I have looked around the OpenMDAO website and the docs that are contained specifically for pyoptsparse but I have been unable to get it to return a boolean. Is there more detailed documentation on how to get it to return this? I have tried variations of sol.Flag, sol.status, etc.. but have been unsuccessful. any help or resources would be greatly appreciated.

thanks!

ewu63 commented 4 years ago

Just to clarify, are you asking about the return status from the optimizer, regarding whether the optimization succeeded? This is called "inform" in pyOptSparse terminology, and it will not be a boolean -- an optimizer may exit due to many different circumstances. For each optimizer, there is a table in the pyOptSparse documentation detailing what the exit codes mean. The value can be accessed with sol.optInform.

Now you mention OpenMDAO, are you using the pyOptSparse driver there, or running pyOptSparse on its own? With OpenMDAO I don't know how the informs get passed to them, you'll have to ask the developers there.

andrewtrainor commented 4 years ago

That is correct, I am trying to get if the optimization succeeded. I am using the pyoptsparse on its own, not the driver. That is very helpful because most of the frameworks that I have dealt with return a boolean. I will look at the exit codes in the documentation. Thanks!

andrewtrainor commented 4 years ago

Which folder is the exit code documentation in?

ewu63 commented 4 years ago

We host our documentation on readthedocs. See for example here for SLSQP.

andrewtrainor commented 4 years ago

that is very helpful, thank you.