Cannot Read LP file

read_from_file throws an error when trying to read an LP file (min_max_overlap_Gen8.lp, which is 1.6 MB and is comprised of 33,885 lines), representing a MILP. SCIP on the NEOS Server is able to read and solve the LP file. The code below works fine for a very simple LP file (model2.lp).

The error is:
$ julia solve_LP.jl
ERROR: LoadError: AssertionError: token_types[offset] == _TOKEN_QUADRATIC_OFF_DIAG
Stacktrace:
[1] _get_term
@ ~/.julia/packages/MathOptInterface/o3YPB/src/FileFormats/LP/LP.jl:551 [inlined]
[2] _parse_function(f::MathOptInterface.ScalarAffineFunction{Float64}, model::MathOptInterface.Utilities.GenericModel{Float64, MathOptInterface.Utilities.ObjectiveContainer{Float64}, MathOptInterface.Utilities.VariablesContainer{Float64}, MathOptInterface.FileFormats.LP.ModelFunctionConstraints{Float64}}, cache::MathOptInterface.FileFormats.LP._ReadCache, tokens::Vector{String})
@ MathOptInterface.FileFormats.LP ~/.julia/packages/MathOptInterface/o3YPB/src/FileFormats/LP/LP.jl:589
[3] _parse_section(#unused#::Val{:constraints}, model::MathOptInterface.Utilities.GenericModel{Float64, MathOptInterface.Utilities.ObjectiveContainer{Float64}, MathOptInterface.Utilities.VariablesContainer{Float64}, MathOptInterface.FileFormats.LP.ModelFunctionConstraints{Float64}}, cache::MathOptInterface.FileFormats.LP._ReadCache, line::SubString{String})
@ MathOptInterface.FileFormats.LP ~/.julia/packages/MathOptInterface/o3YPB/src/FileFormats/LP/LP.jl:705
[4] read!(io::IOStream, model::MathOptInterface.Utilities.GenericModel{Float64, MathOptInterface.Utilities.ObjectiveContainer{Float64}, MathOptInterface.Utilities.VariablesContainer{Float64}, MathOptInterface.FileFormats.LP.ModelFunctionConstraints{Float64}})
@ MathOptInterface.FileFormats.LP ~/.julia/packages/MathOptInterface/o3YPB/src/FileFormats/LP/LP.jl:959
[5] #11
@ ~/.julia/packages/MathOptInterface/o3YPB/src/FileFormats/FileFormats.jl:121 [inlined]
[6] open(::MathOptInterface.FileFormats.var"#11#12"{MathOptInterface.Utilities.GenericModel{Float64, MathOptInterface.Utilities.ObjectiveContainer{Float64}, MathOptInterface.Utilities.VariablesContainer{Float64}, MathOptInterface.FileFormats.LP.ModelFunctionConstraints{Float64}}}, ::String, ::Vararg{String}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base ./io.jl:330
[7] open(::Function, ::String, ::String)
@ Base ./io.jl:328
[8] compressed_open(f::Function, filename::String, mode::String, #unused#::MathOptInterface.FileFormats.NoCompression)
@ MathOptInterface.FileFormats ~/.julia/packages/MathOptInterface/o3YPB/src/FileFormats/utils.jl:213
[9] compressed_open(f::Function, filename::String, mode::String, #unused#::MathOptInterface.FileFormats.AutomaticCompression)
@ MathOptInterface.FileFormats ~/.julia/packages/MathOptInterface/o3YPB/src/FileFormats/utils.jl:251
[10] read_from_file(model::MathOptInterface.Utilities.GenericModel{Float64, MathOptInterface.Utilities.ObjectiveContainer{Float64}, MathOptInterface.Utilities.VariablesContainer{Float64}, MathOptInterface.FileFormats.LP.ModelFunctionConstraints{Float64}}, filename::String)
@ MathOptInterface.FileFormats ~/.julia/packages/MathOptInterface/o3YPB/src/FileFormats/FileFormats.jl:120
[11] read_from_file(filename::String; format::MathOptInterface.FileFormats.FileFormat, kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ JuMP ~/.julia/packages/JuMP/vuP7I/src/file_formats.jl:112
[12] read_from_file(filename::String)
@ JuMP ~/.julia/packages/JuMP/vuP7I/src/file_formats.jl:110
[13] top-level scope
@ ~/solve_LP.jl:4
in expression starting at /home/muck/solve_LP.jl:4

The code is below:
using JuMP
using SCIP

m = read_from_file(“min_max_overlap_Gen8.lp”)
#m = read_from_file(“model2.lp”)
#m = read_from_file(“sample2.mps”)
set_optimizer(m,SCIP.Optimizer)
optimize!(m)

Please open a reproducible bug report Issues · jump-dev/MathOptInterface.jl · GitHub

I opened a reproducible bug report: Cannot Read LP file · Issue #2075 · jump-dev/MathOptInterface.jl · GitHub

1 Like