No parallel read/write with NetCDF4?
4 views (last 30 days)
Show older comments
Parallel reading and writing of NetCDF version 4 files does not seem to work in Matlab. Is this correct?
Previously, I would create a file with,
netcdf.create('myfile.nc', bitor(netcdf.getConstant('SHARE'),netcdf.getConstant('WRITE')));
which creates a NetCDF version 3, and allows me to read that file while it is being written (think multi-hour model run). However, I need some new features only available in NetCDF version 4, so I switched to,
netcdf.create('myfile.nc', netcdf.getConstant('NETCDF4'));
which gives me the new features I want, but now I can no longer read the NetCDF file as it is being written! To test this you can call,
netcdf.open('myfile.nc', bitor(netcdf.getConstant('SHARE'),netcdf.getConstant('WRITE')));
from a new Matlab instance and the former will work, but the later will fail.
Looking at the NetCDF documentation, it looks like this should be possible, provided HDF5 is compiled with the parallel flag. Does Matlab simply not have this enabled? Or am I missing an option?
Thank you.
edit: Added code to reproduce.
5 Comments
Walter Roberson
on 31 Jul 2023
MATLAB Parallel Computing Toolbox is built with MPI, which is used for spmd .
Answers (0)
See Also
Categories
Find more on NetCDF in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!