Skip to content

Commit

Permalink
Merge pull request JuliaLang#14861 from JuliaLang/amitm/testshmem
Browse files Browse the repository at this point in the history
test update of shared arrays in a @parallel for
  • Loading branch information
amitmurthy committed Feb 1, 2016
2 parents 2bb94d6 + fc0914e commit 47f6a9f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/parallel_exec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,16 @@ map!(x->1, d)
@test 2.0 == remotecall_fetch(D->D[2], id_other, Base.shmem_fill(2.0, 2; pids=[id_me, id_other]))
@test 3.0 == remotecall_fetch(D->D[1], id_other, Base.shmem_fill(3.0, 1; pids=[id_me, id_other]))

# Issue #14664
d = SharedArray(Int,10)
@sync @parallel for i=1:10
d[i] = i
end

for (x,i) in enumerate(d)
@test x == i
end

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

0 comments on commit 47f6a9f

Please sign in to comment.