Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gather(d::DArray{T,N,Array{T,N}}) where {T, N} #227

Open
oskarpfeffer opened this issue Nov 11, 2020 · 1 comment
Open

Add gather(d::DArray{T,N,Array{T,N}}) where {T, N} #227

oskarpfeffer opened this issue Nov 11, 2020 · 1 comment

Comments

@oskarpfeffer
Copy link

I am wondering why it is not possible to gather a DArray{T,N,Array{T,N}}?

I wrote this method to the gather function, it works for my purpose. Maybe it is possible to add it? (or maybe I did a mistake and it should be changed somehow?)

function gather(d::DArray{T,N,Array{T,N}}) where {T, N}
    a=Array{T}(undef, size(d))
    indices = collect.(d.indices)
    @sync for (i,p) in enumerate(procs(d))
        @async a[indices[i]...] = remotecall_fetch(localpart, p, d)
    end
    a
end
@raminammour
Copy link
Contributor

This is what Array(d::DArray) does. So it is already implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants