-
Notifications
You must be signed in to change notification settings - Fork 17
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
♻️ Make Process.run
async
#272
base: support/0.21.x
Are you sure you want to change the base?
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## support/0.21.x #272 +/- ##
==================================================
- Coverage 90.82% 90.82% -0.00%
==================================================
Files 21 21
Lines 2973 2972 -1
==================================================
- Hits 2700 2699 -1
Misses 273 273
☔ View full report in Codecov by Sentry. |
94c164e
to
0b30f35
Compare
@@ -225,7 +227,7 @@ async def execute(self) -> State: # type: ignore # pylint: disable=invalid-over | |||
try: | |||
try: | |||
self._running = True | |||
result = self.run_fn(*self.args, **self.kwargs) | |||
result = await self.run_fn(*self.args, **self.kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the better way to do this is using https://docs.python.org/3/library/inspect.html#inspect.isawaitable
🤔 (see e.g. https://textual.textualize.io/blog/2023/03/15/no-async-async-with-python/)
Thanks @chrisjsewell . If we can test this in an integrated way with Then again, given that 0.22 has already been released, if we are going to bother with proper semver, I guess we should really not merge it in there either and release it with 0.23 instead 🤔 |
Yeh so I rebased it onto v0.21, just so I could get aiidateam/aiida-core#6079 to work (without PR5732) Here I mention that I haven't actually implemented any (new) asyncio behaviour for the local/ssh transports, as this may take some more thinking, for a "production ready" to ensure it doesn't create any new problems (e.g. limiting how many file transfers can be running at any one time) I'm sure for ssh (or Firecrest) it should not be too difficult to show a toy example of a speed up. Obviously it is very dépendant on the type of calculations you are running though, I guess most suited if you are uploading/downloading many 1000s of files and/or very large files (and there is also different async strategies for both) |
For sure getting PR5732 through would be nice 👍 |
As discussed with @giovannipizzi, to allow for introducing
async
methods to the AiiDATransport
classes (particularly for uploading and downloading files)The downstream implementation and explanation in aiida-core is here: aiidateam/aiida-core#6079
(Also makes me think, can you also allow for optional
async
Workflow steps this way)