Closed
Description
I recommend making the interface for distribute more consistent with DArray by adding an optional procs argument. This will allow for an array distributed to a subset of the workers. A common use case is testing the performance of different numbers of workers on a task.
function distribute(a::AbstractArray, procs=workers()[1:min(nworkers(), maximum(size(a)))])
owner = myid()
rr = RemoteRef()
put!(rr, a)
d = DArray(size(a), procs) do I
remotecall_fetch(owner, ()->fetch(rr)[I...])
end
# Ensure that all workers have fetched their localparts.
# Else a gc in between can recover the RemoteRef rr
for chunk in d.chunks
wait(chunk)
end
d
end
Metadata
Metadata
Assignees
Labels
No labels