No parallel read/write with NetCDF4?

조회 수: 3 (최근 30일)
Jeffrey
Jeffrey 2023년 7월 30일
댓글: Walter Roberson 2023년 7월 31일
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
Jeffrey
Jeffrey 2023년 7월 31일
편집: Jeffrey 2023년 7월 31일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 NetCDF에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by