Breakthrough-Energy / REISE.jl

Renewable Energy Integration Simulation Engine
https://breakthrough-energy.github.io/docs/
MIT License
30 stars 22 forks source link

Enable the use of HiGHS as an open-source solver #182

Open jajhall opened 2 years ago

jajhall commented 2 years ago

In README.md you observe that "Any solver compatible with JuMP can be used, although performance with open-source solvers (e.g. Clp, GLPK) may be significantly slower than with commercial solvers."

Are you aware of our MIT-licensed software HiGHS and, in particular, the experiences of the PyPSA team who observed that it's vastly better than Clp and GLPK on their energy system models. Indeed, HiGHS is competitive with Gurobi on many of their models. The comparison with Clp and GLPK is general.

More details of the PyPSA experience are available from here.

Since HiGHS is available via JuMP - indeed, it's used as the example solver in JuMP's documentation - it should be trivial to use it rather than Clp or GLPK.

jenhagg commented 2 years ago

I agree, it seems trivial to add the package in a local julia environment or in the REISE.jl Dockerfile. I'll do a quick proof of concept..

jenhagg commented 2 years ago

I have a branch that adds HiGHS to the docker image and list of supported solvers. Note there are a couple other changes elsewhere to run this in the containerized environment. Anyway, I tried running a simulation but it seems to be stuck - the simulation never completed and container was at 100% cpu throughout. I think I've ruled out resource constraints, and the same scenario completes when using glpk.

I'm guessing some configuration might be necessary?

jajhall commented 2 years ago

Shame: too little information for me to advise

jenhagg commented 2 years ago

Is there a way to emit incremental logging so we can check the progress of the optimization? Or any known cases where there would be an infinite loop? I'm not familiar with the details of the optimization itself, perhaps someone else can comment. I'm also happy to help with reproducing the environment if you or anyone is interested.

jajhall commented 2 years ago

An infinite loop is very unlikely for a problem that glpk can solve. You can switch on logging using setting the output_flag option to true, but I don't know how this is possible when calling from JuMP. I really ought to spend a bit of time finding out how to call HiGHS from JuMP!

jajhall commented 2 years ago

I hope you're not put off by this experience with HiGHS. It's being used via JuMP in many applications, so there's probably a simple explanation. That said, it would be good to get to the bottom of it. I've just discussed the issue with @galabovaa, who worked on the HiGHS side of the JuMP interface, so will have much better ideas on how to identify what's happening.

jenhagg commented 2 years ago

Thanks, @jajhall. Totally understandable, and I do hope to look into this more when I get a chance. Having more (and faster) JuMP solvers supported can only be a good thing, IMO.