From 6ba44cbe708930f51d25ef7f01404e3af9b32df6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20M=C3=BCller?= Date: Wed, 20 Jul 2022 18:41:13 +0200 Subject: [PATCH] blinktree: Removed reference to chronometer from benchmark. --- .../mml/src/app/blinktree/benchmark/chronometer.h | 2 +- .../blinktree/blinktree_benchmark/benchmark.cpp | 15 +++++++++++---- .../app/blinktree/blinktree_benchmark/benchmark.h | 4 ++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/repos/mml/src/app/blinktree/benchmark/chronometer.h b/repos/mml/src/app/blinktree/benchmark/chronometer.h index fd0f7e6fa2..a9c9210fbd 100644 --- a/repos/mml/src/app/blinktree/benchmark/chronometer.h +++ b/repos/mml/src/app/blinktree/benchmark/chronometer.h @@ -48,7 +48,7 @@ template class InterimResult public: InterimResult(const std::uint64_t operation_count, const P &phase, const std::uint16_t iteration, const std::uint16_t core_count, const std::chrono::milliseconds time, - /*std::vector &counter,*/ std::unordered_map executed_tasks, + std::vector &counter, std::unordered_map executed_tasks, std::unordered_map executed_reader_tasks, std::unordered_map executed_writer_tasks, std::unordered_map scheduled_tasks, diff --git a/repos/mml/src/app/blinktree/blinktree_benchmark/benchmark.cpp b/repos/mml/src/app/blinktree/blinktree_benchmark/benchmark.cpp index 24117ba79f..fad0c92893 100644 --- a/repos/mml/src/app/blinktree/blinktree_benchmark/benchmark.cpp +++ b/repos/mml/src/app/blinktree/blinktree_benchmark/benchmark.cpp @@ -19,6 +19,7 @@ Benchmark::Benchmark(benchmark::Cores &&cores, const std::uint16_t iterations, s _result_file_name(std::move(result_file_name)), _statistic_file_name(std::move(statistic_file_name)), _tree_file_name(std::move(tree_file_name)), _profile(profile) { +#ifdef 0 if (use_performance_counter) { this->_chronometer.add(benchmark::Perf::CYCLES); @@ -27,7 +28,7 @@ Benchmark::Benchmark(benchmark::Cores &&cores, const std::uint16_t iterations, s this->_chronometer.add(benchmark::Perf::SW_PREFETCH_ACCESS_NTA); this->_chronometer.add(benchmark::Perf::SW_PREFETCH_ACCESS_WRITE); } - +#endif std::cout << "core configuration: \n" << this->_cores.dump(2) << std::endl; this->_workload.build(fill_workload_file, mixed_workload_file); @@ -70,8 +71,10 @@ void Benchmark::start() { mx::tasking::runtime::profile(this->profile_file_name()); } +#ifdef 0 this->_chronometer.start(static_cast(static_cast(this->_workload)), this->_current_iteration + 1, this->_cores.current()); +#endif } const mx::util::core_set &Benchmark::core_set() @@ -110,15 +113,15 @@ void Benchmark::requests_finished() if (open_requests == 0U) // All request schedulers are done. { // Stop and print time (and performance counter). - const auto result = this->_chronometer.stop(this->_workload.size()); + //const auto result = this->_chronometer.stop(this->_workload.size()); mx::tasking::runtime::stop(); - std::cout << result << std::endl; + //std::cout << result << std::endl; // Dump results to file. if (this->_result_file_name.empty() == false) { std::ofstream result_file_stream(this->_result_file_name, std::ofstream::app); - result_file_stream << result.to_json().dump() << std::endl; + //result_file_stream << result.to_json().dump() << std::endl; } // Dump statistics to file. @@ -128,9 +131,11 @@ void Benchmark::requests_finished() { std::ofstream statistic_file_stream(this->_statistic_file_name, std::ofstream::app); nlohmann::json statistic_json; +#ifdef 0 statistic_json["iteration"] = result.iteration(); statistic_json["cores"] = result.core_count(); statistic_json["phase"] = result.phase(); +#endif statistic_json["scheduled"] = nlohmann::json(); statistic_json["scheduled-on-channel"] = nlohmann::json(); statistic_json["scheduled-off-channel"] = nlohmann::json(); @@ -142,6 +147,7 @@ void Benchmark::requests_finished() { const auto core_id = std::int32_t{this->_cores.current()[i]}; const auto core_id_string = std::to_string(core_id); +#ifdef 0 statistic_json["scheduled"][core_id_string] = result.scheduled_tasks(core_id) / double(result.operation_count()); statistic_json["scheduled-on-core"][core_id_string] = @@ -156,6 +162,7 @@ void Benchmark::requests_finished() result.executed_writer_tasks(core_id) / double(result.operation_count()); statistic_json["fill"][core_id_string] = result.worker_fills(core_id) / double(result.operation_count()); +#endif } statistic_file_stream << statistic_json.dump(2) << std::endl; diff --git a/repos/mml/src/app/blinktree/blinktree_benchmark/benchmark.h b/repos/mml/src/app/blinktree/blinktree_benchmark/benchmark.h index ae0b789b4b..b8261992a5 100644 --- a/repos/mml/src/app/blinktree/blinktree_benchmark/benchmark.h +++ b/repos/mml/src/app/blinktree/blinktree_benchmark/benchmark.h @@ -4,7 +4,7 @@ #include "request_scheduler.h" #include #include -#include +//#include #include #include #include @@ -93,7 +93,7 @@ private: alignas(64) std::vector _request_scheduler; // Chronometer for starting/stopping time and performance counter. - alignas(64) benchmark::Chronometer _chronometer; + //alignas(64) benchmark::Chronometer _chronometer; /** * @return Name of the file to write profiling results to.