Skip to content

zarr_monitor

T = TypeVar('T') module-attribute

ZarrMonitor

sympl.Monitor-style object for storing model state dictionaries in a Zarr store.

partitioner = partitioner instance-attribute

__init__(store, partitioner, mpi_comm, *, mode='w')

Create a ZarrMonitor.

Parameters:

Name Type Description Default
store str | MutableMapping

Zarr store in which to store data

required
partitioner Partitioner

object providing grid layout information to the Monitor

required
mpi_comm Comm

mpi4py comm object to use for communications.

required
mode str

mode to use to open the store. Options are as in zarr.open_group.

'w'

store(state)

Append the model state dictionary to the zarr store.

Requires the state contain the same quantities with the same metadata as the first time this is called. Dimension order metadata may change between calls so long as the set of dimensions is the same. Quantities are stored with dimensions [time, rank] followed by the dimensions included in the first state snapshot. The one exception is "time" which is stored with dimensions [time].

store_constant(state)

cleanup()

array_chunks(layout, tile_array_shape, array_dims)

get_calendar(time)