Skip to content

gdp.mbigm: add workaround option to skip writing References if you know the writer is fine with it - #4106

Open
sadavis1 wants to merge 4 commits into
Pyomo:mainfrom
sadavis1:skip-references
Open

sadavis1 wants to merge 4 commits into
Pyomo:mainfrom
sadavis1:skip-references

Conversation

@sadavis1

@sadavis1 sadavis1 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary/Motivation:

Works around #1032. In gdp.mbigm, lots of References are unconditionally created to make sure referenced Vars are on the same model, which is needed to keep supporting older writers, but it comes at a performance cost. Modern writers no longer need Vars to be on the same model, so writing these references is not necessary unless using BARON or GAMS. This sort of Reference usage happens in a few places, but this one has a significant performance impact for large models.

Changes proposed in this PR:

  • Add option skip_writing_references (default False) to skip writing references. User assumes any risk when using a writer that reacts badly to this.
  • Add tests

AI-Use Disclosure

  • AI tools were NOT used during the preparation of this PR

or

  • AI tools contributed to the development of this PR

    • AI tools generated documentation (including the PR description/comments, code comments, and/or Sphinx documentation)
    • AI tools generated tests (baselines, examples, and/or code)
    • AI tools generated code (apart from tests)

    Review process (select ONE):

    • Rewritten: All AI-generated content was rewritten by me before being committed.
    • Reviewed/verified: I retained AI-generated content and verified it before committing. Verification included (as applicable):
      • Ran the code and fixed issues
      • Added and ran tests
      • Checked correctness/logic of code and tests
      • Checked for alignment with the contribution guide
      • Considered security implications
    • As-is: AI-generated content was commited directly to the repository

Notes for reviewers (optional):

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@sadavis1 sadavis1 changed the title GDP.mbigm: add workaround option to skip writing References if you know the writer is fine with it gdp.mbigm: add workaround option to skip writing References if you know the writer is fine with it Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants