From 51aa3a059413c89019ba49028976a015b82013d5 Mon Sep 17 00:00:00 2001 From: Qiwei Ye Date: Fri, 22 Apr 2016 13:19:40 +0800 Subject: [PATCH] perf commit --- Test/main.cpp | 14 +++++++++----- src/table/sparse_matrix_table.cpp | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Test/main.cpp b/Test/main.cpp index 5d21ec5..2fb904a 100644 --- a/Test/main.cpp +++ b/Test/main.cpp @@ -503,8 +503,13 @@ void TestmatrixPerformance(int argc, char* argv[], MV_Init(&argc, argv); multiverso::SetCMDFlag("sync", true); - + int per = 0; int num_row = 1000000, num_col = 50; + if (argc == 1){ + per = atoi(argv[2]); + num_row = atoi(argv[3]); + } + int size = num_row * num_col; std::vector primes; primes.push_back(2); @@ -539,7 +544,6 @@ void TestmatrixPerformance(int argc, char* argv[], } } - UpdateOption option; option.set_worker_id(worker_id); @@ -553,14 +557,14 @@ void TestmatrixPerformance(int argc, char* argv[], } auto worker_table = CreateWorkerTable(num_row, num_col); auto server_table = CreateServerTable(num_row, num_col); - for (auto p = 0; p < 100; ++p) + for (auto p = 0; p < 10; ++p) { std::shuffle(unique_index.begin(), unique_index.end(), eng); row_ids.clear(); data_vec.clear(); - for (auto i = 0; i < (9 + 1) * num_row / 10; i++) + for (auto i = 0; i < (per + 1) * num_row / 10; i++) { row_ids.push_back(unique_index[i]); data_vec.push_back(delta + unique_index[i] * num_col); @@ -589,12 +593,12 @@ void TestmatrixPerformance(int argc, char* argv[], total_time += 1.0 * timmer.elapse() / 1000; std::cout << "rank :" << MV_Rank() <<" " << 1.0 * timmer.elapse() / 1000 << "s:\t" << "get all rows after adding to rows" << std::endl; } - std::cout << " rank :" << MV_Rank() << " timer statics: mean " << (double) total_time / 100 << std::endl; MV_Barrier(); Log::ResetLogLevel(LogLevel::Info); Dashboard::Display(); Log::ResetLogLevel(LogLevel::Error); MV_ShutDown(); + std::cout << " rank :" << MV_Rank() << " timer statics: mean " << (double) total_time / 10 << std::endl; } void TestSparsePerf(int argc, char* argv[]) { diff --git a/src/table/sparse_matrix_table.cpp b/src/table/sparse_matrix_table.cpp index 8474ca6..2ce9e3e 100644 --- a/src/table/sparse_matrix_table.cpp +++ b/src/table/sparse_matrix_table.cpp @@ -138,7 +138,7 @@ void SparseMatrixWorkerTable::ProcessReplyGet( // replace row_index when original key == -1 if (row_index_[num_row_] != nullptr) { size_t keys_size = reply_data[0].size(); - Log::Info("[SparseMatrixWorkerTable:ProcessReplyGet] worker = %d, #keys_size = %d\n", MV_Rank(), + Log::Debug("[SparseMatrixWorkerTable:ProcessReplyGet] worker = %d, #keys_size = %d\n", MV_Rank(), keys_size); int *keys = reinterpret_cast(reply_data[0].data()); for (auto i = 0; i < keys_size; ++i) {