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

Fix mapchunks and write Test for it #476

Open
schlichtanders opened this issue Mar 5, 2024 · 1 comment
Open

Fix mapchunks and write Test for it #476

schlichtanders opened this issue Mar 5, 2024 · 1 comment

Comments

@schlichtanders
Copy link

schlichtanders commented Mar 5, 2024

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) 
@schlichtanders
Copy link
Author

schlichtanders commented Mar 5, 2024

Furthermore, it would be great if

  • mapchunks also supports EagerThunk
  • mapchunks handles the new DArray type T correctly. (By inspecting the mapped chunks, or falling back to type-inference or Any, if there are no chunks)

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

1 participant