summaryrefslogtreecommitdiffstats
path: root/include/framework/structure/ExtensionStructure.h
diff options
context:
space:
mode:
authorDouglas Rumbaugh <dbr4@psu.edu>2025-09-17 18:27:56 -0400
committerDouglas Rumbaugh <dbr4@psu.edu>2025-09-17 18:27:56 -0400
commit42cb6e2b446a2879cf9bf2f4642f926c15584cb3 (patch)
tree2ae610890630bcb75c0df9335a8735385f11a069 /include/framework/structure/ExtensionStructure.h
parent79dcefa5002f6411e05169a226ae9e3cd1114bd7 (diff)
downloaddynamic-extension-42cb6e2b446a2879cf9bf2f4642f926c15584cb3.tar.gz
Beginnings of per-level cost modeling
The total time required for each shard construction is now measured, and hooks have been added to InternalLevel to support the creation and use of per-level cost models. The appropriate calls to these functions are now made during reconstruction, but the scheduling process doesn't yet call them, nor are the models actually implemented.
Diffstat (limited to 'include/framework/structure/ExtensionStructure.h')
-rw-r--r--include/framework/structure/ExtensionStructure.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/framework/structure/ExtensionStructure.h b/include/framework/structure/ExtensionStructure.h
index 0fd737c..bb8a480 100644
--- a/include/framework/structure/ExtensionStructure.h
+++ b/include/framework/structure/ExtensionStructure.h
@@ -10,6 +10,7 @@
#pragma once
#include <atomic>
+#include <chrono>
#include <cstdio>
#include <memory>
#include <vector>
@@ -196,7 +197,13 @@ public:
result.source_shards.emplace_back(shid.level_idx, raw_shard_ptr);
}
+
+ auto start = std::chrono::high_resolution_clock::now();
result.new_shard = std::make_shared<ShardType>(shards);
+ auto stop = std::chrono::high_resolution_clock::now();
+
+ result.runtime = std::chrono::duration_cast<std::chrono::nanoseconds>(stop- start).count();
+ result.reccnt = result.new_shard->get_record_count();
return result;
}
@@ -218,6 +225,14 @@ public:
return m_levels[0]->get_shard_count();
}
+ bool apply_reconstruction(reconstruction_results<ShardType> &recon, size_t version) {
+ bool res = append_shard(recon.new_shard, version, recon.target_level);
+ m_levels[recon.target_level]->update_reconstruction_model(recon);
+ delete_shards(recon.source_shards);
+
+ return res;
+ }
+
bool append_shard(std::shared_ptr<ShardType> shard, size_t version, size_t level) {
assert(level <= m_levels.size());
auto rc = false;