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

[FileFormats.LP] issues reading a large .lp file #2563

Closed
hdavid16 opened this issue Oct 23, 2024 · 2 comments
Closed

[FileFormats.LP] issues reading a large .lp file #2563

hdavid16 opened this issue Oct 23, 2024 · 2 comments
Labels
Submodule: FileFormats About the FileFormats submodule

Comments

@hdavid16
Copy link

I got the following error on a large .lp file (140K rows). The longest line has 5.2MM characters (very long constraint). I suspect the issue is with this line when it is doing a regex find to check if it is an indicator constraint (->). Any ideas on how to avoid this issue?

ERROR: PCRE.exec error: match limit exceeded
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] exec(re::Ptr{Nothing}, subject::String, offset::Int64, options::UInt32, match_data::Ptr{Nothing})
    @ Base.PCRE ./pcre.jl:207
  [3] exec_r_data
    @ ./pcre.jl:220 [inlined]
  [4] match(re::Regex, str::String, idx::Int64, add_opts::UInt32)
    @ Base ./regex.jl:409
  [5] match
    @ ./regex.jl:407 [inlined]
  [6] match
    @ ./regex.jl:426 [inlined]
  [7] _parse_section(::Val{…}, model::MathOptInterface.Utilities.GenericModel{…}, cache::MathOptInterface.FileFormats.LP._ReadCache, line::SubString{…})
    @ MathOptInterface.FileFormats.LP ~/.julia/packages/MathOptInterface/2rAFb/src/FileFormats/LP/LP.jl:773
  [8] read!(io::IOStream, model::MathOptInterface.Utilities.GenericModel{…})
    @ MathOptInterface.FileFormats.LP ~/.julia/packages/MathOptInterface/2rAFb/src/FileFormats/LP/LP.jl:1075
  [9] #11
    @ ~/.julia/packages/MathOptInterface/2rAFb/src/FileFormats/FileFormats.jl:120 [inlined]
 [10] open(::MathOptInterface.FileFormats.var"#11#12"{}, ::String, ::Vararg{…}; kwargs::@Kwargs{})
    @ Base ./io.jl:396
 [11] open
    @ ./io.jl:393 [inlined]
 [12] compressed_open
    @ ~/.julia/packages/MathOptInterface/2rAFb/src/FileFormats/utils.jl:282 [inlined]
 [13] compressed_open(f::MathOptInterface.FileFormats.var"#11#12"{}, filename::String, mode::String, ::MathOptInterface.FileFormats.AutomaticCompression)
    @ MathOptInterface.FileFormats ~/.julia/packages/MathOptInterface/2rAFb/src/FileFormats/utils.jl:320
 [14] read_from_file(model::MathOptInterface.Utilities.GenericModel{…}, filename::String)
    @ MathOptInterface.FileFormats ~/.julia/packages/MathOptInterface/2rAFb/src/FileFormats/FileFormats.jl:119
 [15] read_from_file(filename::String; format::MathOptInterface.FileFormats.FileFormat, kwargs::@Kwargs{})
    @ JuMP ~/.julia/packages/JuMP/Gwn88/src/file_formats.jl:112
 [16] read_from_file(filename::String)
    @ JuMP ~/.julia/packages/JuMP/Gwn88/src/file_formats.jl:105
 [17] top-level scope
    @ REPL[400]:1
 [18] top-level scope
    @ none:1
Some type information was truncated. Use `show(err)` to see complete types.
@odow
Copy link
Member

odow commented Oct 23, 2024

Any ideas on how to avoid this issue?

Don't write such long lines in the first place.

This is really a duplicate of #2351

@odow odow added the Submodule: FileFormats About the FileFormats submodule label Oct 23, 2024
@odow odow changed the title Issues reading a large .lp file [FileFormats.LP] issues reading a large .lp file Oct 23, 2024
@odow
Copy link
Member

odow commented Oct 24, 2024

Closing in favor of #2351

@odow odow closed this as completed Oct 24, 2024
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
Development

No branches or pull requests

2 participants