Skip to content

Commit

Permalink
Fix a bug (error couldn't be bounded) happening when setting point-wi…
Browse files Browse the repository at this point in the history
…se relative error bound for 3D double-precision data.
  • Loading branch information
Sheng Di committed Aug 10, 2019
1 parent 8c3c06c commit a7e8c12
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
6 changes: 6 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion sz/include/sz.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions sz/src/sz_double.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down Expand Up @@ -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)
{
Expand Down
16 changes: 7 additions & 9 deletions sz/src/szd_double.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down

0 comments on commit a7e8c12

Please sign in to comment.