When using ADIOS2 2.10.1 release with BZip2 compression enabled, attempts to compress very small datasets (in this case, an array of 9 integers) result in a runtime error:
[ADIOS2 ERROR] <Helper> <adiosSystem> <ExceptionToError> : adios2_put: [ADIOS2 EXCEPTION] <Operator> <CompressBZIP2> <CheckStatus> : BZ_OUTBUFF_FULL BZIP2 detected size of compressed data is larger than destination length in call to ADIOS2 BZIP2 Compress batch 0
This error is unexpected, as one might assume smaller data sizes would be easier to compress, and no buffer issues would arise. Setting the data length to 10 or higher avoids the error.
Expected Behavior
The library should handle small data sizes without a buffer overflow or provide a more descriptive error message indicating limitations on BZip2 compression for small datasets.
Proposed Solution
To improve usability, the ADIOS2 library could:
Adjust internal buffer allocations to handle small data sizes with BZip2.
Implement a pre-check on data size, recommending a minimum size for BZip2 compression, or handle the compression gracefully at small sizes by padding or using an alternative compression approach.
Test Case
The following code reproduces the issue. When DATA_LEN is set to 9, it triggers the error, whereas setting it to 10 works as expected.
Issue Description
When using ADIOS2 2.10.1 release with BZip2 compression enabled, attempts to compress very small datasets (in this case, an array of 9 integers) result in a runtime error:
[ADIOS2 ERROR] <Helper> <adiosSystem> <ExceptionToError> : adios2_put: [ADIOS2 EXCEPTION] <Operator> <CompressBZIP2> <CheckStatus> : BZ_OUTBUFF_FULL BZIP2 detected size of compressed data is larger than destination length in call to ADIOS2 BZIP2 Compress batch 0
This error is unexpected, as one might assume smaller data sizes would be easier to compress, and no buffer issues would arise. Setting the data length to 10 or higher avoids the error.
Expected Behavior
The library should handle small data sizes without a buffer overflow or provide a more descriptive error message indicating limitations on BZip2 compression for small datasets.
Proposed Solution
To improve usability, the ADIOS2 library could:
Test Case
The following code reproduces the issue. When DATA_LEN is set to 9, it triggers the error, whereas setting it to 10 works as expected.