Skip to content

Commit 2a3e009

Browse files
committed
Merge pull request #81 from JuliaParallel/anj/compat
Fix some deprecations and add Compat dependency
2 parents 08a5d04 + 908db1e commit 2a3e009

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

REQUIRE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
julia 0.4-
22
BinDeps
3+
Compat

examples/02-broadcast-impl.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function do_broadcast()
2525
if MPI.Comm_rank(comm) == root
2626
B = Dict("foo" => "bar")
2727
else
28-
B = Nothing
28+
B = nothing
2929
end
3030

3131
B = MPI.bcast(B, root, comm)
@@ -35,7 +35,7 @@ function do_broadcast()
3535
if MPI.Comm_rank(comm) == root
3636
f = x -> x^2 + 2x - 1
3737
else
38-
f = Nothing
38+
f = nothing
3939
end
4040

4141
f = MPI.bcast(f, root, comm)

examples/05-juliacman.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ println("pmap successful")
2424
println("Running 03-reduce as part of a Julia cluster")
2525
@mpi_do manager (include("03-reduce-impl.jl"); do_reduce())
2626

27-
pids = [remotecall_fetch(p, myid) for p in workers()]
27+
pids = [remotecall_fetch(myid, p) for p in workers()]
2828
println("julia pids $pids")
2929

3030
println("Running 04-sendrecv as part of a Julia cluster")

examples/06-cman-transport.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ if rank == 0
2323
nloops = 10^2
2424
function foo(n)
2525
a=ones(n)
26-
remotecall_fetch(2, x->x, a);
26+
remotecall_fetch(x->x, 2, a);
2727

2828
@elapsed for i in 1:nloops
29-
remotecall_fetch(2, x->x, a)
29+
remotecall_fetch(x->x, 2, a)
3030
end
3131
end
3232

src/MPI.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module MPI
22

3+
using Compat
4+
35
include("../deps/src/compile-time.jl")
46
include("mpi-base.jl")
57
include("cman.jl")

src/cman.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ end
120120

121121
function manage(manager::MPIManager, id::Integer, config::WorkerConfig, op::Symbol)
122122
if op == :register
123-
mpi_id = remotecall_fetch(id, ()->MPI.Comm_rank(MPI.COMM_WORLD))
123+
mpi_id = remotecall_fetch(()->MPI.Comm_rank(MPI.COMM_WORLD), id)
124124
manager.j2mpi[id] = mpi_id
125125
manager.mpi2j[mpi_id] = id
126126

@@ -161,11 +161,11 @@ macro mpi_do(manager, expr)
161161
jpids = keys(mgr.j2mpi)
162162
refs = cell(length(jpids))
163163
for (i,p) in enumerate(filter(x->x!=myid(), jpids))
164-
refs[i] = remotecall(p, ()->eval(Main,$(Expr(:quote,expr))))
164+
refs[i] = remotecall(()->eval(Main,$(Expr(:quote,expr))), p)
165165
end
166166
# Execution on local process should be last, since it can block the main event loop
167167
if myid() in jpids
168-
refs[end] = remotecall(myid(), ()->eval(Main,$(Expr(:quote,expr))))
168+
refs[end] = remotecall(()->eval(Main,$(Expr(:quote,expr))), myid())
169169
end
170170

171171
[wait(r) for r in refs]
@@ -213,8 +213,8 @@ function main_loop(manager, comm)
213213
while !MPI.Finalized()
214214
(hasdata, stat) = MPI.Iprobe(ANY_SOURCE, 0, comm)
215215
if hasdata
216-
count = Get_count(stat, Uint8)
217-
buf = Array(Uint8, count)
216+
count = Get_count(stat, UInt8)
217+
buf = Array(UInt8, count)
218218
from_rank = Get_source(stat)
219219
MPI.Recv!(buf, from_rank, 0, comm)
220220

0 commit comments

Comments
 (0)