From f19c069b0ffe88ac1fbf1c2dff6cc9fb65972e5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20F=C3=BCrst?= Date: Tue, 9 Jan 2024 23:55:23 +0100 Subject: [PATCH] always perform copy from src and dst node, add another log output about the split --- offloading-cacher/main.cpp | 4 ++-- offloading-cacher/offloading-cache.hpp | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/offloading-cacher/main.cpp b/offloading-cacher/main.cpp index b6c9714..7aa8ea0 100644 --- a/offloading-cacher/main.cpp +++ b/offloading-cacher/main.cpp @@ -37,12 +37,12 @@ int main(int argc, char **argv) { }; auto copy_policy = [](const int numa_dst_node, const int numa_src_node) { - return std::vector{ numa_src_node }; + return std::vector{ numa_src_node, numa_dst_node }; }; cache.Init(cache_policy,copy_policy); - static constexpr size_t data_size = 8192; + static constexpr size_t data_size = 1024 * 1024; double* data = GetRandomArray(data_size); std::unique_ptr data_cache = cache.Access(reinterpret_cast(data), data_size * sizeof(double), offcache::ExecutionPolicy::Relaxed); diff --git a/offloading-cacher/offloading-cache.hpp b/offloading-cacher/offloading-cache.hpp index f40ef3d..ea91fae 100644 --- a/offloading-cacher/offloading-cache.hpp +++ b/offloading-cacher/offloading-cache.hpp @@ -246,6 +246,8 @@ inline void offcache::Cache::SubmitTask(CacheData* task) { const size_t size = task->size_ / task_count; const size_t last_size = size + task->size_ % task_count; + std::cout << "[-] Splitting Copy into " << task_count << " tasks of " << size << "B 0x" << std::hex << (uint64_t)task->src_ << std::dec << std::endl; + // save the current numa node mask to restore later // as executing the copy task will place this thread // on a different node