Skip to content

Commit 5851e15

Browse files
authored
move out Distributed from the sysimage (JuliaLang/julia#49258)
1 parent 4a3a5f8 commit 5851e15

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/Distributed.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ include("macros.jl") # @spawn and friends
107107
include("workerpool.jl")
108108
include("pmap.jl")
109109
include("managers.jl") # LocalManager and SSHManager
110+
include("precompile.jl")
110111

111112
function __init__()
112113
init_parallel()

src/precompile.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
precompile(Tuple{typeof(Distributed.remotecall),Function,Int,Module,Vararg{Any, 100}})
2+
precompile(Tuple{typeof(Distributed.procs)})
3+
precompile(Tuple{typeof(Distributed.finalize_ref), Distributed.Future})
4+
# This is disabled because it doesn't give much benefit
5+
# and the code in Distributed is poorly typed causing many invalidations
6+
# TODO: Maybe reenable now that Distributed is not in sysimage.
7+
#=
8+
precompile_script *= """
9+
using Distributed
10+
addprocs(2)
11+
pmap(x->iseven(x) ? 1 : 0, 1:4)
12+
@distributed (+) for i = 1:100 Int(rand(Bool)) end
13+
"""
14+
=#

test/distributed_exec.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,7 +1874,7 @@ let julia = `$(Base.julia_cmd()) --startup-file=no`; mktempdir() do tmp
18741874
using Distributed
18751875
project = mktempdir()
18761876
env = Dict(
1877-
"JULIA_LOAD_PATH" => LOAD_PATH[1],
1877+
"JULIA_LOAD_PATH" => string(LOAD_PATH[1], $(repr(pathsep)), "@stdlib"),
18781878
"JULIA_DEPOT_PATH" => DEPOT_PATH[1],
18791879
"TMPDIR" => ENV["TMPDIR"],
18801880
)
@@ -1884,7 +1884,7 @@ let julia = `$(Base.julia_cmd()) --startup-file=no`; mktempdir() do tmp
18841884
""" * setupcode * """
18851885
for w in workers()
18861886
@test remotecall_fetch(depot_path, w) == [DEPOT_PATH[1]]
1887-
@test remotecall_fetch(load_path, w) == [LOAD_PATH[1]]
1887+
@test remotecall_fetch(load_path, w) == [LOAD_PATH[1], "@stdlib"]
18881888
@test remotecall_fetch(active_project, w) == project
18891889
@test remotecall_fetch(Base.active_project, w) == joinpath(project, "Project.toml")
18901890
end

0 commit comments

Comments
 (0)