Skip to content

Commit

Permalink
Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed May 6, 2024
1 parent 4ebb188 commit 188400d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scripts/test-distributed-work.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
using Distributed
using Extrae
using Cassette

ENV["JULIA_DEBUG"] = Extrae
@everywhere ENV["JULIA_DEBUG"] = Extrae

addprocs_extrae(1)
addprocs(1)

function random_sleep()
println("Worker started: ", myid())
sleep(rand((1,2,3,4,5)))
sleep(rand((1, 2, 3, 4, 5)))
println("Worker woke up: ", myid())
end

Expand All @@ -21,13 +20,13 @@ end
function test_distributed_work()

A = rand(1000, 1000)
a1 = @spawnat :any matrix_multiply(A)
a1 = @spawnat :any matrix_multiply(A)
a2 = @spawnat :any matrix_multiply(A)
fetch(a1)
fetch(a2)
@everywhere Extrae.finish()
end

Cassette.overdub(Extrae.ExtraeCtx(), test_distributed_work)
test_distributed_work()

println("END TEST")

0 comments on commit 188400d

Please sign in to comment.