From a7e8c126e3c5af0da20fe5d3a46a82d5dcac31e3 Mon Sep 17 00:00:00 2001 From: Sheng Di Date: Fri, 9 Aug 2019 23:31:34 -0500 Subject: [PATCH] Fix a bug (error couldn't be bounded) happening when setting point-wise relative error bound for 3D double-precision data. --- README | 6 ++++++ sz/include/sz.h | 2 +- sz/src/sz_double.c | 4 +--- sz/src/szd_double.c | 16 +++++++--------- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README b/README index 84f21f36..94b36a41 100644 --- a/README +++ b/README @@ -160,3 +160,9 @@ SZ 2.0.0.0: Significantly improve the compression quality for the high-compressi SZ 2.0.1.0: Further improve the compression quality for high-compression cases than 2.0.0.0. Moreover, improve point-wise relative error bounded compression. SZ 2.0.2.0: Further improve the compression/decompression rate and also compression ratio (by 10-20%), by replacing Zlib by Zstd as default setting. SZ 2.1: Significantly improve the compressoin speed for point-wise relative error bound (please see our paper published in MSST19 for details) +SZ 2.1.1: We accelerated compression for absolute error bound slightly. We fixed the compilation issue for OSX. +SZ 2.1.2: Fix memory a little memory leak for point-wise relative error bound Remove a useless step (optimization of # quantization bins) for point-wise relative error bound mode, such that the compression rate is further improved (3%). +SZ 2.1.4.1: Fix a few bugs which were introduced when integrating fast point-wise relative error bounded compression. The bugs could cause unbounded decompression and slow speed, especially for 1D datasets. CMakeLists are also revised to enable SZ to be compiled on Cray system such as Cori. +SZ 2.1.4.2: Revise a bug in 2.1.4.2: The bug happened only when the data size is too small (smaller than a datablock such as 6x6x6) for 2D and 3D cases. +SZ 2.1.5: Fix some bugs in temporal compression and support random-access variable selection for compression/decompression. Fix compilation bug for Fortran version. +SZ 2.1.6: Fix a bug (error couldn't be bounded) happening when setting point-wise relative error bound for 3D double-precision data. diff --git a/sz/include/sz.h b/sz/include/sz.h index eba9b9b3..4bb13946 100644 --- a/sz/include/sz.h +++ b/sz/include/sz.h @@ -81,7 +81,7 @@ extern "C" { #define SZ_VERNUM 0x0200 #define SZ_VER_MAJOR 2 #define SZ_VER_MINOR 1 -#define SZ_VER_BUILD 5 +#define SZ_VER_BUILD 6 #define SZ_VER_REVISION 1 #define PASTRI 103 diff --git a/sz/src/sz_double.c b/sz/src/sz_double.c index c330faf1..02f05b08 100644 --- a/sz/src/sz_double.c +++ b/sz/src/sz_double.c @@ -2202,8 +2202,6 @@ TightDataPointStorageD* SZ_compress_double_3D_MDQ_MSST19(double *oriData, size_t if (state) { type[index] = state; - //double temp1 = precisionTable[state]; - //double temp = fabsf(pred2D) * precisionTable[state]; P1[index] = fabs(pred2D) * precisionTable[state]; //hit++; } @@ -4232,7 +4230,7 @@ unsigned int optimize_intervals_double_3D_opt_MSST19(double *oriData, size_t r1, while(data_pos - oriData < len){ totalSampleSize++; pred_value = data_pos[-1] + data_pos[-r3] + data_pos[-r23] - data_pos[-1-r23] - data_pos[-r3-1] - data_pos[-r3-r23] + data_pos[-r3-r23-1]; - pred_err = fabsf(*data_pos / pred_value); + pred_err = fabs(*data_pos / pred_value); radiusIndex = fabs(log2(pred_err)/divider+0.5); if(radiusIndex>=confparams_cpr->maxRangeRadius) { diff --git a/sz/src/szd_double.c b/sz/src/szd_double.c index c00da956..14a194bd 100644 --- a/sz/src/szd_double.c +++ b/sz/src/szd_double.c @@ -2222,7 +2222,7 @@ void decompressDataSeries_double_3D_MSST19(double** data, size_t r1, size_t r2, type_ = type[jj]; if (type_ != 0) { - (*data)[jj] = fabsf(pred1D) * precisionTable[type_]; + (*data)[jj] = fabs(pred1D) * precisionTable[type_]; } else { @@ -2280,7 +2280,7 @@ void decompressDataSeries_double_3D_MSST19(double** data, size_t r1, size_t r2, type_ = type[index]; if (type_ != 0) { - (*data)[index] = fabsf(pred1D) * precisionTable[type_]; + (*data)[index] = fabs(pred1D) * precisionTable[type_]; } else { @@ -2336,9 +2336,7 @@ void decompressDataSeries_double_3D_MSST19(double** data, size_t r1, size_t r2, type_ = type[index]; if (type_ != 0) { - //double ppp = precisionTable[type_]; - //double test = fabsf(pred2D) * precisionTable[type_]; - (*data)[index] = fabsf(pred2D) * precisionTable[type_]; + (*data)[index] = fabs(pred2D) * precisionTable[type_]; } else { @@ -2397,7 +2395,7 @@ void decompressDataSeries_double_3D_MSST19(double** data, size_t r1, size_t r2, type_ = type[index]; if (type_ != 0) { - (*data)[index] = fabsf(pred1D) * precisionTable[type_]; + (*data)[index] = fabs(pred1D) * precisionTable[type_]; } else { @@ -2453,7 +2451,7 @@ void decompressDataSeries_double_3D_MSST19(double** data, size_t r1, size_t r2, type_ = type[index]; if (type_ != 0) { - (*data)[index] = fabsf(pred2D) * precisionTable[type_]; + (*data)[index] = fabs(pred2D) * precisionTable[type_]; } else { @@ -2511,7 +2509,7 @@ void decompressDataSeries_double_3D_MSST19(double** data, size_t r1, size_t r2, type_ = type[index]; if (type_ != 0) { - (*data)[index] = fabsf(pred2D) * precisionTable[type_]; + (*data)[index] = fabs(pred2D) * precisionTable[type_]; } else { @@ -2570,7 +2568,7 @@ void decompressDataSeries_double_3D_MSST19(double** data, size_t r1, size_t r2, type_ = type[index]; if (type_ != 0) { - (*data)[index] = fabsf(pred3D) * precisionTable[type_]; + (*data)[index] = fabs(pred3D) * precisionTable[type_]; } else {