Skip to content

Commit 35ece71

Browse files
femtocleaner[bot]Keno
authored andcommitted
Fix deprecations (#194)
1 parent 21fd5ee commit 35ece71

File tree

4 files changed

+76
-100
lines changed

4 files changed

+76
-100
lines changed

src/cman.jl

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -129,16 +129,7 @@ function launch(mgr::MPIManager, params::Dict,
129129
println("Try again with a different instance of MPIManager.")
130130
throw(ErrorException("Reuse of MPIManager is not allowed."))
131131
end
132-
if VERSION >= v"0.5.0-dev+4047"
133-
# Pass the cookie as symbol to `setup_worker` to work around
134-
# the mangling issues with command objects, strings and `julia -e` option.
135-
# Same reason that the ip-address is passed as an integer.
136-
# Prefix cookie with a "cookie_" since symbols do not
137-
# lend itself well to strings starting with a "0"
138-
cookie = string(":cookie_",Base.cluster_cookie())
139-
else
140-
cookie = `nothing`
141-
end
132+
cookie = string(":cookie_",Base.cluster_cookie())
142133
setup_cmds = `using MPI\;MPI.setup_worker'('$(getipaddr().host),$(mgr.port),$cookie')'`
143134
mpi_cmd = `$(mgr.mpirun_cmd) $(params[:exename]) -e $(Base.shell_escape(setup_cmds))`
144135
open(detach(mpi_cmd))
@@ -365,9 +356,7 @@ function start_main_loop(mode::TransportMode=TCP_TRANSPORT_ALL;
365356

366357
# Send the cookie over. Introduced in v"0.5.0-dev+4047". Irrelevant under MPI
367358
# transport, but need it to satisfy the changed protocol.
368-
if VERSION >= v"0.5.0-dev+4047"
369-
MPI.bcast(Base.cluster_cookie(), 0, comm)
370-
end
359+
MPI.bcast(Base.cluster_cookie(), 0, comm)
371360
# Start event loop for the workers
372361
@schedule receive_event_loop(mgr)
373362
# Tell Base about the workers
@@ -379,12 +368,8 @@ function start_main_loop(mode::TransportMode=TCP_TRANSPORT_ALL;
379368
mgr = MPIManager(np=size-1, mode=mode)
380369
mgr.comm = comm
381370
# Recv the cookie
382-
if VERSION >= v"0.5.0-dev+4047"
383-
cookie = MPI.bcast(nothing, 0, comm)
384-
Base.init_worker(cookie, mgr)
385-
else
386-
Base.init_worker(mgr)
387-
end
371+
cookie = MPI.bcast(nothing, 0, comm)
372+
Base.init_worker(cookie, mgr)
388373
# Start a worker event loop
389374
receive_event_loop(mgr)
390375
MPI.Finalize()

0 commit comments

Comments
 (0)