Skip to content

Commit fc0c137

Browse files
committed
fixup
1 parent d2e9e19 commit fc0c137

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/core.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,12 +443,14 @@ Convert a local array to distributed.
443443
function distribute(A::AbstractArray;
444444
procs = workers()[1:min(nworkers(), maximum(size(A)))],
445445
dist = defaultdist(size(A), procs))
446+
np = prod(dist)
447+
procs_used = procs[1:np]
446448
idxs, _ = chunk_idxs([size(A)...], dist)
447449

448-
s = verified_destination_serializer(reshape(procs, size(idxs)), size(idxs)) do pididx
450+
s = verified_destination_serializer(reshape(procs_used, size(idxs)), size(idxs)) do pididx
449451
A[idxs[pididx]...]
450452
end
451-
return DArray(I->localpart(s), size(A), procs, dist)
453+
return DArray(I->localpart(s), size(A), procs_used, dist)
452454
end
453455

454456
"""

0 commit comments

Comments
 (0)