summaryrefslogtreecommitdiffstats
path: root/benchmarks
diff options
context:
space:
mode:
authorDouglas B. Rumbaugh <dbr4@psu.edu>2024-03-25 12:54:17 -0400
committerDouglas B. Rumbaugh <dbr4@psu.edu>2024-03-25 12:54:17 -0400
commitb1b5ab106122e6917f6b34452be95e617506f05d (patch)
tree1fea7e8b097077204b9cff12a4acbf66e857ed3b /benchmarks
parentfb4312a883dd0e382ecbcfe1119479e6f44d32a6 (diff)
downloaddynamic-extension-b1b5ab106122e6917f6b34452be95e617506f05d.tar.gz
Updates for build on OpenBSD
Necessary updates to get the codebase building under OpenBSD 7.5 with clang. This is a minimal set of changes to get building to work, which includes disabling several things that aren't directly compatable. More work will be necessary to get full functionality. In particular, Triespline, PGM, and the reference M-tree do not currently build on OpenBSD with clang due to GNU dependencies or other gcc specific features.
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/include/benchmark_types.h4
-rw-r--r--benchmarks/include/standard_benchmarks.h7
-rw-r--r--benchmarks/watermark_testing.cpp6
3 files changed, 15 insertions, 2 deletions
diff --git a/benchmarks/include/benchmark_types.h b/benchmarks/include/benchmark_types.h
index 85e9565..fcdeac6 100644
--- a/benchmarks/include/benchmark_types.h
+++ b/benchmarks/include/benchmark_types.h
@@ -2,7 +2,6 @@
#include <cstdlib>
#include "psu-ds/BTree.h"
-#include "mtree.h"
#include "framework/interface/Record.h"
/* TLX BTree definitions*/
@@ -46,5 +45,8 @@ struct euclidean_distance {
}
};
+#ifdef _GNU_SOURCE
+#include "mtree.h"
typedef mt::mtree<Word2VecRec, euclidean_distance> MTree;
+#endif
diff --git a/benchmarks/include/standard_benchmarks.h b/benchmarks/include/standard_benchmarks.h
index a42cdd6..5fc549d 100644
--- a/benchmarks/include/standard_benchmarks.h
+++ b/benchmarks/include/standard_benchmarks.h
@@ -102,8 +102,10 @@ static bool insert_tput_bench(DE &de_index, std::fstream &file, size_t insert_cn
if (applied_deletes < delete_cnt && delete_idx < delete_vec.size() && gsl_rng_uniform(rng) < delete_prop) {
if constexpr (std::is_same_v<BenchBTree, DE>) {
de_index.erase_one(delete_vec[delete_idx++].key);
+ #ifdef _GNU_SOURCE
} else if constexpr (std::is_same_v<MTree, DE>) {
de_index.remove(delete_vec[delete_idx++]);
+ #endif
} else {
de_index.erase(delete_vec[delete_idx++]);
}
@@ -111,11 +113,16 @@ static bool insert_tput_bench(DE &de_index, std::fstream &file, size_t insert_cn
}
// insert the record;
+ #ifdef _GNU_SOURCE
if constexpr (std::is_same_v<MTree, DE>) {
de_index.add(insert_vec[i]);
} else {
de_index.insert(insert_vec[i]);
}
+ #else
+ de_index.insert(insert_vec[i]);
+ #endif
+
applied_inserts++;
}
auto insert_stop = std::chrono::high_resolution_clock::now();
diff --git a/benchmarks/watermark_testing.cpp b/benchmarks/watermark_testing.cpp
index 5fa0c0d..c56fc63 100644
--- a/benchmarks/watermark_testing.cpp
+++ b/benchmarks/watermark_testing.cpp
@@ -12,6 +12,7 @@
#include "psu-util/timer.h"
#include <algorithm>
+#include <random>
typedef uint64_t K;
typedef de::Record<K, K> Rec;
@@ -32,7 +33,10 @@ int main(int argc, char **argv) {
keys[i] = i;
}
- std::random_shuffle(keys.begin(), keys.end());
+ std::random_device rd;
+ std::mt19937 g(rd());
+
+ std::shuffle(keys.begin(), keys.end(), g);
TIMER_INIT();