From 9fe305c7d28e993e55c55427f377ae7e3251ea4f Mon Sep 17 00:00:00 2001 From: "Douglas B. Rumbaugh" Date: Fri, 6 Dec 2024 13:13:51 -0500 Subject: Interface update (#5) * Query Interface Adjustments/Refactoring Began the process of adjusting the query interface (and also the shard interface, to a lesser degree) to better accommodate the user. In particular the following changes have been made, 1. The number of necessary template arguments for the query type has been drastically reduced, while also removing the void pointers and manual delete functions from the interface. This was accomplished by requiring many of the sub-types associated with a query (parameters, etc.) to be nested inside the main query class, and by forcing the SHARD type to expose its associated record type. 2. User-defined query return types are now supported. Queries no longer are required to return strictly sets of records. Instead, the query now has LocalResultType and ResultType template parameters (which can be defaulted using a typedef in the Query type itself), allowing much more flexibility. Note that, at least for the short term, the LocalResultType must still expose the same is_deleted/is_tombstone interface as a Wrapped used to, as this is currently needed for delete filtering. A better approach to this is, hopefully, forthcoming. 3. Updated the ISAMTree.h shard and rangequery.h query to use the new interfaces, and adjusted the associated unit tests as well. 4. Dropped the unnecessary "get_data()" function from the ShardInterface concept. 5. Dropped the need to specify a record type in the ShardInterface concept. This is now handled using a required Shard::RECORD member of the Shard class itself, which should expose the name of the record type. * Updates to framework to support new Query/Shard interfaces Pretty extensive adjustments to the framework, particularly to the templates themselves, along with some type-renaming work, to support the new query and shard interfaces. Adjusted the external query interface to take an rvalue reference, rather than a pointer, to the query parameters. * Removed framework-level delete filtering This was causing some issues with the new query interface, and should probably be reworked anyway, so I'm temporarily (TM) removing the feature. * Updated benchmarks + remaining code for new interface --- CMakeLists.txt | 100 +++++++++++++++++++++++++++++++-------------------------- 1 file changed, 54 insertions(+), 46 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index a03c351..b185b0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,10 @@ -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.22) -#set(CMAKE_C_COMPILER clang) -#set(CMAKE_CXX_COMPILER clang++) +set(CMAKE_C_COMPILER gcc) +set(CMAKE_CXX_COMPILER g++) set(CMAKE_CXX_STANDARD 20) -#set(CMAKE_CXX_STANDARD_REQUIRED True) +set(CMAKE_CXX_STANDARD_REQUIRED True) set(namespace "de") project("Practical Dynamic Extension" VERSION 0.1.0) @@ -21,6 +21,10 @@ set(CMAKE_CXX_FLAGS=-latomic -mcx16) add_compile_options(-Iinclude -Iexternal/PLEX/include -Iexternal -mcx16 -march=native) # -fconcepts-diagnostics-depth=3) +find_package(OpenMP REQUIRED) +add_compile_options(${OpenMP_CXX_FLAGS}) +link_libraries(OpenMP::OpenMP_CXX) + if (BSD) add_link_options(-L/usr/local/lib) add_compile_options(-I/usr/local/include) @@ -28,7 +32,7 @@ if (BSD) endif() if (debug) - add_compile_options(-g -O0) + add_compile_options(-g -O0 -Wall) if (!BSD) add_compile_options(-fsanitize=address) add_link_options(-fsanitize=address) @@ -36,7 +40,7 @@ if (debug) add_link_options(-fsanitize=undefined) endif() else() - add_compile_options(-O3 -g) + add_compile_options(-O3 -g -Wall) endif() # Test build instructions @@ -44,11 +48,6 @@ if (tests) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin/tests") file(MAKE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/tests/data") - add_executable(augbtree_tests ${CMAKE_CURRENT_SOURCE_DIR}/tests/augbtree_tests.cpp) - target_link_libraries(augbtree_tests PUBLIC gsl check subunit pthread atomic) - target_link_options(augbtree_tests PUBLIC -mcx16) - target_include_directories(augbtree_tests PRIVATE include external/psudb-common/cpp/include external/ctpl) - add_executable(internal_level_tests ${CMAKE_CURRENT_SOURCE_DIR}/tests/internal_level_tests.cpp) target_link_libraries(internal_level_tests PUBLIC gsl check subunit pthread atomic) target_link_options(internal_level_tests PUBLIC -mcx16) @@ -64,6 +63,11 @@ if (tests) target_link_options(rangequery_tests PUBLIC -mcx16) target_include_directories(rangequery_tests PRIVATE include external/psudb-common/cpp/include) + add_executable(irs_tests ${CMAKE_CURRENT_SOURCE_DIR}/tests/irs_tests.cpp) + target_link_libraries(irs_tests PUBLIC gsl check subunit pthread atomic) + target_link_options(irs_tests PUBLIC -mcx16) + target_include_directories(irs_tests PRIVATE include external/psudb-common/cpp/include) + add_executable(rangecount_tests ${CMAKE_CURRENT_SOURCE_DIR}/tests/rangecount_tests.cpp) target_link_libraries(rangecount_tests PUBLIC gsl check subunit pthread atomic) @@ -101,6 +105,11 @@ if (tests) target_link_options(de_bsm_tomb PUBLIC -mcx16) target_include_directories(de_bsm_tomb PRIVATE include external/PLEX/include external/psudb-common/cpp/include external) + add_executable(de_bsm_tag ${CMAKE_CURRENT_SOURCE_DIR}/tests/de_bsm_tag.cpp) + target_link_libraries(de_bsm_tag PUBLIC gsl check subunit pthread atomic) + target_link_options(de_bsm_tag PUBLIC -mcx16) + target_include_directories(de_bsm_tag PRIVATE include external/PLEX/include external/psudb-common/cpp/include external) + add_executable(de_level_concurrent ${CMAKE_CURRENT_SOURCE_DIR}/tests/de_level_concurrent.cpp) target_link_libraries(de_level_concurrent PUBLIC gsl check subunit pthread atomic) target_link_options(de_level_concurrent PUBLIC -mcx16) @@ -116,31 +125,30 @@ if (tests) target_link_options(memisam_tests PUBLIC -mcx16) target_include_directories(memisam_tests PRIVATE include external/psudb-common/cpp/include) - add_executable(triespline_tests ${CMAKE_CURRENT_SOURCE_DIR}/tests/triespline_tests.cpp) - target_link_libraries(triespline_tests PUBLIC gsl check subunit pthread atomic) - target_link_options(triespline_tests PUBLIC -mcx16) - target_include_directories(triespline_tests PRIVATE include external/psudb-common/cpp/include external/PLEX/include) - add_executable(alias_tests ${CMAKE_CURRENT_SOURCE_DIR}/tests/alias_tests.cpp) target_link_libraries(alias_tests PUBLIC gsl check subunit pthread atomic) target_link_options(alias_tests PUBLIC -mcx16) target_include_directories(alias_tests PRIVATE include external/psudb-common/cpp/include) - # OpenBSD doesn't have OpenMP support, so don't build the PGM code on that - # platform. + add_executable(triespline_tests ${CMAKE_CURRENT_SOURCE_DIR}/tests/triespline_tests.cpp) + target_link_libraries(triespline_tests PUBLIC gsl check subunit pthread atomic) + target_link_options(triespline_tests PUBLIC -mcx16) + target_include_directories(triespline_tests PRIVATE include external/psudb-common/cpp/include external/PLEX/include) + add_executable(pgm_tests ${CMAKE_CURRENT_SOURCE_DIR}/tests/pgm_tests.cpp) target_link_libraries(pgm_tests PUBLIC gsl check subunit pthread gomp atomic) target_include_directories(pgm_tests PRIVATE include external/PGM-index/include external/psudb-common/cpp/include) target_link_options(pgm_tests PUBLIC -mcx16) - target_compile_options(pgm_tests PUBLIC -fopenmp) + target_compile_options(pgm_tests PUBLIC) - # Triespline code doesn't build under OpenBSD either due to ambiguous function call; + # Triespline code doesn't build under OpenBSD due to ambiguous function call; # this is likely a difference between gcc and clang, rather than an OS thing - add_executable(triespline_debug ${CMAKE_CURRENT_SOURCE_DIR}/tests/triespline_debug.cpp) - target_link_libraries(triespline_debug PUBLIC gsl check subunit pthread atomic) - target_link_options(triespline_debug PUBLIC -mcx16) - target_include_directories(triespline_debug PRIVATE include external/psudb-common/cpp/include external/PLEX/include) - + if (NOT BSD) + add_executable(triespline_debug ${CMAKE_CURRENT_SOURCE_DIR}/tests/triespline_debug.cpp) + target_link_libraries(triespline_debug PUBLIC gsl check subunit pthread atomic) + target_link_options(triespline_debug PUBLIC -mcx16) + target_include_directories(triespline_debug PRIVATE include external/psudb-common/cpp/include external/PLEX/include) + endif() add_executable(fst_tests ${CMAKE_CURRENT_SOURCE_DIR}/tests/fst_tests.cpp) target_link_libraries(fst_tests PUBLIC gsl check subunit pthread atomic) @@ -155,123 +163,123 @@ if (vldb_bench) target_link_libraries(irs_bench PUBLIC gsl pthread atomic) target_include_directories(irs_bench PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(irs_bench PUBLIC -mcx16) - target_compile_options(irs_bench PUBLIC -fopenmp) + target_compile_options(irs_bench PUBLIC) add_executable(vptree_bench ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/vldb/vptree_bench.cpp) target_link_libraries(vptree_bench PUBLIC gsl pthread atomic) target_include_directories(vptree_bench PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(vptree_bench PUBLIC -mcx16) - target_compile_options(vptree_bench PUBLIC -fopenmp) + target_compile_options(vptree_bench PUBLIC) add_executable(vptree_bench_alt ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/vldb/vptree_bench_alt.cpp) target_link_libraries(vptree_bench_alt PUBLIC gsl pthread atomic) target_include_directories(vptree_bench_alt PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(vptree_bench_alt PUBLIC -mcx16) - target_compile_options(vptree_bench_alt PUBLIC -fopenmp) + target_compile_options(vptree_bench_alt PUBLIC) add_executable(vptree_parmsweep ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/vldb/vptree_parmsweep.cpp) target_link_libraries(vptree_parmsweep PUBLIC gsl pthread atomic) target_include_directories(vptree_parmsweep PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(vptree_parmsweep PUBLIC -mcx16) - target_compile_options(vptree_parmsweep PUBLIC -fopenmp) + target_compile_options(vptree_parmsweep PUBLIC) add_executable(vptree_bsm_bench ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/vldb/vptree_bsm_bench.cpp) target_link_libraries(vptree_bsm_bench PUBLIC gsl pthread atomic) target_include_directories(vptree_bsm_bench PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(vptree_bsm_bench PUBLIC -mcx16) - target_compile_options(vptree_bsm_bench PUBLIC -fopenmp) + target_compile_options(vptree_bsm_bench PUBLIC) add_executable(vptree_bsm_bench_alt ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/vldb/vptree_bsm_bench_alt.cpp) target_link_libraries(vptree_bsm_bench_alt PUBLIC gsl pthread atomic) target_include_directories(vptree_bsm_bench_alt PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(vptree_bsm_bench_alt PUBLIC -mcx16) - target_compile_options(vptree_bsm_bench_alt PUBLIC -fopenmp) + target_compile_options(vptree_bsm_bench_alt PUBLIC) add_executable(fst_bench ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/vldb/fst_bench.cpp) target_link_libraries(fst_bench PUBLIC gsl pthread atomic) target_include_directories(fst_bench PRIVATE include external external/fast_succinct_trie/include external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(fst_bench PUBLIC -mcx16) - target_compile_options(fst_bench PUBLIC -fopenmp) + target_compile_options(fst_bench PUBLIC) add_executable(fst_bsm_bench ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/vldb/fst_bsm_bench.cpp) target_link_libraries(fst_bsm_bench PUBLIC gsl pthread atomic) target_include_directories(fst_bsm_bench PRIVATE include external external/fast_succinct_trie/include external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(fst_bsm_bench PUBLIC -mcx16) - target_compile_options(fst_bsm_bench PUBLIC -fopenmp) + target_compile_options(fst_bsm_bench PUBLIC) add_executable(ts_bench ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/vldb/ts_bench.cpp) target_link_libraries(ts_bench PUBLIC gsl pthread atomic) target_include_directories(ts_bench PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(ts_bench PUBLIC -mcx16) - target_compile_options(ts_bench PUBLIC -fopenmp) + target_compile_options(ts_bench PUBLIC) add_executable(ts_parmsweep ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/vldb/ts_parmsweep.cpp) target_link_libraries(ts_parmsweep PUBLIC gsl pthread atomic) target_include_directories(ts_parmsweep PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(ts_parmsweep PUBLIC -mcx16) - target_compile_options(ts_parmsweep PUBLIC -fopenmp) + target_compile_options(ts_parmsweep PUBLIC) add_executable(ts_bsm_bench ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/vldb/ts_bsm_bench.cpp) target_link_libraries(ts_bsm_bench PUBLIC gsl pthread atomic) target_include_directories(ts_bsm_bench PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(ts_bsm_bench PUBLIC -mcx16) - target_compile_options(ts_bsm_bench PUBLIC -fopenmp) + target_compile_options(ts_bsm_bench PUBLIC) #add_executable(ts_mdsp_bench ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/vldb/ts_mdsp_bench.cpp) #target_link_libraries(ts_mdsp_bench PUBLIC gsl pthread atomic) #target_include_directories(ts_mdsp_bench PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) #target_link_options(ts_mdsp_bench PUBLIC -mcx16) - #target_compile_options(ts_mdsp_bench PUBLIC -fopenmp) + #target_compile_options(ts_mdsp_bench PUBLIC) add_executable(pgm_bench ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/vldb/pgm_bench.cpp) target_link_libraries(pgm_bench PUBLIC gsl pthread atomic gomp) target_include_directories(pgm_bench PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(pgm_bench PUBLIC -mcx16) - target_compile_options(pgm_bench PUBLIC -fopenmp) + target_compile_options(pgm_bench PUBLIC) add_executable(dynamic_pgm_bench ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/vldb/dynamic_pgm_bench.cpp) target_link_libraries(dynamic_pgm_bench PUBLIC gsl pthread atomic gomp) target_include_directories(dynamic_pgm_bench PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(dynamic_pgm_bench PUBLIC -mcx16) - target_compile_options(dynamic_pgm_bench PUBLIC -fopenmp) + target_compile_options(dynamic_pgm_bench PUBLIC) add_executable(btree_bench ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/vldb/btree_bench.cpp) target_link_libraries(btree_bench PUBLIC gsl pthread atomic gomp) target_include_directories(btree_bench PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(btree_bench PUBLIC -mcx16) - target_compile_options(btree_bench PUBLIC -fopenmp) + target_compile_options(btree_bench PUBLIC) add_executable(alex_bench ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/vldb/alex_bench.cpp) target_link_libraries(alex_bench PUBLIC gsl ) target_include_directories(alex_bench PRIVATE external/psudb-common/cpp/include external/alex/src/core/ benchmarks/include) - target_compile_options(alex_bench PUBLIC -fopenmp) + target_compile_options(alex_bench PUBLIC) set_property(TARGET alex_bench PROPERTY CXX_STANDARD 14) add_executable(mtree_bench_alt ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/vldb/mtree_bench_alt.cpp) target_link_libraries(mtree_bench_alt PUBLIC gsl pthread atomic gomp) target_include_directories(mtree_bench_alt PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(mtree_bench_alt PUBLIC -mcx16) - target_compile_options(mtree_bench_alt PUBLIC -fopenmp) + target_compile_options(mtree_bench_alt PUBLIC) add_executable(bigann_sample ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/bigann_sample.cpp) target_link_libraries(bigann_sample PUBLIC gsl pthread atomic gomp) target_include_directories(bigann_sample PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(bigann_sample PUBLIC -mcx16) - target_compile_options(bigann_sample PUBLIC -fopenmp) + target_compile_options(bigann_sample PUBLIC) add_executable(mtree_bench ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/vldb/mtree_bench.cpp) target_link_libraries(mtree_bench PUBLIC gsl pthread atomic gomp) target_include_directories(mtree_bench PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(mtree_bench PUBLIC -mcx16) - target_compile_options(mtree_bench PUBLIC -fopenmp) + target_compile_options(mtree_bench PUBLIC) add_executable(thread_scaling_bench ${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/vldb/thread_scaling_bench.cpp) target_link_libraries(thread_scaling_bench PUBLIC gsl pthread atomic) target_include_directories(thread_scaling_bench PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(thread_scaling_bench PUBLIC -mcx16) - target_compile_options(thread_scaling_bench PUBLIC -fopenmp) + target_compile_options(thread_scaling_bench PUBLIC) add_executable(btree_thread_scaling_bench @@ -279,7 +287,7 @@ if (vldb_bench) target_link_libraries(btree_thread_scaling_bench PUBLIC gsl pthread atomic) target_include_directories(btree_thread_scaling_bench PRIVATE include external external/m-tree/cpp external/PGM-index/include external/PLEX/include benchmarks/include external/psudb-common/cpp/include) target_link_options(btree_thread_scaling_bench PUBLIC -mcx16) - target_compile_options(btree_thread_scaling_bench PUBLIC -fopenmp) + target_compile_options(btree_thread_scaling_bench PUBLIC) endif() -- cgit v1.2.3