Pyomo / pyomo

An object-oriented algebraic modeling language in Python for structured optimization problems.
https://www.pyomo.org
Other
2.01k stars 518 forks source link

Timeout on very short Optimization runs #2671

Closed BenediktCosmo closed 1 year ago

BenediktCosmo commented 1 year ago

Very short optimizations result in a timeout error in Pyomo. Actually, the optimization problem is sufficiently solved and usable. However, the Callback from CPLEX to pyomo takes too long, so pyomo throws an timeout error. The problem lies in this line of code in shellcmd.py. image

Here the max(1, 0.01 self._timelimit) is taken, so the timeout for a 2 minute optimization is 1.19 seconds. This is sometimes not enough for the callback. So you could adjust this line to max(120, 0.01 self._timelimit) and the problem would be solved... :) Thanks in advance

jsiirola commented 1 year ago

Please adhere to the bug report template when filing new issues, including the "Steps to reproduce the issue", "Error Message", and "Information about your system" sections. In particular, please provide a minimal example that reproduces the observed problem (even if it is intermittent) and all information about your platform (OS, Python version, Pyomo version, installation method, solver version and installation method, etc)

BenediktCosmo commented 1 year ago

Steps to reproduce the issue:

Error message: Screenshot 2023-01-09 130759

System information: