generated from ansys/template
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/pyansys participants #177
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
github-actions
bot
added
documentation
Improvements or additions to documentation
enhancement
New features or code improvements
testing
Involves the development of new unit/functional tests
labels
Aug 8, 2023
iboyd-ansys
commented
Aug 8, 2023
Codecov Report
@@ Coverage Diff @@
## main #177 +/- ##
==========================================
- Coverage 91.59% 89.71% -1.89%
==========================================
Files 29 32 +3
Lines 1511 1691 +180
==========================================
+ Hits 1384 1517 +133
- Misses 127 174 +47 |
ochernuk
approved these changes
Aug 10, 2023
…s/pysystem-coupling into feat/pyansys_participants
Addresses issue #148 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
documentation
Improvements or additions to documentation
enhancement
New features or code improvements
maintenance
Package and maintenance related
testing
Involves the development of new unit/functional tests
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The aim here is to support a mode of using PySystemCoupling that is more integrated with participants that themselves have PyAnsys APIs.
The idea is that we have instances of the participant APIs (session objects) that support the setting up of their contribution to the coupled analysis as well as exposing methods to support connection to System Coupling and performing their part of the solve.
Such instances are added to a PySyC session simply by passing the session objects to PySyC. Internally the participant API is used to extract the information System Coupling needs, and the session is stored until a
solve
is commenced on the PySyC session. At that point, the participant sessions - which control instances of their own solvers - will be instruct to have their solvers to connect to System Coupling's solver and, once all are connected, will be instructed to start their solve. Work done in this PR is responsible for managing the participant sessions, together with System Coupling itself, in all of this.One of the motivations for this, apart from it being a closer integration of the products in the general ecosystem, is to support cloud-based solves driven from Python. If the PyAnsys client is assumed to be driving its solver running as a container, and the PySystemCoupling server/solver is also running in its own container, it can be seen that a coupled solve can be managed from a PyAnsys "front end", where each participant session is responsible for starting its own container. This is in contrast with a more typical System Coupling run, which involves invoking
Solve
on System Coupling and, from there, it itself launches the participant processes - something that does not transfer so well to a containerised environment.There are two main aspects to this PR:
ParticipantManager
which is responsible for holding the added participant sessions, extracting required setup information from them, and for managing theconnect
andsolve
calls on them in coordination with System Coupling's own solve.add_participant
command so that it can continue to be used as it has been so far, but also supports being called with a single "participant session" argument. Similarly, when it comes to solving, we just want to be able to callsolution.solve()
as usual on the PySyC session object. To support this cleanly, some work has been done that builds on the existing "injected commands" functionality that allows a command that overrides an existing command to be injected, but also generates an internal form of the "normal" command that would have been generated. So, for example, the injected form ofadd_participant
can examine its arguments and decide either to delegate to the newParticipantManager
or to call the internal command that is whatadd_participant
used to be.