From 5c229093f9af21514b17cf778dbec7ac657e31d2 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Mon, 12 Feb 2024 11:42:18 -0500 Subject: Refactored Reconstruction Tasks Added a ReconVector type to make it easier to do load balancing by shifting tasks around, and clean up a few interfaces. --- include/util/types.h | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) (limited to 'include/util') diff --git a/include/util/types.h b/include/util/types.h index a13bd95..e22fd18 100644 --- a/include/util/types.h +++ b/include/util/types.h @@ -19,6 +19,8 @@ #include #include +#include +#include namespace de { @@ -69,4 +71,69 @@ struct ShardID { /* A placeholder for an invalid shard--also used to indicate the mutable buffer */ const ShardID INVALID_SHID = {-1, -1}; +typedef ssize_t level_index; + +typedef struct { + level_index source; + level_index target; + size_t reccnt; +} ReconstructionTask; + +class ReconstructionVector { +public: + ReconstructionVector() + : total_reccnt(0) {} + + ~ReconstructionVector() = default; + + ReconstructionTask operator[](size_t idx) { + return m_tasks[idx]; + } + + void add_reconstruction(level_index source, level_index target, size_t reccnt) { + m_tasks.push_back({source, target, reccnt}); + total_reccnt += reccnt; + } + + ReconstructionTask remove_reconstruction(size_t idx) { + assert(idx < m_tasks.size()); + auto task = m_tasks[idx]; + + m_tasks.erase(m_tasks.begin() + idx); + total_reccnt -= task.reccnt; + + return task; + } + + ReconstructionTask remove_smallest_reconstruction() { + size_t min_size = m_tasks[0].reccnt; + size_t idx = 0; + for (size_t i=1; i m_tasks; + size_t total_reccnt; +}; + } -- cgit v1.2.3 From e4644fec1acc429a540f358b4e7e15af75aa71a9 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Mon, 12 Feb 2024 13:09:10 -0500 Subject: ExtensionStructure: first basic test of lookahead task stealing --- include/util/types.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/util') diff --git a/include/util/types.h b/include/util/types.h index e22fd18..bac0246 100644 --- a/include/util/types.h +++ b/include/util/types.h @@ -95,6 +95,10 @@ public: total_reccnt += reccnt; } + void add_reconstruction(ReconstructionTask task) { + m_tasks.push_back(task); + } + ReconstructionTask remove_reconstruction(size_t idx) { assert(idx < m_tasks.size()); auto task = m_tasks[idx]; -- cgit v1.2.3 From b1b5ab106122e6917f6b34452be95e617506f05d Mon Sep 17 00:00:00 2001 From: "Douglas B. Rumbaugh" Date: Mon, 25 Mar 2024 12:54:17 -0400 Subject: 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. --- include/util/SortedMerge.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/util') diff --git a/include/util/SortedMerge.h b/include/util/SortedMerge.h index 8a1e782..c149189 100644 --- a/include/util/SortedMerge.h +++ b/include/util/SortedMerge.h @@ -58,7 +58,7 @@ static std::vector>> build_cursor_vec(std::vector &shards, for (size_t i = 0; i < shards.size(); ++i) { if (shards[i]) { auto base = shards[i]->get_data(); - cursors.emplace_back(Cursor{base, base + shards[i]->get_record_count(), 0, shards[i]->get_record_count()}); + cursors.emplace_back(Cursor>{base, base + shards[i]->get_record_count(), 0, shards[i]->get_record_count()}); *reccnt += shards[i]->get_record_count(); *tscnt += shards[i]->get_tombstone_count(); } else { -- cgit v1.2.3 From 96faedaeb92776fd9cc2ed8d8b0878ebc9300cbe Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Wed, 1 May 2024 18:51:41 -0400 Subject: Added a Bentley-Saxe layout policy --- include/util/types.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'include/util') diff --git a/include/util/types.h b/include/util/types.h index bac0246..cf61412 100644 --- a/include/util/types.h +++ b/include/util/types.h @@ -73,10 +73,16 @@ const ShardID INVALID_SHID = {-1, -1}; typedef ssize_t level_index; -typedef struct { - level_index source; +typedef struct ReconstructionTask { + std::vector sources; level_index target; size_t reccnt; + + void add_source(level_index source, size_t cnt) { + sources.push_back(source); + reccnt += cnt; + } + } ReconstructionTask; class ReconstructionVector { @@ -91,7 +97,7 @@ public: } void add_reconstruction(level_index source, level_index target, size_t reccnt) { - m_tasks.push_back({source, target, reccnt}); + m_tasks.push_back({{source}, target, reccnt}); total_reccnt += reccnt; } -- cgit v1.2.3