Open bentaculum opened 3 years ago
You are right, the "empty" or corrupted chunks are a result of non-chunk-aligned parallel writes by the workers spawned by Scan
. This is only a problem if there are multiple workers, though.
What we could do is to issue a warning whenever ZarrWrite
detects non-aligned writes. What do you think?
I agree, a warning would be helpful.
Zarr also supports multi-process synchronized writes as an experimental feature, so we might think about introducing it to ZarrWrite
. I made a working quick-and-dirty synchronized version for now.
Below is a minimal example of what I'd like to do. Note that the request size (in voxels) is not a power of 2. The chunk size for the new array is chosen automatically, in this example it is set to
(64, 128, 128)
.Presumably due to the leading dimension of the chunk size being smaller than its counterpart in the requestPresumably as the chunk size does not divide the request size, the array on disk has some empty patches from conflicting concurrent write operations on the same chunk.Can we simply expose the chunk size of a new array in
ZarrWrite
to avoid this?