Skip to content

Use C/C++ extensions for file writers #1158

@whart222

Description

@whart222

The key idea is to use C extension libraries to create problem files (LP, NL, GAMS, etc). Preliminary work with POEK and COEK indicates that this approach could significantly reduce the time needed to process a Pyomo model and generate a standard data file.

Specifically, here's a concrete experiment we should be able to easily do:

  1. Generate a model with Pyomo
  2. Populate a POEK model from the Pyomo model
  3. Create a SymbolMap in POEK, and then use COEK to write the LP file

Note that step (2) does not involve creating a canonical expression. Further, step (3) pushes all file I/O to C/C++. Both of these will likely lead to significant improvement in the total runtime using LP files.

Some limitations of this approach:

  • COEK currently only supports LP files. Adding support for NL would require additional effort, but given the complexity of that writer I think the potential performance improvements are likely greater.
  • I wouldn't expect this approach to support symbolic labels.
  • This would create an optional dependency on POEK/COEK.

Note that this approach does not require the use of COEK solver interfaces. This is merely using COEK's ability to (a) express linear/quadratic models, and (b) write them in standard formats.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions