-
Notifications
You must be signed in to change notification settings - Fork 87
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
separate packages for MOI wrappers? #22
Comments
I'm all for modularity. For the names, I'd vote for prefixing |
We'll have to see what we can get past the METADATA guards |
Don't love the acronym naming, explaining to people they need to |
We can make it more explicit with |
I vote for |
Question: what if we have a pure-julia solver whose natural interface is MOI? Do we still need a second package? Does Pajarito also need |
Without that name how would |
Julia doesn't have a nice way to deal with plug-ins that register themselves on installation, afaik. We could maintain an explicit list of solver names and package names in MOI. |
We've gotten pretty far without ever having a list of solvers, but it's not that unreasonable to do. We could also use this list to store the capabilities of each solver so that we could make recommendations based on the problem class. |
Why would we need a plugin that registers itself? |
To make |
Assuming more hybrid solvers like Pajarito are developed, there could be significant maintenance pain for each new solver to make a PR to MOI. Right now this is basically handled by the Julia Pkg manager. But if there is no easy alternative, this is fine by me. |
If we're at the point where we can't keep up with PRs to add new solvers to the list in MOI, then either we've been very successful or we've abandoned MOI :) |
I had the very successful outcome in mind 😄 |
So I'll summarize the conclusion as follows: We let the MOI interfaces be implemented in separate packages as appropriate. We should probably do this commercial solvers like Cplex and Gurobi for the reasons I listed above. For Cbc, Clp, ECOS, etc maybe there's not much of a reason to split off the MOI wrapper yet. Pajarito shouldn't need a separate wrapper package. MOI has a dictionary of solver names to solver packages and implements Anything else? |
I'm in agreement with @tkelman, I don't see how the seemingly marginal or hypothetical gains from this proposal justify writing our own mini package manager in JuMP. |
What about having JuMP/MathOptInterface "claim" the short versions of the names. Move the C interfaces to GurobiBase, ClpBase etc. Then JuMP users still go "using Gurobi". |
Gurobi can essentially claim |
Calling it a mini package manager is a bit of an exaggeration. I'm imagining: solverdict = Dict(:Gurobi => :MathOptInterfaceGurobi,
:CPLEX => :MathOptInterfaceCPLEX,
:Pajarito => :Pajarito)
macro usingsolver(args...)
# using solverdict[args[1]], solverdict[args[2]], ...
end
function addsolver(s)
Pkg.add(solverdict[s])
end |
After reading a couple of time this thread and after the explanation provided by Miles, I think that this is a good idea. Indeed we are still facing an issue with BlockDecomposition.jl dependency towards CPLEX.jl despite the current - not very clean - state of CPLEX.jl which defines two functions that are wrappers to the C interface but that are not used to implement any function in MathProgBase. Having the C Wrappers separated from the MOI interface will be a clean way to solve our problem. That said I agree with @tkelman : Pkg.add("GLPKMathProgInterface") to use GLPK with JuMP is not intuitive for the users. Why don't we call the MathOptInterface simply JuMPInterface.jl (it is really a julia math programming interface). And even if someone wants to create his own modeling language, no one denies him from using JuMPInterface.jl as a sublayer without using JuMP.jl Solver packages like Gurobi.jl could be split then to the C wrapper Gurobi.jl and the JuMPInterface implementer named something like JuMPGurobi.jl. The user would be less confused writing Pkg.add("JuMP")
Pkg.add("JuMPGurobi") About pure julia solvers like Pajarito, I am not sure about the answer since there is no C wrapper but it would be nice to keep the consistency. I remember that when I first used JuMP and liked it, I did a quick search on github "JuMP jl" to see all packages and Prajito wasn't listed among the results. I only discovered it much later. It is still the case today https://github.com/search?p=1&q=JuMP+jl&type=Repositories&utf8=%E2%9C%93 Since we are talking about naming, it would be nice to have a clear convention for all stable packages that are part of juliaopt, including JuMP upper layers (that should be different from the sublayer convention). I've seen a couple of questions about it in the past (e.g. jump-dev/JuMP.jl#739) |
I find it cleaner to prefix it with |
That's true for people writing JuliaOpt packages, not for people using them. To most users MathProgBase or any replacements are just words that happen to scroll by when they first install JuMP (or extensions, or Convex.jl I suppose) and they never see or think about them ever again. Module names tab complete, having a name that's more self explanatory and discoverable is worth the few extra keystrokes. |
I think that most people would accept the acronyme in HTTP.jl because HTTP is known for people other than those writing this package. unfortunately, we can not use such argument: while OR people use MIP often for mixed integer programming, MP isn't a known acronyme for math programming. However, it is already accepted for JuMP. I think both names should be close somehow, and JuMP with MathOptInterface In my opinion aren't. @blegat I see your issue with JuMP prefix. how about JuMPInterface suffix? JuMP users will write: using "JuMP", "GurobiJuMPInterface" SweetModeling users will write: using "SweetModeling", "GurobiJuMPInterface" EDIT: |
I can see the marketing argument for calling this package |
We have package listings at juliaopt.org and http://www.juliaopt.org/JuMP.jl/0.17/installation.html#getting-solvers, so I'm not really convinced by the argument that anything related to JuMP should have JuMP in the package name. Pajarito wasn't listed under juliaopt.org for a while because it was not ready for users. |
|
If we really wanted to make things simple for first-time or one-time users, we would have a |
I agree that it is a weak argument and shouldn't be one of the main arguments for choosing the package names. I m just saying that sometimes when you are ready to face and fix bugs rather than rewriting a new package from scratch, you may accept to use an existing code even if it is not ready to be listed yet. And for that, you can be happy with what github is offering :) |
Thumbs up for http://www.juliaopt.org/ and http://www.juliaopt.org/packages/ listing all the nice JuMP solvers and extensions ! |
@chriscoey is right that renaming MOI to Following the clarity argument and the Julia package naming conventions, we shouldn't have the abbreviation |
Thanks for the clarifications @mlubin. MathOptInterface is then, in my opinion, a good name for this package. We agree nevertheless that this name is a generic name and not related to any other package within the Juliaopt organization, nor it is related to the name of the organization. So this is a claim that for now, MathOptInterface.jl is defining the standard way under julia for interfacing the existing solvers. In my opinion, I guess this won't be an issue for anyone, since all solver interfaces that have already been used for a while under julia, are part of Juliaopt organization and use all the unique interface. If another organization (eg ILOG) wants to make their own interface, they will be the ones required to add the ILOG prefix in the package name to avoid confusion. Assuming that we accept this, then I don't see a reason to add MathOptInterface to SolverName package. If someone ever claims SolverName.jl a solution, in my opinion, that would make sense is to prefix it with the name of the organization juliaopt or with the name of a known package within that organization. Therefore I upvote for the suggestion of @odow for having SolverName.jl be the SolverName implementer of MathOptInterface and SolverNameBase.jl be the pure C wrapper. |
As @mlubin said
The same holds for CPLEX |
How about we don't do any unnecessary package reorganization until we see Pkg3. I've been asking for package namespaces for years now... If the name of the package were JuliaOpt/Gurobi.jl instead of Gurobi.jl it would be much less objectionable to keep the MOI wrapper there. At the moment I don't think we have the right tools to properly address this issue. |
Probably reasonable... Is there an ETA on Pkg3? |
Julia 1.0? |
Namespacing seems like the correct solution here. |
I consider #27 as a resolution of this issue for the time being. |
* Rebuild docs * Update docs for v0.6 * Add v1.0 for travis * Remove custom css * Fix travis script
Since we're about to write a bunch of MOI wrappers, now would be a good time to reconsider the current structure of the solver wrappers. I propose that we move all of the MOI wrappers into separate packages, like
GurobiMOIMathOptInterfaceGurobi,CPLEXMOIMathOptInterfaceCPLEX,CbcMOIMathOptInterfaceCbc, etc. The reasons are:It's a bit uglier to say
using MathOptInterfaceGurobi
versususing Gurobi
. JuMP can get around this by providing a@usingsolver
macro that translates@usingsolver Gurobi, Mosek
intousing MathOptInterfaceGurobi, MathOptInterfaceMosek
.CC's for those not watching this repo: @ulfworsoe @tkelman @odow
The text was updated successfully, but these errors were encountered: