Skip to content

Fix mapchunks and write Test for it #476

Open
@schlichtanders

Description

@schlichtanders

While looking for a way to flatten an DArray, I found mapchunks, which looks perfectly suited for this job. Unfortunately it is currently buggy. Probably because there is no test for it.

function mapchunks(f, d::DArray{T,N,F}) where {T,N,F}
chunks = map(d.chunks) do chunk
owner = get_parent(chunk.processor).pid
remotecall_fetch(mapchunk, owner, f, chunk)
end
DArray{T,N,F}(d.domain, d.subdomains, chunks, d.concat)
end

The DArray constructor used here does not exist any longer. There is a new argument - the partitioning - which need to be added.

- DArray{T,N,F}(d.domain, d.subdomains, chunks, d.concat) 
+ DArray{T,N}(d.domain, d.subdomains, chunks, d.partitioning, d.concat) 

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