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

[Bug]: Changing the optimiser does not work #691

Closed
chamanbaz opened this issue Apr 30, 2024 · 2 comments
Closed

[Bug]: Changing the optimiser does not work #691

chamanbaz opened this issue Apr 30, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@chamanbaz
Copy link

Bug description

Changing the optimiser on the setting is not reflected in the code. The package always uses HiGHS no matter what optimiser is selected in genx_settings.yml. Isn't it because case_runner.jl already defines the optimiser and it is not changed elsewhere based on the settings:
function run_genx_case!(case::AbstractString, optimizer::Any=HiGHS.Optimizer)

Environment and Version

Julia 1.10.2 on a linux server

Relevant error messages

No response

Additional context

No response

@chamanbaz chamanbaz added the bug Something isn't working label Apr 30, 2024
@sambuddhac
Copy link
Collaborator

If you are using GenX from the main branch (which is the GenX prelease 0.4.0), this page in the doc pages tells you how to use one of the other commercial (or non-commercial solvers) other than HiGHS (which is the default solver):

https://genxproject.github.io/GenX.jl/dev/Getting_Started/commercial_solvers/

Specifically, for instance, if you want to use let's say, Gurobi, or, CPLEX, this is what you should be doing:

Make sure you have a valid license and the actual solvers for either of Gurobi or CPLEX installed on your machine
Add Gurobi or CPLEX to the Julia Project.
$ julia --project=/home/youruser/GenX

julia> <press close-bracket ] to access the package manager>
(GenX) pkg> add Gurobi

-or-
(GenX) pkg> add CPLEX

Edit the Run.jl file to use the commercial solver. For example, to use Gurobi, you can add the following lines to the Run.jl file:

using Gurobi
using GenX

run_genx_case!(dirname(@__FILE__), Gurobi.Optimizer)

Warning
Note that if you have not already installed the required Julia packages or you do not have a valid Gurobi license on your host machine, you will receive an error message and Run.jl will not run to completion.

Please let us know, if that works for you.

@chamanbaz
Copy link
Author

Thanks. Yes, this solves the problem. Has this changed recently? I used to define the solver in the setting in the past. It seems I am using the old documentation: https://genxproject.github.io/GenX.jl/stable/how_to_run_genx.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants