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

add descend string macro #75

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

add descend string macro #75

wants to merge 1 commit into from

Conversation

vchuravy
Copy link
Member

This allows for users to take a stacktrace like:

julia> wait(kernel!(a, b, c, ndrange=size(c)))ERROR: TaskFailedException:MethodError: no method matching __index_Global_Cartesian(::CartesianIndex{2})Stacktrace:
 [1] __index_Global_NTuple at /home/vchuravy/src/KernelAbstractions/src/KernelAbstractions.jl:291 [inlined]
 [2] cpu_matmul_kernel! at /home/vchuravy/src/KernelAbstractions/src/macros.jl:229 [inlined]
 [3] __thread_run(::Int64, ::Int64, ::Int64, ::KernelAbstractions.Kernel{CPU,KernelAbstractions.NDIteration.StaticSize{(4,)},KernelAbstractions.NDIteratio
n.DynamicSize,typeof(cpu_matmul_kernel!)}, ::Tuple{Int64,Int64}, ::KernelAbstractions.NDIteration.NDRange{2,KernelAbstractions.NDIteration.DynamicSize,Ker
nelAbstractions.NDIteration.StaticSize{(4, 1)},CartesianIndices{2,Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}},Nothing}, ::Tuple{Array{Float64,2},Array{Flo
at64,2},Array{Float64,2}}, ::KernelAbstractions.NDIteration.NoDynamicCheck) at /home/vchuravy/src/KernelAbstractions/src/backends/cpu.jl:148
 [4] __run(::KernelAbstractions.Kernel{CPU,KernelAbstractions.NDIteration.StaticSize{(4,)},KernelAbstractions.NDIteration.DynamicSize,typeof(cpu_matmul_ke
rnel!)}, ::Tuple{Int64,Int64}, ::KernelAbstractions.NDIteration.NDRange{2,KernelAbstractions.NDIteration.DynamicSize,KernelAbstractions.NDIteration.Static
Size{(4, 1)},CartesianIndices{2,Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}},Nothing}, ::Tuple{Array{Float64,2},Array{Float64,2},Array{Float64,2}}, ::Kerne
lAbstractions.NDIteration.NoDynamicCheck) at /home/vchuravy/src/KernelAbstractions/src/backends/cpu.jl:121
 [5] (::KernelAbstractions.var"#30#31"{Nothing,Nothing,typeof(KernelAbstractions.__run),Tuple{KernelAbstractions.Kernel{CPU,KernelAbstractions.NDIteration.StaticSize{(4,)},KernelAbstractions.NDIteration.DynamicSize,typeof(cpu_matmul_kernel!)},Tuple{Int64,Int64},KernelAbstractions.NDIteration.NDRange{2,KernelAbstractions.NDIteration.DynamicSize,KernelAbstractions.NDIteration.StaticSize{(4, 1)},CartesianIndices{2,Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}},Nothing},Tuple{Array{Float64,2},Array{Float64,2},Array{Float64,2}},KernelAbstractions.NDIteration.NoDynamicCheck}})() at /home/vchuravy/src/KernelAbstractions/src/backends/cpu.jl:20
Stacktrace:
 [1] wait at ./task.jl:267 [inlined]
 [2] wait at /home/vchuravy/src/KernelAbstractions/src/backends/cpu.jl:63 [inlined]
 [3] wait at /home/vchuravy/src/KernelAbstractions/src/backends/cpu.jl:27 [inlined] (repeats 2 times)
 [4] top-level scope at REPL[30]:1

And invoke:

descend"KernelAbstractions.__thread_run(::Int64, ::Int64, ::Int64, ::KernelAbstractions.Kernel{CPU,KernelAbstractions.NDIteration.StaticSize{(4,)},KernelAbstractions.NDIteratio
n.DynamicSize,typeof(cpu_matmul_kernel!)}, ::Tuple{Int64,Int64}, ::KernelAbstractions.NDIteration.NDRange{2,KernelAbstractions.NDIteration.DynamicSize,Ker
nelAbstractions.NDIteration.StaticSize{(4, 1)},CartesianIndices{2,Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}},Nothing}, ::Tuple{Array{Float64,2},Array{Flo
at64,2},Array{Float64,2}}, ::KernelAbstractions.NDIteration.NoDynamicCheck)"

@oxinabox
Copy link
Contributor

Idea: make decend(3) work to do the same thing.
I.e. to decend into the method mentioned on the 3rd item in the last stacktrace.

Somewhere (in the REPL?) is stored the last numbered thing.
with makes julia> 3 then ctrl+q work with methods(...) and stacktraces.
@KristofferC set it up, i think?

@vchuravy
Copy link
Member Author

How does that work with exception stacks?

In the above I have two stacked exceptions.

@KristofferC
Copy link
Member

How does that work with exception stacks?

No idea :D (probably the latest printed)

@vchuravy
Copy link
Member Author

Yeah and the location is not enough information for Cthulhu, so we would need to store the stackframe itself.

@oxinabox
Copy link
Contributor

Yeah and the location is not enough information for Cthulhu, so we would need to store the stackframe itself.

You can resolve locations into methods via CodeTracking.jl, which is already a dependency of Cthulu

@vchuravy
Copy link
Member Author

Methods are not sufficient I need MethodInstances.

@oxinabox
Copy link
Contributor

ah, trackign that down is much more annoying

@vchuravy vchuravy added enhancement New feature or request speculative labels Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request speculative
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants