Skip to content

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

@oskarpfeffer

Description

@oskarpfeffer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions