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

Reading .mps file with NAME #2445

Closed
hannahtro opened this issue Feb 26, 2024 · 2 comments · Fixed by #2446
Closed

Reading .mps file with NAME #2445

hannahtro opened this issue Feb 26, 2024 · 2 comments · Fixed by #2446
Labels
Submodule: FileFormats About the FileFormats submodule Type: Bug

Comments

@hannahtro
Copy link

Hi,
I am currently reading a problem in mps format and want to solve it with SHOT:

src = MOI.FileFormats.Model(filename="my_file.mps")
MOI.read_from_file(src, "my_file.mps")
MOI.copy_to(o, src)
optimize!(o)

If the model in the mps file has a name, the error below is thrown. If I remove the name in the file, the model is solved.

NAME          EXAMPLE
ROWS
 N  OBJ
 G  ROW01
 ...
Stacktrace:
  [1] copy_to(dest::MathOptInterface.FileFormats.NL.Model, model::MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}})
    @ MathOptInterface.FileFormats.NL ~/.julia/packages/MathOptInterface/tpiUw/src/FileFormats/NL/NL.jl:280
  [2] copy_to
    @ ~/.julia/packages/AmplNLWriter/XKNTn/src/AmplNLWriter.jl:277 [inlined]
  [3] optimize!
    @ ~/.julia/packages/MathOptInterface/tpiUw/src/MathOptInterface.jl:84 [inlined]
  [4] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{AmplNLWriter.Optimizer, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}})
    @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/tpiUw/src/Utilities/cachingoptimizer.jl:316
  [5] optimize!
    @ ~/.julia/packages/MathOptInterface/tpiUw/src/Bridges/bridge_optimizer.jl:380 [inlined]
  [6] optimize!
    @ ~/.julia/packages/MathOptInterface/tpiUw/src/MathOptInterface.jl:85 [inlined]
  [7] optimize!(m::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{AmplNLWriter.Optimizer, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}, MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}})
    @ MathOptInterface.Utilities ~/.julia/packages/MathOptInterface/tpiUw/src/Utilities/cachingoptimizer.jl:316
  [8] optimize!(model::Model; ignore_optimize_hook::Bool, _differentiation_backend::MathOptInterface.Nonlinear.SparseReverseMode, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ JuMP ~/.julia/packages/JuMP/kSaGf/src/optimizer_interface.jl:457
  [9] optimize!(model::Model)
    @ JuMP ~/.julia/packages/JuMP/kSaGf/src/optimizer_interface.jl:409
@odow odow transferred this issue from jump-dev/AmplNLWriter.jl Feb 26, 2024
@odow odow added Type: Bug Submodule: FileFormats About the FileFormats submodule labels Feb 26, 2024
@odow
Copy link
Member

odow commented Feb 26, 2024

Hi @hannahtro thanks for finding this! Fix incoming: #2446

@odow
Copy link
Member

odow commented Feb 27, 2024

Hi @hannahtro, this should be fixed if you update to MathOptInterface v1.27.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Submodule: FileFormats About the FileFormats submodule Type: Bug
Development

Successfully merging a pull request may close this issue.

2 participants