Skip to content

Supporting variable-length chunks for Zarr v3 #278

@glwagner

Description

@glwagner

Is there a plan to support variable-length (per-axis irregular) chunks in Zarr v3?

The two relevant extensions are rectangular (ZEP 0003) and rectilinear (zarr-extensions) — both currently experimental. Reference impl: zarrs (Rust) has both.

Today Zarr.jl rejects anything but regular:

Zarr.jl/src/metadata3.jl

Lines 214 to 223 in 03270b2

# Chunk Grid
chunk_grid = d["chunk_grid"]
if chunk_grid["name"] == "regular"
chunks = Int.(chunk_grid["configuration"]["chunk_shape"])
if length(shape) != length(chunks)
throw(ArgumentError("Shape has rank $(length(shape)) which does not match the chunk_shape rank of $(length(chunks))"))
end
else
throw(ArgumentError("Unknown chunk_grid of name, $(chunk_grid["name"])"))
end

This will be useful for distributed output in Oceananigans with variably-sized partitions, eg when the simulation is divided into regions that communicate via MPI, but those regions have different sizes (because of continents) in order to balance the load between different nodes.

cc @simone-silvestri, @vopikamm, @giordano

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions