No parallel read/write with NetCDF4?

6 ビュー (過去 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.
Walter Roberson
Walter Roberson 2023 年 7 月 31 日

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeNetCDF についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by