Skip to content

Conversation

mrmundt
Copy link
Contributor

@mrmundt mrmundt commented Oct 3, 2025

Fixes None (but is part of #3688)

Summary/Motivation:

As part of the solver redesign effort, we decided to change how available and licensing in general will work in the new solver interface paradigm. This implements the most recent comment in #3688 for all existing solvers.

Changes proposed in this PR:

  • Redefine what available basically means
  • Add a license attribute to each solver (default is no operation)
  • Custom license manager for gurobi

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.

@mrmundt mrmundt changed the title Available license attempt 2 Change how available and license work in new solver interfaces Oct 3, 2025
Copy link
Contributor

@michaelbynum michaelbynum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not done a detailed review, but I had a couple questions after skimming this.

NotFound = 0
BadVersion = -1
BadLicense = -2
NeedsCompiledExtension = -3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why throw out NeedsCompiledExtension? I could definitely see us using this occasionally. I don't think there is a current use case. I guess we could easily add it back in if needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We aren't using it currently so I took it out. We have no issues adding it back in if it actually becomes a valid case again.

vtype=vtype,

# Acquire a Gurobi env for the duration of solve (opt + postsolve):
with self.license():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this release the license even if the user called acquire on their own?

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