pyomo icon indicating copy to clipboard operation
pyomo copied to clipboard

Fix PyROS Subordinate Optimizer Solve Time Access Routines

Open shermanjasonaf opened this issue 3 years ago • 0 comments

Fixes #2441 .

Summary/Motivation:

PyROS currently attempts to access subordinate optimizer solve times through the custom-written routine pyros.util.get_time_from_solver invoked on a SolverResults object. However, this routine is prone to an exception in the event the SolverResults.solver attribute has no time attribute (particularly if the SolverResults object was returned by a subsolver interface not linked to GAMS).

Changes proposed in this PR:

  • Redefine pyros.util.get_time_from_solver to more gracefully handle SolverResults objects with potentially no timing attributes
  • Estimate subordinate optimizer solve times using the Pyomo TicTocTimer (for use in event the subordinate optimizer does not write a measure of the solve time to the SolverResults object)

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

shermanjasonaf avatar Sep 22 '22 19:09 shermanjasonaf