Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to have incorrect numbers with PW_REL? #16

Closed
jychoi-hpc opened this issue Sep 7, 2017 · 4 comments
Closed

Possible to have incorrect numbers with PW_REL? #16

jychoi-hpc opened this issue Sep 7, 2017 · 4 comments

Comments

@jychoi-hpc
Copy link

I am trying to check if I am getting right values with PW_REL method.
Wi the following line in "sz.config" (other parts are same with the file in example):

errorBoundMode = PW_REL
relBoundRatio = 1E-2

After running the following line followed by decompression, the pw relative error I calculated is different from what I expected (I expect lower than 1E-1):

$ ./testdouble_compress sz.config testdouble_8_8_128.dat 8 128  

My calculation is 0.159883. I used some code something like:

    for (i = 0; i < nbEle; i++)
    {
        rel = fabs(ori_data[i]-data[i])/fabs(ori_data[i]);
        if (relMax < rel) relMax = rel;
    }
    printf ("Max pw_relative error = %g\n", relMax);

I am wondering if this is the right result or I did use incorrectly.

@disheng222
Copy link
Collaborator

disheng222 commented Sep 7, 2017 via email

@jychoi-hpc
Copy link
Author

I see. After using the above parameters, it works now. Thanks.

@jychoi-hpc
Copy link
Author

I got another problem related with this. If I use SZ_Init_Params instead of SZ_Init(file), I have no compression with PW_REL. It works with REL or ABS.

I used the following code for init:

    sz_params sz;
    memset(&sz, 0, sizeof(sz_params));
    sz.max_quant_intervals = 65536;
    sz.quantization_intervals = 0;
    sz.dataEndianType = LITTLE_ENDIAN_DATA;
    sz.sysEndianType = LITTLE_ENDIAN_DATA;
    sz.sol_ID = SZ;
    sz.layers = 1;
    sz.sampleDistance = 100;
    sz.predThreshold = 0.99;
    sz.offset = 0;
    sz.szMode = SZ_BEST_COMPRESSION; //SZ_BEST_SPEED; //SZ_DEFAULT_COMPRESSION;
    sz.gzipMode = 1;
    sz.errorBoundMode = PW_REL; //REL; //PW_REL;
    sz.absErrBound = 1E-4;
    sz.relBoundRatio = 1E-3;
    sz.psnr = 80.0;
    sz.pw_relBoundRatio = 1E-2;
    sz.segment_size = 32;
    sz.pwr_type = SZ_PWR_MIN_TYPE;
    SZ_Init_Params(&sz);

@disheng222
Copy link
Collaborator

disheng222 commented Sep 9, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants