Skip to content

Commit 62b861a

Browse files
committed
Make report_timing 'work' in LegactSolverInterface
1 parent 4110f00 commit 62b861a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pyomo/contrib/solver/base.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,10 @@ def _map_config(
379379
):
380380
"""Map between legacy and new interface configuration options"""
381381
self.config = self.config()
382+
if 'report_timing' not in self.config:
383+
self.config.declare(
384+
'report_timing', ConfigValue(domain=bool, default=False)
385+
)
382386
if tee is not NOTSET:
383387
self.config.tee = tee
384388
if load_solutions is not NOTSET:
@@ -537,11 +541,13 @@ def solve(
537541

538542
results: Results = super().solve(model)
539543
legacy_results, legacy_soln = self._map_results(model, results)
540-
541544
legacy_results = self._solution_handler(
542545
load_solutions, model, results, legacy_results, legacy_soln
543546
)
544547

548+
if self.config.report_timing:
549+
print(results.timing_info.timer)
550+
545551
self.config = original_config
546552

547553
return legacy_results

0 commit comments

Comments
 (0)