The Highs.jl's API `Highs_resetGlobalScheduler` is not very clear

I read this instruction GitHub - jump-dev/HiGHS.jl: A Julia interface to the HiGHS solver · GitHub and this related reference Parallel · HiGHS Documentation.

To be honest I don’t find it is well-designed and easy-to-use for users.

The key question is: the API call—Highs_resetGlobalScheduler(1) is too vague. I don’t know what inner object it will modify.

I want to make an analogy: when I first started to learn Julia there was an API call Random.seed!(1), which works. But later on when I start to do more complex projects—using multiple modules, and use multiple threads, that API call turns out to be too vague. A clearly better way of organizing my code is to instantiate an explicit object, e.g. rng = Random.Xoshiro(1). And later on use rand(rng, Int) rather than rand(Int). The former style is unambiguous and can thus ensure reproducibility.

Since I used to use Gurobi.jl, it’s also worth mentioning that the same procedure is fairly clear with Gurobi’s APIs. For example, I can write a helper module as follows:

module GRBhelper

import JuMP, Gurobi

    const GRB_CONFIG = Dict{String,Any}("Threads"=>1,"OutputFlag"=>0)
    Env() = Gurobi.Env(GRB_CONFIG)
    Model() = Model(Env())
    function Env(N::Int)
        v = Vector{Gurobi.Env}(undef, N)
        Threads.@threads for i=eachindex(v)
            v[i] = Env()
        end
        v
    end
    function Model(e::Gurobi.Env)
        m = JuMP.direct_model(Gurobi.Optimizer(e))
        JuMP.set_string_names_on_creation(m, false)
        m
    end
    function Model!(mv::Vector{JuMP.Model}, i, #=with existing ones=# ev::Vector{Gurobi.Env})
        m = JuMP.direct_model(Gurobi.Optimizer(ev[i]))
        JuMP.set_string_names_on_creation(m, false)
        mv[i] = m
    end
    Model!(mv::Vector{JuMP.Model}, #=with existing ones=# ev::Vector{Gurobi.Env}) = Threads.@threads for i=eachindex(mv)
        Model!(mv, i, ev)
    end
end

So the workflow is very clear: I at first instantiate a GRB_env object, then I build a JuMP_direct_model, everything is unambiguously linked together.

I’ve had some preliminary chat with some chatbot and it comments that my concern is very appropriate (particularly concerning my Random.seed! analogy). Could we make this part (GitHub - jump-dev/HiGHS.jl: A Julia interface to the HiGHS solver · GitHub) more accurate in meaning (e.g. could you help me write a HiGHShelper module that imitates the GRBhelper)?