Skip to content
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

Throw an error in checktask when a task failed #54

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

efaulhaber
Copy link

@efaulhaber efaulhaber commented Jan 7, 2025

Solves JuliaSIMD/Polyester.jl#153.

julia> @batch for j in axes(x, 2)
                  for i in 1:5
                      if i > 3 && j in (2, 4, 9)
                          error("some error")
                      end
                      x[i, j] = 1
                  end
              end
ERROR: TaskFailedException
Stacktrace:
 [1] checktask(tid::UInt32)
   @ ThreadingUtilities ~/.julia/dev/ThreadingUtilities/src/threadtasks.jl:74
 [2] wait
   @ ~/.julia/packages/ThreadingUtilities/3z3g0/src/threadtasks.jl:88 [inlined]
 [3] wait
   @ ~/.julia/packages/ThreadingUtilities/3z3g0/src/threadtasks.jl:81 [inlined]
 [4] macro expansion
   @ ~/.julia/packages/Polyester/eqrC9/src/batch.jl:257 [inlined]
 [5] _batch_no_reserve
   @ ~/.julia/packages/Polyester/eqrC9/src/batch.jl:168 [inlined]
 [6] batch(::var"#56#57", ::Val{…}, ::Tuple{}, ::Tuple{}, ::Tuple{…}, ::Static.StaticInt{…}, ::Static.StaticInt{…}, ::Polyester.NoLoop, ::Polyester.CombineIndices, ::Matrix{…})
   @ Polyester ~/.julia/packages/Polyester/eqrC9/src/batch.jl:334
 [7] top-level scope
   @ ~/.julia/packages/Polyester/eqrC9/src/closure.jl:456

    nested task error: some error
    Stacktrace:
     [1] error(s::String)
       @ Base ./error.jl:35
     [2] macro expansion
       @ ./REPL[25]:4 [inlined]
     [3] #56
       @ ~/.julia/packages/Polyester/eqrC9/src/closure.jl:309 [inlined]
     [4] (::Polyester.BatchClosure{var"#56#57", ManualMemory.Reference{Tuple{…}}, false, Tuple{}})(p::Ptr{UInt64})
       @ Polyester ~/.julia/packages/Polyester/eqrC9/src/batch.jl:11
     [5] _call
       @ ~/.julia/packages/ThreadingUtilities/3z3g0/src/threadtasks.jl:11 [inlined]
     [6] (::ThreadingUtilities.ThreadTask)()
       @ ThreadingUtilities ~/.julia/dev/ThreadingUtilities/src/threadtasks.jl:29
Some type information was truncated. Use `show(err)` to see complete types.

Note that JuliaSIMD/Polyester.jl#154 should probably get merged first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant