Skip to content

Commit

Permalink
bsc 3.3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
IlyaGrebnov committed Jan 25, 2024
1 parent 1cedce3 commit cb2ceeb
Show file tree
Hide file tree
Showing 36 changed files with 931 additions and 65 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Changes in 3.3.4 (January, 24 2024)
- Implemented GPU acceleration of reverse Burrows�Wheeler transform.

Changes in 3.3.3 (November, 26 2023)
- Fixed out-of-bound memory access issue for large inputs.
- Slightly improved compression performance.
Expand Down
7 changes: 4 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ block-sorting data compression algorithms.
libbsc is a library based on bsc, it uses the same algorithms
as bsc and enables you to compress memory blocks.

Copyright (c) 2009-2023 Ilya Grebnov <[email protected]>
Copyright (c) 2009-2024 Ilya Grebnov <[email protected]>

See file AUTHORS for a full list of contributors.

Expand All @@ -21,7 +21,7 @@ See the bsc and libbsc web site:
Software License:
-----------------

Copyright (c) 2009-2023 Ilya Grebnov <[email protected]>
Copyright (c) 2009-2024 Ilya Grebnov <[email protected]>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -54,7 +54,8 @@ Compression and decompression requirements are the same and in bytes, can
be estimated as 16Mb + 5 x block size x number of blocks processed in parallel.

GPU memory usage for NVIDIA CUDA technology is different from CPU memory usage
and can be estimated as 20 x block size for ST and 21 x block size for BWT.
and can be estimated as 20 x block size for ST, 21 x block size for forward BWT
and 7 x block size for inverse BWT.


NVIDIA GPU acceleration:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.3
3.3.4
6 changes: 3 additions & 3 deletions bsc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
This file is a part of bsc and/or libbsc, a program and a library for
lossless, block-sorting data compression.
Copyright (c) 2009-2021 Ilya Grebnov <[email protected]>
Copyright (c) 2009-2024 Ilya Grebnov <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -869,8 +869,8 @@ void ProcessCommandline(int argc, char * argv[])

int main(int argc, char * argv[])
{
fprintf(stdout, "This is bsc, Block Sorting Compressor. Version 3.3.3. 26 November 2023.\n");
fprintf(stdout, "Copyright (c) 2009-2023 Ilya Grebnov <[email protected]>.\n\n");
fprintf(stdout, "This is bsc, Block Sorting Compressor. Version 3.3.4. 24 January 2024.\n");
fprintf(stdout, "Copyright (c) 2009-2024 Ilya Grebnov <[email protected]>.\n\n");

#if defined(_OPENMP) && defined(__INTEL_COMPILER)

Expand Down
2 changes: 1 addition & 1 deletion libbsc/adler32/adler32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
This file is a part of bsc and/or libbsc, a program and a library for
lossless, block-sorting data compression.
Copyright (c) 2009-2021 Ilya Grebnov <[email protected]>
Copyright (c) 2009-2024 Ilya Grebnov <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion libbsc/adler32/adler32.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
This file is a part of bsc and/or libbsc, a program and a library for
lossless, block-sorting data compression.
Copyright (c) 2009-2021 Ilya Grebnov <[email protected]>
Copyright (c) 2009-2024 Ilya Grebnov <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
54 changes: 52 additions & 2 deletions libbsc/bwt/bwt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
This file is a part of bsc and/or libbsc, a program and a library for
lossless, block-sorting data compression.
Copyright (c) 2009-2021 Ilya Grebnov <[email protected]>
Copyright (c) 2009-2024 Ilya Grebnov <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -226,13 +226,63 @@ int bsc_bwt_encode(unsigned char * T, int n, unsigned char * num_indexes, int *
return LIBBSC_NOT_ENOUGH_MEMORY;
}

int bsc_bwt_gpu_decode(unsigned char * T, int n, int index, int features)
{
int result = -1;

#ifdef LIBBSC_CUDA_SUPPORT
if (features & LIBBSC_FEATURE_CUDA)
{
int storage_approx_length = (n / 3) | 0x1fffff;

#ifdef LIBBSC_OPENMP
omp_set_lock(&bwt_cuda_lock);

if (bwt_cuda_device_storage_size < storage_approx_length)
{
if (bwt_cuda_device_storage != NULL)
{
libcubwt_free_device_storage(bwt_cuda_device_storage);

bwt_cuda_device_storage = NULL;
bwt_cuda_device_storage_size = 0;
}

if (libcubwt_allocate_device_storage(&bwt_cuda_device_storage, storage_approx_length + (storage_approx_length / 32)) == LIBCUBWT_NO_ERROR)
{
bwt_cuda_device_storage_size = storage_approx_length + (storage_approx_length / 32);
}
}

if (bwt_cuda_device_storage_size >= storage_approx_length)
{
result = (int)libcubwt_unbwt(bwt_cuda_device_storage, T, T, n, NULL, index);
}

omp_unset_lock(&bwt_cuda_lock);
#else
void * bwt_cuda_device_storage = NULL;

if (libcubwt_allocate_device_storage(&bwt_cuda_device_storage, storage_approx_length) == LIBCUBWT_NO_ERROR)
{
result = (int)libcubwt_unbwt(bwt_cuda_device_storage, T, T, n, NULL, index);

libcubwt_free_device_storage(bwt_cuda_device_storage);
}
#endif
}
#endif

return result;
}

int bsc_bwt_decode(unsigned char * T, int n, int index, unsigned char num_indexes, int * indexes, int features)
{
if ((T == NULL) || (n < 0) || (index <= 0) || (index > n))
{
return LIBBSC_BAD_PARAMETER;
}
if (n <= 1)
if (n <= 1 || bsc_bwt_gpu_decode(T, n, index, features) == 0)
{
return LIBBSC_NO_ERROR;
}
Expand Down
2 changes: 1 addition & 1 deletion libbsc/bwt/bwt.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
This file is a part of bsc and/or libbsc, a program and a library for
lossless, block-sorting data compression.
Copyright (c) 2009-2021 Ilya Grebnov <[email protected]>
Copyright (c) 2009-2024 Ilya Grebnov <[email protected]>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
3 changes: 2 additions & 1 deletion libbsc/bwt/libcubwt/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
Leyuan Wang, Sean Baxter, John D. Owens, Yury Shukhrov,
Rory Mitchell, Jacopo Pantaleoni, Duane Merrill,
Georgy Evtushenko, Allison Vacanti, Robert Crovella,
Mark Harris.
Mark Harris, Vitaly Osipov, Andy Adinets, Elias Stehle,
Michael Maniscalco.
3 changes: 3 additions & 0 deletions libbsc/bwt/libcubwt/CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Changes in 1.6.0 (January 24, 2024)
- Inverse Burrows-Wheeler transform.

Changes in 1.5.0 (March 24, 2023)
- Reduced memory usage and improved performance.

Expand Down
2 changes: 1 addition & 1 deletion libbsc/bwt/libcubwt/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.5.0
1.6.0
Loading

0 comments on commit cb2ceeb

Please sign in to comment.