Skip to content

Defer starting the SAS session until needed#3448

Merged
blnicho merged 3 commits intoPyomo:mainfrom
jsiirola:sas-available
Jan 21, 2025
Merged

Defer starting the SAS session until needed#3448
blnicho merged 3 commits intoPyomo:mainfrom
jsiirola:sas-available

Conversation

@jsiirola
Copy link
Copy Markdown
Member

Fixes # .

Summary/Motivation:

This resolves an issue with the SAS interface where the SAS session was being started in the interface __init__.py. This meant that any time the interface was created it immediately tried to connect - which, if you are offline, hung until the connection timed out (~10 seconds). With these changes (and some changes with how SAS tests are skipped), running the tests offline only hits the timeout once (and not a dozen times).

Changes proposed in this PR:

  • Move the logic to start the SAS session into a helper method
  • Only start the SAS session when needed (for the available() check or for solve())
  • Update the SAS tests to minimize the number of times available() needed to be checked.

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 self-requested a review January 14, 2025 19:57
@blnicho blnicho merged commit bd3e444 into Pyomo:main Jan 21, 2025
@jsiirola jsiirola deleted the sas-available branch January 21, 2025 20:04
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.

4 participants