Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't import recvfrom from Base #148

Merged
merged 1 commit into from
Jun 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Don't import recvfrom from Base
shouldn't extend Base functions on Basw types
  • Loading branch information
tkelman committed Jun 27, 2017
commit 00e30509b9b97af40f701fc6312e91591e94ab83
3 changes: 1 addition & 2 deletions src/spmd.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module SPMD

import DistributedArrays: gather, next_did, close
import Base.recvfrom # UDP socket
export sendto, recvfrom, recvfrom_any, barrier, bcast, scatter, gather
export context_local_storage, context, spmd, close

Expand Down Expand Up @@ -260,4 +259,4 @@ function close(ctxt::SPMDContext)
ctxt.release = false
end

end
end
16 changes: 8 additions & 8 deletions test/spmd.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
barrier(;tag=:b1)

if myid() == 1
@assert recvfrom(2) == "Hello from 2"
@assert SPMD.recvfrom(2) == "Hello from 2"
println("SPMD: Passed send/recv")
elseif myid() == 2
data = "Hello from 2"
Expand All @@ -22,7 +22,7 @@
bcast_val = bcast(bcast_val, 1)

if myid() == 1
@assert bcast_val == recvfrom(2)
@assert bcast_val == SPMD.recvfrom(2)
println("SPMD: Passed broadcast")
elseif myid() == 2
sendto(1, bcast_val)
Expand All @@ -37,7 +37,7 @@
lp = scatter(scatter_data, 1, tag=1)

if myid() == 1
@assert scatter_data[2:2] == recvfrom(2)
@assert scatter_data[2:2] == SPMD.recvfrom(2)
println("SPMD: Passed scatter 1")
elseif myid() == 2
sendto(1, lp)
Expand All @@ -50,7 +50,7 @@
lp = scatter(scatter_data, 1, tag=2)

if myid() == 1
@assert scatter_data[3:4] == recvfrom(2)
@assert scatter_data[3:4] == SPMD.recvfrom(2)
println("SPMD: Passed scatter 2")
elseif myid() == 2
sendto(1, lp)
Expand Down Expand Up @@ -91,8 +91,8 @@ spmd(spmd_test1)
sendto(pids[n_pididx], mylp[2])
sendto(pids[p_pididx], mylp[1])

mylp[2] = recvfrom(pids[p_pididx])
mylp[1] = recvfrom(pids[n_pididx])
mylp[2] = SPMD.recvfrom(pids[p_pididx])
mylp[1] = SPMD.recvfrom(pids[n_pididx])

# println(mylp)

Expand Down Expand Up @@ -138,8 +138,8 @@ println("SPMD: Passed testing of spmd function run concurrently")
sendto(pids[n_pididx], mylp[2])
sendto(pids[p_pididx], mylp[1])

mylp[2] = recvfrom(pids[p_pididx])
mylp[1] = recvfrom(pids[n_pididx])
mylp[2] = SPMD.recvfrom(pids[p_pididx])
mylp[1] = SPMD.recvfrom(pids[n_pididx])

barrier(;pids=pids)
localsum = localsum + mylp[1] + mylp[2]
Expand Down