#======================================================================================================
#===========================[ENV] No need to change unless necessary. =================================
#======================================================================================================
[ENV]
#endianType: either LITTLE_ENDIAN_DATA or BIG_ENDIAN_DATA
#x86, x64 and arm adopt LITTLE_ENDIAN_DATA
#PowerPC (PPC), MAC OS, and KEIL C51 adopt BIG_ENDIAN_DATA
#dataEndianType = BIG_ENDIAN_DATA
dataEndianType = LITTLE_ENDIAN_DATA

#solution: SZ, .....
sol_name = SZ


#======================================================================================================
#=================[Compression Parameters] No need to change unless necessary. =======================
#======================================================================================================
[PARAMETER]
#the number of layers to be used in the data prediction
#Examples: layers = 1, 2, or 3 (layers=1 is recommended in most cases)
layers = 1

#sampleDistance determins the number of samples used to optimize the # quantization intervals
#For example, sampleDistance=50 means 1/50=2% of data points are sample points.
#sampleDistance = 100
sampleDistance = 100

#The number of quantization intervals should be always set to an "even" number!
#If it is set to 0, SZ will autamatically search for an optimized setting.
#Otherwise, it has be to no less than 4 and no greater than 65536, such as 256.
quantization_intervals = 0

#maximum quantization interval is valid only when quantization_intervals=0 (i.e., let the sz compressor optimize the intervals)
#In general, this setting does not change the compression ratio/rate, but only affect the compression speed to a certain extent (only 10% in general).
#The high values of max_quant_intervals, the lower compression speed, but the higher ability the compressor can reach high compression ratios for high-precision compression.
#As for low-precision compression (i.e., high error bound such as 1E-2), max_quant_intervals could be set to 256 or 65536.
#As for pretty-high-precision demand (i.e., fairly small error bound such as 1E-6), max_quant_intervals could be set to 2097152(=2^21).
#max_quant_intervals = 2097152
#max_quant_intervals = 262144
max_quant_intervals = 65536
#max_quant_intervals = 128

#predThreshold: the threshold to determine the ratio of predictable data over all data
#predThreshold = 0.97 means 97% of data will be predictable
predThreshold = 0.99

#The following parameter "offset" can be used to tune the compression ratio for hard-to-compress data
##Its value should be 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, or 10.
##Generally, we recommend offset=0.
offset = 0

#SZ_Mode
#two options: SZ_BEST_SPEED or SZ_BEST_COMPRESSION
#szMode = SZ_BEST_COMPRESSION
szMode = SZ_BEST_SPEED

#GZIP_Mode
#Note: this parameter setting is valid only if szMode = SZ_BEST_COMPRESION.
#four options: Gzip_NO_COMPRESSION, or Gzip_BEST_SPEED, Gzip_BEST_COMPRESSION, Gzip_DEFAULT_COMPRESSION
gzipMode = Gzip_BEST_SPEED


#======================================================================================================
#========[Error-control Parameters] The following parameters are better to be changed on demand. ===============
#======================================================================================================

#errorBoundMode: 8 options to control different types of error bounds (detailed can be found in the user guide)
#ABS_AND_REL, ABS_OR_REL, ABS, REL, PW_REL, ABS_AND_PW_REL, ABS_OR_PW_REL, REL_AND_PW_REL, REL_OR_PW_REL
#errorBoundMode = ABS_AND_PW_REL
#errorBoundMode = PW_REL
#errorBoundMode = PSNR
errorBoundMode = ABS

#absolute Error Bound (NOTE: it's valid when errorBoundMode is related to ABS (i.e., absolute error bound)
#absErrBound is to limit the (de)compression errors to be within an absolute error. For example, absErrBound=0.0001 means the decompressed value must be in [V-0.0001,V+0.0001], where V is the original true value.
#absErrBound = 1E-3
#absErrBound = 0.0000000001
#absErrBound = 1E-3
absErrBound = 2

#relative Bound Ratio (NOTE: it's valid only when errorBoundMode is related to REL (i.e., value_range based relative error bound)
#relErrBound is to limit the (de)compression errors by considering the global data value range size (i.e., taking into account the range size (max_value - min_value)).
#For example, suppose relBoundRatio is set to 0.01, and the data set is {100,101,102,103,104,...,110}, so the global value range size is 110-100=10, so the error bound will actually be 10*0.01=0.1, from the perspective of "relBoundRatio"
relBoundRatio = 1E-4

#expected PSNR (Note: only valid when errorBoundMode = PSNR)
#psnr is to spesify the PSNR of the compression. It's valid only when errorBoundMode == PSNR
psnr = 80

#point-wise relative Bound Ratio (NOTE: only valid when errorBoundMode is related to PW_REL)
#pw_relBountRatio is to limit the (de)compression errors by considering the point-wise original data values.
#For example, suppose pw_relBoundRatio is set to 0.01, and the data set is {100,101,102,103,104,...,110}, so the compression errors will be limited to {1,1.01,1.02,....1.10} for the data points.
#Only valid when errorBoundMode = PW_REL
pw_relBoundRatio = 1E-2

#============================================================================================================================
#========[Block Setting Parameters] They are used to refine block settings for point-wise relative error bound ==============
#============================================================================================================================

#point-wise relative-error-bound segment size
#The larger this value, the lower overhead of maitaining error bound information for each segment/block, while the stricter absolute bound used to control the point-wise relative-error-bound. The block size will be M^K, where K is the # dimensions of the data and M is an integer such that (M-1)^K < segment_size <= M^K. For instance, for a 2D data, segment_size=32 means the whole data set will be split into multiple small blocks each being 6x6. For a 3D data, segment_size=32 means the whole data set is split into a lot of 4x4x4 blocks, each of which has an individual compression precision/error.
segment_size = 25

#point-wise relative-error-bound type
#This parameter is valid only when error bound mode is set to PW_REL
#Three optional types: MAX, AVG, MIN
#MAX means that the max relative error bound will be adopted in each block (i.e., the error bound is determined by the maximum absolute data value in that block).
#MIN indicates that the min relative error bound will be adopted in each block. 
#AVG indicates that the avg error bound will be adopted. 
pwr_type = MIN
