From 9083ba834f36758fd4326f1ff0be9f404eef459b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Constantin=20F=C3=BCrst?= Date: Sun, 26 Nov 2023 15:16:08 +0100 Subject: [PATCH] small changes to execute move; remove unused repetition-options, pass args as ref to allow for writing results, dont use numa-node-setting dml submit call --- benchmarks/execute-move.hpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/benchmarks/execute-move.hpp b/benchmarks/execute-move.hpp index c855496..67650ec 100644 --- a/benchmarks/execute-move.hpp +++ b/benchmarks/execute-move.hpp @@ -3,8 +3,11 @@ #include #include #include -#include + +#include #include +#include + #include struct ThreadArgs { @@ -15,9 +18,6 @@ struct ThreadArgs { size_t size; uint8_t nnode_src; uint8_t nnode_dst; - // repetition - uint8_t count; // TODO: unused - bool batched; // TODO: unused // thread output dml::status_code status; std::chrono::microseconds duration; @@ -52,7 +52,7 @@ void* thread_function(void* argp) { // we use the asynchronous submit-routine even though this is not required // here, however the project later on will only use async operation - auto handler = dml::submit(dml::mem_move, srcv, dstv, args->numa_node); + auto handler = dml::submit(dml::mem_move, srcv, dstv); auto result = handler.get(); const auto et = std::chrono::high_resolution_clock::now(); @@ -63,12 +63,13 @@ void* thread_function(void* argp) { args->duration = std::chrono::duration_cast(et - st); args->status = result.status; + args->sig = nullptr; return nullptr; } template -void execute_mem_move(std::vector args) { +void execute_mem_move(std::vector& args) { sem_t sem; std::vector threads; @@ -78,7 +79,7 @@ void execute_mem_move(std::vector args) { // for each submitted task we link the semaphore // and create the thread, passing the argument - for (auto arg : args) { + for (auto& arg : args) { arg.sig = &sem; threads.emplace_back();