Borrar filtros
Borrar filtros

No parallel read/write with NetCDF4?

4 visualizaciones (últimos 30 días)
Jeffrey
Jeffrey el 30 de Jul. de 2023
Comentada: Walter Roberson el 31 de Jul. de 2023
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 comentarios
Jeffrey
Jeffrey el 31 de Jul. de 2023
Editada: Jeffrey el 31 de Jul. de 2023
Thanks @Walter Roberson, yes, nc_open_par() does look like the intended solution. The function is in the included netcdf library with Matlab,
$ nm -gU /Applications/MATLAB_R2023a.app/bin/maci64/libnetcdf.19.dylib | grep nc_open_par
0000000000003340 T _nc_open_par
0000000000003350 T _nc_open_par_fortran
but looking at the api, it would require setting up MPI. So this is probably something Mathworks will have to implement.
It's kind of an odd regression... I'll have to see what other ideas I can come up with.

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Productos


Versión

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by