lava-optimization
lava-optimization copied to clipboard
OptimizationSolver.solve can probably run into an infinite loop
Objective of issue: If timeout is set to -1, the solver will run until it finds a solution. This can mean that the solver runs into an infinite loop. I would suggest to still set a maximum number of time steps. Bad style to enable an infinite loop by normal usage of a method.
Thanks Philipp,
timeout=-1 means RunContinuous is used, I wonder if we should also add a limit to RunContinuous in Lava, e.g., 2**32?
Do you suggest we totally remove the -1 option for solve, or that we default it instead to a large but finite number? We could for example default to a number of steps resulting in about an hour of execution.
Hm... In general, it might be useful for some potential applications to allow permanent runs. Maybe just throw a warning?
@phstratmann, I like the warning, but maybe we can put an extra layer of assertion, e.g., the user has to explicitly remove the limit to allow for run continuous so that only expert users do it? @mathisrichter you probably have a stronger opinion on this, and maybe run continuous is only to be used with an explicit deterministic pause, which would support removing the timeout = -1 option.
issue is obsolete