Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run does not reset timers #1331

Closed
odow opened this issue Jun 18, 2023 · 4 comments
Closed

run does not reset timers #1331

odow opened this issue Jun 18, 2023 · 4 comments

Comments

@odow
Copy link
Collaborator

odow commented Jun 18, 2023

Each call to run does not reset the timers, so repeated calls (e.g., in a row or column generation scheme) eventually hit a time limit.

Notice how the HiGHS run time : keeps increasing each iteration, and eventually the time limit is hit:

julia> using HiGHS

julia> highs = Highs_create()
Ptr{Nothing} @0x00007fe078c24000

julia> Highs_readModel(highs, "/Users/Oscar/Downloads/bug.mps")  # Doesn't matter. Arbitrary model
Running HiGHS 1.5.3 [date: 1970-01-01, git hash: 45a127b78]
Copyright (c) 2023 HiGHS under MIT licence terms
0

julia> Highs_setIntOptionValue(highs, "time_limit", 1)
0

julia> for _ in 1:7
           println()
           Highs_run(highs)
       end

Iteration, Runtime, ObjVal, NullspaceDim
0, 0.019859, -0.684376, 0
1000, 0.126506, -196828.896682, 0
1152, 0.142994, -198524.875970, 0
Model   status      : Optimal
Simplex   iterations: 44
QP ASM    iterations: 1152
Objective value     : -1.9852487597e+05
HiGHS run time      :          0.14

Iteration, Runtime, ObjVal, NullspaceDim
0, 0.163659, -0.684376, 0
1000, 0.270918, -196828.896682, 0
1152, 0.286709, -198524.875970, 0
Model   status      : Optimal
Simplex   iterations: 44
QP ASM    iterations: 1152
Objective value     : -1.9852487597e+05
HiGHS run time      :          0.29

Iteration, Runtime, ObjVal, NullspaceDim
0, 0.305871, -0.684376, 0
1000, 0.420568, -196828.896682, 0
1152, 0.437243, -198524.875970, 0
Model   status      : Optimal
Simplex   iterations: 44
QP ASM    iterations: 1152
Objective value     : -1.9852487597e+05
HiGHS run time      :          0.44

Iteration, Runtime, ObjVal, NullspaceDim
0, 0.458031, -0.684376, 0
1000, 0.568664, -196828.896682, 0
1152, 0.584456, -198524.875970, 0
Model   status      : Optimal
Simplex   iterations: 44
QP ASM    iterations: 1152
Objective value     : -1.9852487597e+05
HiGHS run time      :          0.59

Iteration, Runtime, ObjVal, NullspaceDim
0, 0.605321, -0.684376, 0
1000, 0.725592, -196828.896682, 0
1152, 0.742359, -198524.875970, 0
Model   status      : Optimal
Simplex   iterations: 44
QP ASM    iterations: 1152
Objective value     : -1.9852487597e+05
HiGHS run time      :          0.74

Iteration, Runtime, ObjVal, NullspaceDim
0, 0.761806, -0.684376, 0
1000, 0.872029, -196828.896682, 0
1152, 0.887218, -198524.875970, 0
Model   status      : Optimal
Simplex   iterations: 44
QP ASM    iterations: 1152
Objective value     : -1.9852487597e+05
HiGHS run time      :          0.89

Iteration, Runtime, ObjVal, NullspaceDim
0, 0.905723, -0.684376, 0
866, 1.000070, -192414.057770, 0
Model   status      : Time limit reached
Simplex   iterations: 44
QP ASM    iterations: 866
Objective value     : -1.9241405777e+05
HiGHS run time      :          1.00

Reported jump-dev/HiGHS.jl#167.

@jajhall
Copy link
Member

jajhall commented Jun 18, 2023

Yes, this is a feature to be changed in v2.0.

@odow
Copy link
Collaborator Author

odow commented Jun 18, 2023

Hmm. So perhaps we could add a call to zeroAllClocks in the C API, and then HiGHS.jl could call that to reset things?

@jajhall
Copy link
Member

jajhall commented Jun 18, 2023

Yes, that's easily done.

@odow
Copy link
Collaborator Author

odow commented Jun 18, 2023

Okay I'll work up a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants