Changeset 2531
- Timestamp:
- 07/19/23 16:11:39 (18 months ago)
- Location:
- XIOS3/branches/xios-3.0-beta/src/io
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS3/branches/xios-3.0-beta/src/io/netCdfInterface.cpp
r2530 r2531 791 791 { 792 792 pluginLibName = "libhdf5sz.so"; 793 } 794 else if ( filterId == 32013 ) // 32013 = ZFP 795 { 796 pluginLibName = "libh5zzfp.so"; 793 797 } 794 798 if (cplugin) -
XIOS3/branches/xios-3.0-beta/src/io/onetcdf4.cpp
r2530 r2531 540 540 CNetCdfInterface::defVarFilter(grpid, varid, 32017, cd_nelmts, cd_values); 541 541 } 542 else if (compressionType=="ZFP") 543 { 544 CONetCDF4Plugin::interpretParametersZFP(compressionParams, &cd_nelmts, &cd_values); 545 CNetCdfInterface::defVarFilter(grpid, varid, 32013, cd_nelmts, cd_values); 546 } 542 547 else 543 548 { -
XIOS3/branches/xios-3.0-beta/src/io/onetcdf4_plugin.hpp
r2530 r2531 46 46 } 47 47 48 //! Compute HDF5 plugin parameters from ZFP parameters 49 static void interpretParametersZFP(const CArray<double,1>& inParams, size_t* nOutParams, unsigned int **outParams) 50 { 51 if (inParams.numElements()==0) // N = f( mode ) 52 { 53 ERROR("CONetCDF4Plugin::interpretParametersSZ(...)", "The 1st parameter of ZFP compressor is the mode, must be lower or equal to 5" ); 54 } 55 56 // https://github.com/LLNL/H5Z-ZFP/blob/master/test/test_write.c#L237 57 // https://github.com/LLNL/H5Z-ZFP/blob/master/src/H5Zzfp_version.h 58 if (inParams(0) == 1) *nOutParams = 4; // RATE (mode=1) : 1 double 59 else if (inParams(0) == 2) *nOutParams = 3; // PRECISION (mode=2) : 2 unsigned int 60 else if (inParams(0) == 3) *nOutParams = 4; // ACCURACY (mode=3) : 1 double 61 else if (inParams(0) == 4) *nOutParams = 6; // EXPERT (mode=4) : 3 unsigned int + 1 int 62 else if (inParams(0) == 5) *nOutParams = 1; // REVERSIBLE (mode=5) : - 63 64 *outParams = new unsigned int[*nOutParams]; 65 66 // https://github.com/LLNL/H5Z-ZFP/blob/master/src/H5Zzfp_plugin.h 67 (*outParams)[0] = (unsigned int)(inParams(0)); 68 (*outParams)[1] = 0; 69 if ((inParams(0) == 1)||(inParams(0) == 3)) 70 { 71 memcpy( &((*outParams)[2]), &(inParams(1)), sizeof(double) ); 72 } 73 else if (inParams(0) == 2) 74 { 75 (*outParams)[2] = (unsigned int)(inParams(1)); 76 } 77 else if (inParams(0) == 4) 78 { 79 (*outParams)[2] = (unsigned int)(inParams(1)); 80 (*outParams)[3] = (unsigned int)(inParams(2)); 81 (*outParams)[4] = (unsigned int)(inParams(3)); 82 (*outParams)[5] = (unsigned int)(inParams(4)); 83 } 84 85 } 48 86 }; 49 87 }
Note: See TracChangeset
for help on using the changeset viewer.