Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
94 commits
Select commit Hold shift + click to select a range
611bf40
add comments
skadic Aug 5, 2023
196a414
new sequential implementation (without pruning for now)
skadic Aug 8, 2023
0e86066
remove branch in rabin karp
skadic Aug 10, 2023
86bc25e
add tentative pruning to new sequential impl
skadic Aug 15, 2023
8179cc4
improve pruning
skadic Aug 15, 2023
f5bfbe3
fix pruning step
skadic Aug 17, 2023
aff1559
fix bug in cosntruction of leaf string
skadic Aug 19, 2023
b31c3b3
allow using mersenne modulo in rabin karp hasher
skadic Aug 19, 2023
1b1c15c
make MersenneHash copy- and move-constructible and -assignable
skadic Aug 19, 2023
281ca73
use robin_hood::unordered_flat_map instead of std::unordered_map
skadic Aug 19, 2023
daa2d4a
fix move constructor and assignment signatures
skadic Aug 19, 2023
1f59acb
switch to robin_hood::unordered_map
skadic Aug 19, 2023
4cdc0f8
wip parallel implementation
skadic Sep 4, 2023
e9e6f6c
parallelize pair scan step
skadic Sep 6, 2023
88480ba
parallelize part of the second step
skadic Sep 7, 2023
5cd8f07
inital version of sharded hash map algorithm
skadic Sep 25, 2023
741d71e
add handle to sharded map
skadic Sep 26, 2023
95f86ea
use http for submodules
skadic Sep 26, 2023
9d2ceda
use local sdsl
skadic Sep 27, 2023
45d4dc9
add lax relwithdeb preset
skadic Sep 27, 2023
ef67de6
move conceps to their own file
skadic Sep 28, 2023
e626e95
synchronized sharded map wip
skadic Oct 5, 2023
9ff2587
somewhat working sharded sync version
skadic Oct 9, 2023
9187632
sharded version without locks?
skadic Oct 10, 2023
f5de0ea
add more statistics
skadic Oct 11, 2023
a71946e
fix formatting issues
skadic Oct 11, 2023
a10dac2
replace comparison loop with memcmp
skadic Oct 12, 2023
6dc1e3d
add macro to disable debug prints and instrumentation
skadic Oct 15, 2023
5c796b3
add gpl3 notice
skadic Oct 15, 2023
d1c71a9
make build_bt a little more ergonomic
skadic Oct 16, 2023
9751d4d
conditional debug prints in older versions
skadic Oct 17, 2023
0915d1d
adjust build_bt executable
skadic Oct 17, 2023
6480a64
fix missing 64 build of libdivsufsort
skadic Oct 17, 2023
59d345c
fix issue with debug prints
skadic Oct 17, 2023
10c12d2
add more detailed result line output
skadic Oct 19, 2023
d178ae7
remove missing includes
skadic Oct 19, 2023
a65ea6c
make sdsl include public
skadic Oct 19, 2023
d719078
possible fix for weird scaling behavior
skadic Oct 20, 2023
9a48a16
r
skadic Oct 20, 2023
d88c167
track setup run time
skadic Oct 23, 2023
316ea39
re-add recursive call to insert
skadic Oct 25, 2023
41ee712
parallel variant using parlayhash (WIP)
skadic Oct 30, 2023
4fad476
tentative parlayhash version
skadic Nov 1, 2023
20499d6
make rabin-karp hasher use 128 bit hashes
skadic Nov 8, 2023
3492f53
use smaller prime for higher stability
skadic Nov 8, 2023
c3b310a
add heap memory tracking
skadic Nov 9, 2023
ea208df
remove faulty memory tracking
skadic Nov 9, 2023
b893612
remove faulty memory tracking
skadic Nov 9, 2023
7384e38
use lower prime in hopes that fixes overflow errors
skadic Nov 13, 2023
e1bf09c
variant that uses an identity hash for small blocks
skadic Nov 13, 2023
2c1c145
sharded sync using identity hash for small substrings
skadic Nov 14, 2023
370861a
remove map capacity parameter to reduce memory usage
skadic Nov 14, 2023
d5315ea
bit block tree access
skadic Nov 20, 2023
e279c82
make build_bt use a command line parser
skadic Nov 20, 2023
f8a2ab4
bit rank queries
skadic Nov 24, 2023
0660f31
WIP bit select queries
skadic Nov 26, 2023
15735a7
fix bit select queries
skadic Nov 27, 2023
d7d1381
select 0 queries
skadic Nov 27, 2023
f0296f1
code cleanup
skadic Nov 27, 2023
9f087f8
measure rank/select construction time and space
skadic Nov 29, 2023
3b65fd0
recursive bit block tree
skadic Nov 30, 2023
82f4811
reduce code duplication
skadic Nov 30, 2023
e256014
temporary fix to add_bit_rank_support breaking
skadic Dec 5, 2023
4a8d501
recursive block tree
skadic Dec 5, 2023
e2fc0be
bitwise rabin karp hash
skadic Dec 6, 2023
59b6840
code cleanup
skadic Dec 7, 2023
cac48ce
fix algos not respecting leaf_length
skadic Dec 11, 2023
6e62d50
reduce code duplication
skadic Dec 11, 2023
f697701
rename mersenne prime function
skadic Dec 11, 2023
4c5f4f3
WIP dense bit block tree with access and select
skadic Dec 11, 2023
f66bf88
recursive dense bit block trees
skadic Dec 12, 2023
f1ac9e4
fix seq fp2 and phmap
skadic Dec 14, 2023
7d7040c
refactor and update block_tree_sharded
skadic Dec 14, 2023
f81695d
make sync shard respect max leaf length
skadic Dec 15, 2023
e64d10c
fix a bug in dense bbt generating way too large leaf bit string
skadic Dec 20, 2023
ce8637d
fix bug in bit mersenne hash comparisons
skadic Dec 23, 2023
3903f75
make recursive block tree use dense bit block tree
skadic Dec 23, 2023
f90bb70
remove robin hood dependency
skadic Dec 23, 2023
807c492
Merge remote-tracking branch 'upstream/main'
skadic Dec 23, 2023
2836006
fix memory errors in sequential algorithms
skadic Dec 24, 2023
a7a4f1d
fix incorrect commit hash for bit_vector
skadic Dec 28, 2023
cb11dd1
fix error occurring for input too large for bit width
skadic Dec 29, 2023
6ed0807
do not read entire text to memory at once
skadic Jan 2, 2024
6a6ed99
fix integer overflow in select queries
skadic Jan 3, 2024
6146976
prevent ankerl from adding a mixing step, hurting performance
skadic Jan 4, 2024
1fc02d3
update unordered_dense dependency
skadic Jan 4, 2024
6b721d9
replace lists with vectors
skadic Jan 4, 2024
f8b63ed
fix BT_DBG macro
skadic Jan 5, 2024
6424a81
fix segfault caused by not finding prev occurrence
skadic Jan 6, 2024
71e0e03
small fix to sharded algorithm
skadic Jan 6, 2024
22ca931
Add verification to RESULT output
kurpicz Aug 29, 2024
db04a14
Merge branch 'main' into parallel_bt
kurpicz Apr 13, 2026
42002bf
Update ctest.yml
kurpicz Apr 13, 2026
6606b4a
Update ctest.yml
kurpicz Apr 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/ctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
compiler: [{cpp: g++-10, c: gcc-10}]

runs-on: ${{ matrix.os }}

Expand All @@ -28,9 +27,6 @@ jobs:

- name: Configure CMake
run: cmake --preset=release -DPASTA_BLOCK_TREE_BUILD_TESTS=ON
env:
CC: gcc-10
CXX: g++-10

- name: Build
run: cmake --build ${{github.workspace}}/build/
Expand Down
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
/build
/build*
/cmake-build-*
.cache
compile_commands.json
.idea/*
perf.data*
.pdf
*.txt
!CMakeLists.txt
debug
dev/
.vscode
31 changes: 31 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
[submodule "extlib/libsais"]
path = extlib/libsais
url = https://github.com/IlyaGrebnov/libsais
[submodule "extlib/growt"]
path = extlib/growt
url = https://github.com/TooBiased/growt
[submodule "extlib/parallel-hashmap"]
path = extlib/parallel-hashmap
url = https://github.com/greg7mdp/parallel-hashmap
[submodule "extlib/waitfree-mpsc-queue"]
path = extlib/waitfree-mpsc-queue
url = https://github.com/dbittman/waitfree-mpsc-queue
[submodule "extlib/Jiffy"]
path = extlib/Jiffy
url = https://github.com/DolevAdas/Jiffy
[submodule "fastwfc"]
path = extlib/fastwfc/fast-wait-free-queue
url = https://github.com/chaoran/fast-wait-free-queue
[submodule "extlib/Jiffy-1"]
path = extlib/Jiffy-1
url = https://github.com/quininer/Jiffy-1
branch = fix-atomic
[submodule "extlib/sdsl-lite"]
path = extlib/sdsl-lite
url = https://github.com/Skadic/sdsl-lite
[submodule "extlib/--force"]
path = extlib/--force
url = https://github.com/rizkg/BBHash
[submodule "extlib/parlayhash"]
path = extlib/parlayhash
url = https://github.com/cmuparlay/parlayhash
[submodule "extlib/unordered_dense"]
path = extlib/unordered_dense
url = https://github.com/martinus/unordered_dense
[submodule "extlib/doxygen-awesome-css"]
path = extlib/doxygen-awesome-css
url = https://github.com/jothepro/doxygen-awesome-css.git
96 changes: 78 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,23 @@ cmake_minimum_required(VERSION 3.20 FATAL_ERROR)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

include(FetchContent)

project(pasta_block_tree)

# Generate compile_commands.json
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")

## Build tests
option(PASTA_BLOCK_TREE_BUILD_TESTS
"Build blocktree's tests." OFF)
option(PASTA_BLOCK_TREE_BUILD_EXAMPLES
"Build blocktree's benchmarks." OFF)
"Build blocktree's benchmarks." OFF)
option(PASTA_BLOCK_TREE_DEBUG
"Print debug information" OFF)
option(PASTA_BLOCK_TREE_BENCH
"Enable outputting benchmark information" OFF)

include(ExternalProject)
include(FetchContent)

FetchContent_Declare(
tlx
Expand All @@ -49,8 +57,7 @@ FetchContent_Declare(
FetchContent_MakeAvailable(tlx pasta_bit_vector)

# Optional test
if(PASTA_BLOCK_TREE_BUILD_TESTS)
include(FetchContent)
if (PASTA_BLOCK_TREE_BUILD_TESTS)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
Expand All @@ -59,27 +66,80 @@ if(PASTA_BLOCK_TREE_BUILD_TESTS)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
enable_testing()
add_subdirectory(tests)
include(GoogleTest)
endif()
if(PASTA_BLOCK_TREE_BUILD_EXAMPLES)
add_executable(example
examples/block_tree_construction.cpp)
target_link_libraries(example
pasta_block_tree)
endif()
add_subdirectory(tests)
endif ()
if (PASTA_BLOCK_TREE_BUILD_EXAMPLES)
add_executable(block_tree_construction
examples/block_tree_construction.cpp)
target_link_libraries(block_tree_construction
pasta_block_tree)

add_executable(build_bt
examples/build_bt.cpp)
target_link_libraries(build_bt
pasta_block_tree)
if (PASTA_BLOCK_TREE_DEBUG)
target_compile_definitions(build_bt PRIVATE BT_INSTRUMENT)
target_compile_definitions(build_bt PRIVATE BT_DBG)
endif ()

if (PASTA_BLOCK_TREE_BENCH)
target_compile_definitions(build_bt PRIVATE BT_INSTRUMENT)
target_compile_definitions(build_bt PRIVATE BT_BENCH)
endif ()
endif ()

set(LIBSAIS_USE_OPENMP ON CACHE BOOL "Use OpenMP for parallelization of libsais" FORCE)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extlib/libsais)

set(BUILD_DIVSUFSORT64 ON CACHE BOOL "Build libdivsufsort in 64-bits mode")
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/extlib/sdsl-lite/external/libdivsufsort)

add_library(waitfree-mpsc-queue
${CMAKE_CURRENT_SOURCE_DIR}/extlib/waitfree-mpsc-queue/mpsc.c)
target_include_directories(waitfree-mpsc-queue PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/extlib/waitfree-mpsc-queue)

add_library(jiffy INTERFACE)
target_include_directories(jiffy INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/extlib/Jiffy)
add_library(jiffy1 INTERFACE)
target_include_directories(jiffy1 INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/extlib/Jiffy-1)

add_library(pasta_block_tree INTERFACE)
target_include_directories(pasta_block_tree INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/include)
${CMAKE_CURRENT_SOURCE_DIR}/include)

# sdsl
file(GLOB sdsl_sources ${CMAKE_CURRENT_SOURCE_DIR}/extlib/sdsl-lite/lib/*.cpp)
add_library(sdsl STATIC ${sdsl_sources})
target_include_directories(sdsl SYSTEM PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/extlib/sdsl-lite/include)
target_include_directories(sdsl SYSTEM PUBLIC
${CMAKE_CURRENT_BINARY_DIR}/extlib/sdsl-lite/external/libdivsufsort/include)
target_link_libraries(sdsl PUBLIC divsufsort64)
set_target_properties(sdsl PROPERTIES COMPILE_FLAGS "-w")

target_link_libraries(pasta_block_tree INTERFACE
libsais
pasta_bit_vector
sdsl
tlx)
libsais
pasta_bit_vector
tlx
waitfree-mpsc-queue
sdsl
#jiffy
jiffy1
# libzstd_static
)

target_include_directories(pasta_block_tree INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/extlib/growt)
target_include_directories(pasta_block_tree INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/extlib/parallel-hashmap/parallel_hashmap)
target_include_directories(pasta_block_tree SYSTEM INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/extlib/parlayhash/include)
target_include_directories(pasta_block_tree SYSTEM INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/extlib/unordered_dense/include)

################################################################################
183 changes: 121 additions & 62 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,65 +1,124 @@
{
"version": 2,
"cmakeMinimumRequired": {
"major": 3,
"minor": 20,
"patch": 0
"version": 2,
"cmakeMinimumRequired": {
"major": 3,
"minor": 20,
"patch": 0
},
"configurePresets": [
{
"name": "default",
"displayName": "Default",
"description": "Default build options",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_CXX_FLAGS": "-fopenmp -Wall -Wextra -pedantic -Werror -march=native -fdiagnostics-color=always",
"CMAKE_CXX_FLAGS_RELEASE": "-DNDEBUG -O3",
"CMAKE_CXX_FLAGS_RELWITHDEBINFO": "-DDEBUG -g -O3 -lprofiler",
"CMAKE_CXX_FLAGS_DEBUG": "-DDEBUG -O0 -g -static-libasan -fsanitize=address -fsanitize=leak -fsanitize=undefined"
}
},
"configurePresets": [
{
"name": "default",
"displayName": "Default",
"description": "Default build options",
"hidden": true,
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_CXX_FLAGS": "-fopenmp -Wall -Wextra -pedantic -Werror -march=native -fdiagnostics-color=always",
"CMAKE_CXX_FLAGS_RELEASE": "-DNDEBUG -O3",
"CMAKE_CXX_FLAGS_RELWITHDEBINFO": "-DDEBUG -g -O3",
"CMAKE_CXX_FLAGS_DEBUG": "-DDEBUG -O0 -g -ggdb -fsanitize=address"
}
},
{
"name": "release",
"displayName": "Release",
"inherits": "default",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "relwithdeb",
"displayName": "ReleaseWithDebugInfo",
"inherits": "default",
"binaryDir": "${sourceDir}/build_with_debug_info",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "debug",
"displayName": "Debug",
"inherits": "default",
"binaryDir": "${sourceDir}/debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
}
],
"buildPresets": [
{
"name": "release",
"configurePreset": "release"
},
{
"name": "relwithdeb",
"configurePreset": "relwithdeb"
},
{
"name": "debug",
"configurePreset": "debug"
}
]
{
"name": "release",
"displayName": "Release",
"inherits": "default",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "relwithdeb",
"displayName": "ReleaseWithDebugInfo",
"inherits": "default",
"binaryDir": "${sourceDir}/build_with_debug_info",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "debug",
"displayName": "Debug",
"inherits": "default",
"binaryDir": "${sourceDir}/debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "ninja-multi",
"displayName": "Ninja Multi-Config",
"description": "Default build using Ninja Multi-Config generator",
"generator": "Ninja Multi-Config",
"binaryDir": "${sourceDir}/build_multi",
"inherits": "default",
"cacheVariables": {
"PASTA_BLOCK_TREE_BUILD_TESTS": "ON",
"PASTA_BLOCK_TREE_BUILD_EXAMPLES": "ON"
}
},
{
"name": "bench",
"displayName": "Behcnmarking Configuration",
"description": "Release build with extended debug information",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build_bench",
"inherits": "default",
"cacheVariables": {
"PASTA_BLOCK_TREE_BUILD_EXAMPLES": "ON",
"CMAKE_CXX_FLAGS": "-fopenmp -Wall -Wextra -pedantic -Werror -march=native -fdiagnostics-color=always -g -O3 -lprofiler",
"CMAKE_BUILD_TYPE": "Release",
"PASTA_BLOCK_TREE_BENCH": "ON"
}
}
],
"buildPresets": [
{
"name": "release",
"configurePreset": "release"
},
{
"name": "relwithdeb",
"configurePreset": "relwithdeb"
},
{
"name": "debug",
"configurePreset": "debug"
},
{
"name": "release-multi",
"configurePreset": "ninja-multi",
"configuration": "Release"
},
{
"name": "relwithdeb-multi",
"configurePreset": "ninja-multi",
"configuration": "RelWithDebInfo"
},
{
"name": "debug-multi",
"configurePreset": "ninja-multi",
"configuration": "Debug"
},
{
"name": "bench",
"configurePreset": "bench"
}
],
"testPresets": [
{
"name": "default",
"configurePreset": "ninja-multi",
"output": {
"outputOnFailure": true
},
"execution": {
"noTestsAction": "error",
"stopOnFailure": true
},
"configuration": "RelWithDebInfo"
}
]
}
Loading
Loading