Closed Foggalong closed 1 month ago
As of #26 being merged both Gurobi and HiGHS have time_limit
implemented for the full problem not just one iteration. However the HiGHS functions in particular may still overrun the time cap (though nowhere near as dramatically).
See this comment for more information, but essentially there's no way at present through highspy
to tell HiGHS it only has $T$ time for a particular h.run()
. This means at a given iteration we can't tell HiGHS it only has time_remaining
left, only check afterwards whether or not it exceeded that before starting the next iteration.
This does mean that HiGHS will overrun the time cap when reached mid-iteration. Functionality to fix this will be added in HiGHS 2.0, so nought to do on this end until that release.
You can tell HiGHS that it has only time T for a particular call to 'run()' by setting its time limit before that run to t0+T, where t0 is the HiGHS run time - obtained with the call h.getRunTime() - before the call.
Nice, good to know about h.getRunTime()
. Will incorporate that now
At the moment the SQP time cap is applied to each sub problem, rather than the problem as a whole. It's documented as if intended, but it's only like this because I was lazy when first writing it :sweat_smile:
This is an easy fix, just needs some extra structure set up to keep a running total of how long has been spent in Gurobi/HiGHS.