@@ -444,7 +444,7 @@ function mpi_do(mgr::MPIManager, expr)
444444 ! mgr. initialized && wait (mgr. cond_initialized)
445445 jpids = keys (mgr. j2mpi)
446446 refs = cell (length (jpids))
447- for (i,p) in enumerate (filter (x-> x != myid (), jpids))
447+ for (i,p) in enumerate (filter (x -> x != myid (), jpids))
448448 refs[i] = remotecall (expr, p)
449449 end
450450 # Execution on local process should be last, since it can block the main
@@ -458,7 +458,7 @@ function mpi_do(mgr::MPIManager, expr)
458458 for r in refs
459459 @async begin
460460 resp = remotecall_fetch (r. where, r) do rr
461- wrkr_result = take! (rr)
461+ wrkr_result = rr[]
462462 # Only return result if it is an exception, i.e. don't
463463 # return a valid result of a worker computation. This is
464464 # a mpi_do and not mpi_callfetch.
@@ -472,8 +472,11 @@ function mpi_do(mgr::MPIManager, expr)
472472end
473473
474474macro mpi_do (mgr, expr)
475- expr = Base. localize_vars (:(()-> $ expr), false )
476- :(mpi_do ($ (esc (mgr)), $ (esc (expr))))
475+ quote
476+ # Evaluate expression in Main module
477+ thunk = () -> (eval (Main, $ (Expr (:quote , expr))); nothing )
478+ mpi_do ($ (esc (mgr)), thunk)
479+ end
477480end
478481
479482# All managed Julia processes
0 commit comments