Skip to content

Commit f02e734

Browse files
committed
Get the tests passing
Though a few tests have been disabled because they test things like --worker, which is explicitly unsupported.
1 parent 4d4269d commit f02e734

File tree

9 files changed

+139
-114
lines changed

9 files changed

+139
-114
lines changed

src/Distributed.jl renamed to src/DistributedNext.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"""
44
Tools for distributed parallel processing.
55
"""
6-
module Distributed
6+
module DistributedNext
77

88
# imports for extension
99
import Base: getindex, wait, put!, take!, fetch, isready, push!, length,

src/macros.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ Similar to calling `remotecall_eval(Main, procs, expr)`, but with two extra feat
191191
"""
192192
macro everywhere(ex)
193193
procs = GlobalRef(@__MODULE__, :procs)
194-
return esc(:($(Distributed).@everywhere $procs() $ex))
194+
return esc(:($(DistributedNext).@everywhere $procs() $ex))
195195
end
196196

197197
macro everywhere(procs, ex)

src/managers.jl

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,15 @@ function parse_machine(machine::AbstractString)
234234
(hoststr, portnum)
235235
end
236236

237+
function get_worker_arg(cookie=nothing)
238+
if isnothing(cookie)
239+
return `-E 'using DistributedNext; DistributedNext.start_worker()'`
240+
else
241+
code_str = "using DistributedNext; DistributedNext.start_worker(\"$(cookie)\")"
242+
return `-E $(code_str)`
243+
end
244+
end
245+
237246
function launch_on_machine(manager::SSHManager, machine::AbstractString, cnt, params::Dict, launched::Array, launch_ntfy::Condition)
238247
shell = params[:shell]
239248
ssh = params[:ssh]
@@ -257,10 +266,11 @@ function launch_on_machine(manager::SSHManager, machine::AbstractString, cnt, pa
257266
if length(machine_bind) > 1
258267
exeflags = `--bind-to $(machine_bind[2]) $exeflags`
259268
end
269+
260270
if cmdline_cookie
261-
exeflags = `$exeflags --worker=$(cluster_cookie())`
271+
exeflags = `$exeflags $(get_worker_arg(cluster_cookie()))`
262272
else
263-
exeflags = `$exeflags --worker`
273+
exeflags = `$exeflags $(get_worker_arg())`
264274
end
265275

266276
host, portnum = parse_machine(machine_bind[1])
@@ -518,7 +528,7 @@ function launch(manager::LocalManager, params::Dict, launched::Array, c::Conditi
518528
end
519529

520530
for i in 1:manager.np
521-
cmd = `$(julia_cmd(exename)) $exeflags --bind-to $bind_to --worker`
531+
cmd = `$(julia_cmd(exename)) $exeflags --bind-to $bind_to $(get_worker_arg())`
522532
io = open(detach(setenv(addenv(cmd, env), dir=dir)), "r+")
523533
write_cookie(io)
524534

src/pmap.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ Return `head`: the first `n` elements of `c`;
240240
and `tail`: an iterator over the remaining elements.
241241
242242
```jldoctest
243-
julia> b, c = Distributed.head_and_tail(1:10, 3)
243+
julia> b, c = DistributedNext.head_and_tail(1:10, 3)
244244
([1, 2, 3], Base.Iterators.Rest{UnitRange{Int64}, Int64}(1:10, 3))
245245
246246
julia> collect(c)

src/precompile.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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})
1+
precompile(Tuple{typeof(DistributedNext.remotecall),Function,Int,Module,Vararg{Any, 100}})
2+
precompile(Tuple{typeof(DistributedNext.procs)})
3+
precompile(Tuple{typeof(DistributedNext.finalize_ref), DistributedNext.Future})
44
# This is disabled because it doesn't give much benefit
55
# and the code in Distributed is poorly typed causing many invalidations
66
# TODO: Maybe reenable now that Distributed is not in sysimage.

0 commit comments

Comments
 (0)