xarray
xarray copied to clipboard
Allow us to create space and later write to an existing NetCDF file object
What is your issue?
I'm writing an MPI enabled Xarray accessor and one of the caveats with HDF5/NetCDF in parallel is that the metadata and space inside the file needs to be created up front and collectively by all ranks in the communicator. After creation those ranks can then do non-collective write operations to disk.
Does xarray have this capability somewhere already? i.e. something like the following.
f = netcdf_file_object # open the netcdf file
# x is a Dataarray or Dataset
x.create_netcdf(f)
x.write_netcdf(f)
Cheers!
Unfortunately, I don't think we support this for netCDF yet. We do have such an API for Zarr files: https://docs.xarray.dev/en/stable/user-guide/io.html#distributed-writes