-
Notifications
You must be signed in to change notification settings - Fork 104
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] Asyncio execution policy #3347
Draft
Blanca-Fuentes
wants to merge
20
commits into
reframe-hpc:develop
Choose a base branch
from
Blanca-Fuentes:feat/asyncio_exec
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
[feat] Asyncio execution policy #3347
Blanca-Fuentes
wants to merge
20
commits into
reframe-hpc:develop
from
Blanca-Fuentes:feat/asyncio_exec
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
Hello @Blanca-Fuentes, Thank you for submitting the Pull Request!
Do see the ReFrame Coding Style Guide |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR changes the asynchronous execution policy to use
asyncio
(AsyncioExecutionPolicy
).The main changes introduced are the following:
KeyBoardInterrupt
management: introduction of a new type of exceptionKeyboardError
to raise in case of keyboard interruption during the execution of the code.attach_hooks()
: if the hook is therun
/wait
methods of a test then, they need to be treate as asyncio coroutines_global_logger
and atasks_logger
. The_global_logger
is used when the asyncio loop has not been yet opened and thetasks_logger
to retrieve the right logging context for each task.stage_dir
and theoutput_dir
must be absolute paths for the right context switching withwith change_dir_global
. The working directory of reframe is now set at the beginning withset_working_dir
, it is retrieved at any point in the code withget_working_dir
because changing directory with asyncio does not guarantee that we will be in the right directory when doingos.getcwd()
.compile
,run
,compile_wait
,run_wait
are now asynchronous.run_command_asyncio
method was added to create an asyncio subprocess, which has the same output as therun_command_async
. This method waits (asynchronously) for the command to be executed. The methodrun_command_async_alone
just starts the subprocess but does not wait for completion (this allows the local scheduler to poll for the job completion)._term_all()
and_kill_all()
) of the processes in the local scheduler is more challenging because the communication of signals between children and parent processes is not handled in the same way. The children of a process are retrieved explicitly and signals are sent to each process individually._run_strict
and_run_strict_s
are the asyncio and synchronous versions of_run_strict
.execute()
not inexit()
as in the previousAsynchronousExecutionPolicy
.asyncio
policy.TODO: