Skip to content

Commit

Permalink
release 2.1.7: accelerate absolute error bound compression; also add …
Browse files Browse the repository at this point in the history
…the support of double-precision for openmp version (absolute error bound)
  • Loading branch information
Sheng Di committed Oct 1, 2019
1 parent 26f364b commit 513c655
Show file tree
Hide file tree
Showing 7 changed files with 999 additions and 89 deletions.
21 changes: 19 additions & 2 deletions example/sz_openmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,25 @@ int main(int argc, char* argv[])
}
else if(parallelMode==1)//openMP
{
printf("Error: current openMP version supports only float datatype\n");
exit(0);
if(r5>0)
r3 = r5*r4*r3;
else if(r4>0)
r3 = r4*r3;
if(confparams_cpr->errorBoundMode!=ABS)
{
printf("Error: current version supports only absolute error bound (errorBoundMode=%d)\n", confparams_cpr->errorBoundMode);
exit(0);
}

cost_start_omp();
if(r2==0)
bytes = SZ_compress_double_1D_MDQ_openmp(data, r1, confparams_cpr->absErrBound, &outSize);
else if(r3==0)
bytes = SZ_compress_double_2D_MDQ_openmp(data, r2, r1, confparams_cpr->absErrBound, &outSize);
else //3d
bytes = SZ_compress_double_3D_MDQ_openmp(data, r3, r2, r1, confparams_cpr->absErrBound, &outSize);
printf("outSize=%zu\n", outSize);
cost_end_omp();
}

if(cmpPath == NULL)
Expand Down
2 changes: 2 additions & 0 deletions sz/include/sz_double.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ unsigned int optimize_intervals_double_3D_opt(double *oriData, size_t r1, size_t
unsigned int optimize_intervals_double_2D_opt(double *oriData, size_t r1, size_t r2, double realPrecision);
unsigned int optimize_intervals_double_1D_opt(double *oriData, size_t dataLength, double realPrecision);

size_t SZ_compress_double_3D_MDQ_RA_block(double * block_ori_data, double * mean, size_t dim_0, size_t dim_1, size_t dim_2, size_t block_dim_0, size_t block_dim_1, size_t block_dim_2, double realPrecision, double * P0, double * P1, int * type, double * unpredictable_data);

unsigned int optimize_intervals_double_1D_opt_MSST19(double *oriData, size_t dataLength, double realPrecision);
unsigned int optimize_intervals_double_2D_opt_MSST19(double *oriData, size_t r1, size_t r2, double realPrecision);
unsigned int optimize_intervals_double_3D_opt_MSST19(double *oriData, size_t r1, size_t r2, size_t r3, double realPrecision);
Expand Down
12 changes: 8 additions & 4 deletions sz/include/sz_omp.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,21 @@ extern "C" {
#endif

unsigned char * SZ_compress_float_1D_MDQ_openmp(float *oriData, size_t r1, double realPrecision, size_t * comp_size);

unsigned char * SZ_compress_float_2D_MDQ_openmp(float *oriData, size_t r1, size_t r2, double realPrecision, size_t * comp_size);

unsigned char * SZ_compress_float_3D_MDQ_openmp(float *oriData, size_t r1, size_t r2, size_t r3, float realPrecision, size_t * comp_size);

void decompressDataSeries_float_1D_openmp(float** data, size_t r1, unsigned char* comp_data);

void decompressDataSeries_float_3D_openmp(float** data, size_t r1, size_t r2, size_t r3, unsigned char* comp_data);

void decompressDataSeries_float_2D_openmp(float** data, size_t r1, size_t r2, unsigned char* comp_data);

unsigned char * SZ_compress_double_1D_MDQ_openmp(double *oriData, size_t r1, double realPrecision, size_t * comp_size);
unsigned char * SZ_compress_double_2D_MDQ_openmp(double *oriData, size_t r1, size_t r2, double realPrecision, size_t * comp_size);
unsigned char * SZ_compress_double_3D_MDQ_openmp(double *oriData, size_t r1, size_t r2, size_t r3, double realPrecision, size_t * comp_size);

void decompressDataSeries_double_1D_openmp(double** data, size_t r1, unsigned char* comp_data);
void decompressDataSeries_double_2D_openmp(double** data, size_t r1, size_t r2, unsigned char* comp_data);
void decompressDataSeries_double_3D_openmp(double** data, size_t r1, size_t r2, size_t r3, unsigned char* comp_data);

//void Huffman_init_openmp(HuffmanTree* huffmanTree, int *s, size_t length, int thread_num);
void Huffman_init_openmp(HuffmanTree* huffmanTree, int *s, size_t length, int thread_num, size_t * freq);

Expand Down
2 changes: 2 additions & 0 deletions sz/include/szd_double.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ void getSnapshotData_double_4D(double** data, size_t r1, size_t r2, size_t r3, s
void decompressDataSeries_double_2D_nonblocked_with_blocked_regression(double** data, size_t r1, size_t r2, unsigned char* comp_data, double* hist_data);
void decompressDataSeries_double_3D_nonblocked_with_blocked_regression(double** data, size_t r1, size_t r2, size_t r3, unsigned char* comp_data, double* hist_data);

size_t decompressDataSeries_double_3D_RA_block(double * data, double mean, size_t dim_0, size_t dim_1, size_t dim_2, size_t block_dim_0, size_t block_dim_1, size_t block_dim_2, double realPrecision, int * type, double * unpredictable_data);

int SZ_decompress_args_double(double** newData, size_t r5, size_t r4, size_t r3, size_t r2, size_t r1, unsigned char* cmpBytes, size_t cmpSize, int compressionType, double* hist_data);

#ifdef __cplusplus
Expand Down
Loading

0 comments on commit 513c655

Please sign in to comment.