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

Re-run GLPK results after fixing linopy MPS format #86

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

siddharth-krishna
Copy link
Contributor

The errors we were seeing with GLPK in #68 was because linopy by default calls glpsol with the --mps argument, which is for the fixed MPS format, but the JuMP-HiGHS benchmarks are using the free MPS format (--freemps), so I re-ran the GLPK runs by hacking linopy to use --freemps:

diff --git a/linopy/solvers.py b/linopy/solvers.py
index e89a6a9..2c996e3 100644
--- a/linopy/solvers.py
+++ b/linopy/solvers.py
@@ -563,7 +563,8 @@ class GLPK(Solver):
         Path(solution_fn).parent.mkdir(exist_ok=True)
 
         # TODO use --nopresol argument for non-optimal solution output
-        command = f"glpsol --{io_api} {problem_fn} --output {solution_fn} "
+        io_api_arg = "freemps" if io_api == "mps" else io_api
+        command = f"glpsol --{io_api_arg} {problem_fn} --output {solution_fn} "
         if log_fn is not None:
             command += f"--log {log_fn} "
         if warmstart_fn:

This PR has the new results, and I'll open a linopy PR to fix the issue in a more robust way in the new year. (FYI @FabianHofmann )

There are still a few benchmarks returning uknown statuses, this needs to be looked into.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant