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/types.h') 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/types.h') 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 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/types.h') 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