From de38871dfe77b5fbc9e3ba98eda1b03e64523383 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 19 Aug 2018 20:47:53 -0700 Subject: [PATCH] bring back `@broadcast` --- src/ParallelDataTransfer.jl | 16 +++++++--------- test/runtests.jl | 6 +++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/ParallelDataTransfer.jl b/src/ParallelDataTransfer.jl index b3f980b..a3e8370 100644 --- a/src/ParallelDataTransfer.jl +++ b/src/ParallelDataTransfer.jl @@ -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 diff --git a/test/runtests.jl b/test/runtests.jl index 99e397b..34b42e9 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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))