Reset only failed tasks in reset_threads!
#160
Merged
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.checktask
did not throw an error, which means that threads with errors just failed silently (Threads fail silently on error #153).checktask
when 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_task
instead ofchecktask
. However, this initializes all tasks, not just the failed ones like before all of these PRs. Apparently, this can cause freezing.reinit_task
ThreadingUtilities.jl#58 addsreinit_task
, which is the same as the oldchecktask
and this PR uses this inreset_threads!
.