@@ -444,7 +444,7 @@ function mpi_do(mgr::MPIManager, expr)
444
444
! mgr. initialized && wait (mgr. cond_initialized)
445
445
jpids = keys (mgr. j2mpi)
446
446
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))
448
448
refs[i] = remotecall (expr, p)
449
449
end
450
450
# Execution on local process should be last, since it can block the main
@@ -458,7 +458,7 @@ function mpi_do(mgr::MPIManager, expr)
458
458
for r in refs
459
459
@async begin
460
460
resp = remotecall_fetch (r. where, r) do rr
461
- wrkr_result = take! (rr)
461
+ wrkr_result = rr[]
462
462
# Only return result if it is an exception, i.e. don't
463
463
# return a valid result of a worker computation. This is
464
464
# a mpi_do and not mpi_callfetch.
@@ -472,8 +472,11 @@ function mpi_do(mgr::MPIManager, expr)
472
472
end
473
473
474
474
macro 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
477
480
end
478
481
479
482
# All managed Julia processes
0 commit comments