Closed mathomp4 closed 1 month ago
ok. As long as we are making changes here, it would be very useful if all the cases used 2 digits. It has been problematic in the past run "case2" because it maches "case2*".
Ahh. I can look at this. Let me do some fun with f2
and sed...
OK, but how about zstandard compression?
OK, but how about zstandard compression?
@edwardhartnett We can't add a test for it because we have no support for it in MAPL. Period.
We can work toward it, but that will take a while because we'd need to make sure we can build it correctly in our libraries, etc.
If you can help me with all the steps needed for that, I can work on it. I know I know there are a lot of changes needed to support it, right? I think have to manually set --enable-zstandard-plugin
for autotools and netcdf-fortran.
But perhaps I need to convert to CMake? When I look at netcdf-fortran CMake, it seems to default to enabling zstd support:
OPTION(DISABLE_ZSTANDARD_PLUGIN "Disable ZStandard plugin detection and functionality, even if libnetcdf was compiled with plugin support" OFF)
But before that I think I need start building hdf5_plugins as well? And as far as I can see, you can only get the zstandard plugin via CMake since configure.ac
doesn't have any mention of zstandard.
...And so that probably means I need to set up HDF5 to build with CMake maybe? It might be an effort.
Building is a separate topic, but you can check for the presence of zstd the same way (I presume) you check for quantization, the netcdf_meta.h file. There is a HAS_ZSTD macro there if zstd is supported.
To use it, from F90, just change the deflate_level parameter in nf90_def_var() to zstandard_level.
In C, call nc_def_var_zstandard() instead of nc_def_var_deflate().
Building is a separate topic, but you can check for the presence of zstd the same way (I presume) you check for quantization, the netcdf_meta.h file. There is a HAS_ZSTD macro there if zstd is supported.
To use it, from F90, just change the deflate_level parameter in nf90_def_var() to zstandard_level.
In C, call nc_def_var_zstandard() instead of nc_def_var_deflate().
@edwardhartnett Yes, I know it would be fairly simple to add support to MAPL, but I'm reluctant to add code to MAPL supporting an option I cannot yet test.
If there is a simple way of building netcdf-fortran using spack that has zstd support, then I could prototype under that.
Yes, spack builds netcdf-c and netcdf-fortran with zstd.
Types of change(s)
Checklist
make tests
)Description
Recently, @edwardhartnett asked if MAPL had some sort of unit test that tested our compressed output. And, nope, we did not have any.
So, this PR adds 5 new ExtData test cases to allow us to test writing of History with compression, bit-shaving, and quantization. The new tests are all "copies" of case1 with additions to the
HISTORY1.rc
file in each:As the list says, the last three are only turned on if we detect NetCDF quantize support was built.
Related Issue