Skip to content

Commit 836bed1

Browse files
debug
1 parent f53f04c commit 836bed1

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Diff for: src/remotecall.jl

+3
Original file line numberDiff line numberDiff line change
@@ -667,11 +667,13 @@ All asynchronous remote calls return `Future`s and set the
667667
value to the return value of the call upon completion.
668668
"""
669669
function put!(r::Future, v)
670+
println("put!($(repr(r)), $(repr(v))) on thread $(Threads.threadid()) on worker $(myid())")
670671
if r.where == myid()
671672
rid = remoteref_id(r)
672673
rv = lookup_ref(rid)
673674
isready(rv) && error("Future can be set only once")
674675
@lock r.lock begin
676+
println("lock acquired on thread $(Threads.threadid()) on worker $(myid())")
675677
put!(rv, v) # this notifies the tasks waiting on the channel in fetch
676678
set_future_cache(r, v) # set the cache before leaving the lock, so that the notified tasks already see it cached
677679
end
@@ -691,6 +693,7 @@ function set_future_cache(r::Future, v)
691693
end
692694

693695
function put_future(rid, v, caller)
696+
println("put_future on thread $(Threads.threadid()) on worker $(myid())")
694697
rv = lookup_ref(rid)
695698
isready(rv) && error("Future can be set only once")
696699
put!(rv, v)

Diff for: test/distributed_exec.jl

+1
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ for i in 1:max_attempts
219219
@test remotecall_fetch(k->haskey(Distributed.PGRP.refs, k), wid1, fid) == true
220220

221221
testval = remotecall_fetch(wid2, fstore) do x
222+
println("remotecall_fetch on worker $(myid()). wid2 = $wid2")
222223
try
223224
put!(fetch(x), :OK)
224225
return 0

0 commit comments

Comments
 (0)