Skip to content

Commit

Permalink
bring back @broadcast
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Aug 20, 2018
1 parent 127a46f commit de38871
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
16 changes: 7 additions & 9 deletions src/ParallelDataTransfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,13 @@ module ParallelDataTransfer
end
end

# This produces the error "invalid let syntax"

# macro broadcast(ex)
# quote
# @sync for p in workers()
# @async @defineat p $(esc(ex))
# end
# end
# end
macro broadcast(ex)
quote
for p in workers()
@defineat p $(ex)
end
end
end

export sendtosimple, @sendto, sendto, getfrom, passobj,
@broadcast, @getfrom, @passobj, @defineat
Expand Down
6 changes: 3 additions & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ xhome = @getfrom(3, x)
@test x==5

# broadcast needs to be fixed
# @broadcast x=6
# @passobj 4 1 x
# @test x==6
@broadcast x=6
@passobj 4 1 x
@test x==6

# pass variables t, u, v from process 3 to process 1
@spawnat 3 eval(:(t=1))
Expand Down

0 comments on commit de38871

Please sign in to comment.