Skip to content

Commit

Permalink
only broadcast using/import to nodes which need it
Browse files Browse the repository at this point in the history
fix #12381
fix #13999
  • Loading branch information
vtjnash committed Jun 28, 2017
1 parent b3a89f3 commit 4187526
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions base/loading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,16 @@ Windows.
"""
function require(mod::Symbol)
_require(mod)
# After successfully loading notify downstream consumers
# After successfully loading, notify downstream consumers
if toplevel_load[] && myid() == 1 && nprocs() > 1
# broadcast top-level import/using from node 1 (only)
@sync for p in procs()
p == 1 || @async remotecall_fetch(_require, p, mod)
p == 1 && continue
@async remotecall_wait(p) do
if !isbindingresolved(Main, mod) || !isdefined(Main, mod)
_require(mod)
end
end
end
end
for callback in package_callbacks
Expand Down

0 comments on commit 4187526

Please sign in to comment.