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

Highs_resetGlobalScheduler not defined #209

Closed
jd-lara opened this issue Mar 26, 2024 · 2 comments
Closed

Highs_resetGlobalScheduler not defined #209

jd-lara opened this issue Mar 26, 2024 · 2 comments

Comments

@jd-lara
Copy link
Contributor

jd-lara commented Mar 26, 2024

MWE

using JuMP, HiGHS
model = Model(HiGHS.Optimizer)
Highs_resetGlobalScheduler(1)
set_attribute(model, MOI.NumberOfThreads(), 1)
@odow
Copy link
Member

odow commented Mar 26, 2024

You must have an old version of HiGHS:

HiGHS.jl/src/gen/libhighs.jl

Lines 2244 to 2262 in 1d192e2

"""
Highs_resetGlobalScheduler(blocking)
Releases all resources held by the global scheduler instance.
It is not thread-safe to call this function while calling [`Highs_run`](@ref) or one of the `Highs_XXXcall` methods on any other Highs instance in any thread.
After this function has terminated, it is guaranteed that eventually all previously created scheduler threads will terminate and allocated memory will be released.
After this function has returned, the option value for the number of threads may be altered to a new value before the next call to [`Highs_run`](@ref) or one of the `Highs_XXXcall` methods.
### Parameters
* `blocking`: If the `blocking` parameter has a nonzero value, then this function will not return until all memory is freed, which might be desirable when debugging heap memory, but it requires the calling thread to wait for all scheduler threads to wake-up which is usually not necessary.
### Returns
No status is returned since the function call cannot fail. Calling this function while any Highs instance is in use on any thread is undefined behavior and may cause crashes, but cannot be detected and hence is fully in the callers responsibility.
"""
function Highs_resetGlobalScheduler(blocking)
ccall((:Highs_resetGlobalScheduler, libhighs), Cvoid, (HighsInt,), blocking)
end

@odow
Copy link
Member

odow commented Mar 26, 2024

Closing because @jd-lara is using an old version of HiGHS that doesn't include this, and the version he is using is not thread-safe.

@odow odow closed this as completed Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants