-
Notifications
You must be signed in to change notification settings - Fork 261
Make the scheduler interface asynchronous #7462
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
base: v3
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,7 +57,14 @@ def _computer_test_get_jobs(transport, scheduler, authinfo, computer): | |
| :param authinfo: the AuthInfo object (from which one can get computer and aiidauser) | ||
| :return: tuple of boolean indicating success or failure and an optional string message | ||
| """ | ||
| found_jobs = scheduler.get_jobs(as_dict=True) | ||
|
|
||
| from plumpy import run_until_complete | ||
|
|
||
| from aiida.manage import get_manager | ||
|
|
||
| loop = get_manager().get_runner().loop | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hm.. runner spins up a lot of things we do not need for just accessing the scheduler information. I would try to use only the runner if we want to run aiida processes. I am tending to just use
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
well that's essentially what would be better and easier if our cli was asynchronous. |
||
| found_jobs = run_until_complete(loop, scheduler.get_jobs_async(as_dict=True)) | ||
|
|
||
| return True, f'{len(found_jobs)} jobs found in the queue' | ||
|
|
||
|
|
||
|
|
||
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.
I am not sure, if we need to still offer some utility for users to use this function. Can you check with @t-reents @mikeatm if people have actually a need for this functionality?
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.
I'd say it's better to wrap it in
verdi process list, assign a new column or a new option.