Skip to content

Commit

Permalink
Merge pull request #10149 from amitmurthy/amitm/ptest
Browse files Browse the repository at this point in the history
minor cleanup in parallel test
  • Loading branch information
amitmurthy committed Feb 10, 2015
2 parents 3bbd0bb + 5b18a83 commit ef6a0f1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/parallel.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# NOTE: worker processes cannot add more workers, only the client process can.
require("testdefs.jl")

if nprocs() < 3
remotecall_fetch(1, () -> addprocs(2))
if nworkers() < 3
remotecall_fetch(1, () -> addprocs(3))
end

id_me = myid()
Expand Down Expand Up @@ -148,9 +148,6 @@ map!(x->1, d)

# Test @parallel load balancing - all processors should get either M or M+1
# iterations out of the loop range for some M.
if nprocs() < 4
remotecall_fetch(1, () -> addprocs(4 - nprocs()))
end
workloads = hist(@parallel((a,b)->[a;b], for i=1:7; myid(); end), nprocs())[2]
@test maximum(workloads) - minimum(workloads) <= 1

Expand Down Expand Up @@ -195,7 +192,8 @@ s = [randstring() for x in 1:10^5]
@test s == remotecall_fetch(id_other, (x)->x, s)

#large number of small requests
[remotecall_fetch(id_other, myid) for i in 1:100000]
num_small_requests = 10000
@test fill(id_other, num_small_requests) == [remotecall_fetch(id_other, myid) for i in 1:num_small_requests]

# test parallel sends of large arrays from multiple tasks to the same remote worker
ntasks = 10
Expand Down

0 comments on commit ef6a0f1

Please sign in to comment.