Reset only failed tasks in reset_threads!#160
Merged
oscardssmith merged 3 commits intoJuliaSIMD:masterfrom May 28, 2025
Merged
Conversation
Contributor
Author
|
@oscardssmith could you please have a look at this? |
Member
|
I would appreciate a test for this, but otherwise, LGTM |
Contributor
Author
|
Not sure what to test here, as I can't reproduce the error this PR is fixing. It is useful to test that |
Contributor
Author
|
Could you please also add a new release? |
This file contains hidden or 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
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.
Based on JuliaSIMD/ThreadingUtilities.jl#58.
Closes #159.
#154 caused Trixi.jl CI to freeze sometimes.
I don't have a MWE for this, but the solution is to only re-initialize failed tasks.
To summarize the previous developments:
ThreadingUtilities.checktaskdid not throw an error, which means that threads with errors just failed silently (Threads fail silently on error #153).checktaskwhen a task failed ThreadingUtilities.jl#54 changed this behavior to throw an error.Polyester.reset_threads!also usedchecktask, which now throws errors, so Avoid throwing exceptions inreset_threads!#154 changed this to callThreadingUtilities.initialize_taskinstead ofchecktask. However, this initializes all tasks, not just the failed ones like before all of these PRs. Apparently, this can cause freezing.reinit_taskThreadingUtilities.jl#58 addsreinit_task, which is the same as the oldchecktaskand this PR uses this inreset_threads!.