From b5c2977b30b7c4fcdf30762563e1be24fb364327 Mon Sep 17 00:00:00 2001 From: Rami Date: Thu, 6 Jun 2019 08:43:41 -0500 Subject: [PATCH 1/2] Update darray.jl Fixes issue #206 , please see the issue description for an explanation of the fix. --- src/darray.jl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/darray.jl b/src/darray.jl index c4b12b1..1668903 100644 --- a/src/darray.jl +++ b/src/darray.jl @@ -79,7 +79,14 @@ Base.hash(d::DArray, h::UInt) = Base.hash(d.id, h) function DArray(id, init, dims, pids, idxs, cuts) localtypes = Vector{DataType}(undef,length(pids)) - + + # fixes issue #206 + pids=collect(copy(pids)) + ind=findfirst(isequal(myid()),pids) + if ind != nothing + pids[end],pids[ind]=pids[ind],pids[end] + end + @sync begin for i = 1:length(pids) @async begin From 25fb66ac27a55f592f6fc66a5af5bf23b70aeec7 Mon Sep 17 00:00:00 2001 From: Rami Date: Thu, 6 Jun 2019 09:12:03 -0500 Subject: [PATCH 2/2] Update darray.jl --- src/darray.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/darray.jl b/src/darray.jl index 1668903..f728d70 100644 --- a/src/darray.jl +++ b/src/darray.jl @@ -81,7 +81,7 @@ function DArray(id, init, dims, pids, idxs, cuts) localtypes = Vector{DataType}(undef,length(pids)) # fixes issue #206 - pids=collect(copy(pids)) + pids=copy(pids) ind=findfirst(isequal(myid()),pids) if ind != nothing pids[end],pids[ind]=pids[ind],pids[end]