Skip to content

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

@hdavid16

Description

@hdavid16

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions