From 393210a1eef10cc4dcfa49e6b417c32c034bb991 Mon Sep 17 00:00:00 2001 From: Gregor Olenik Date: Mon, 16 Dec 2024 13:31:56 +0100 Subject: [PATCH] improve output --- include/OGL/MatrixWrapper/HostMatrix.hpp | 2 ++ include/OGL/lduLduBase.hpp | 9 ++++----- src/MatrixWrapper/Distributed.cpp | 21 +++++++++++++++------ 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/include/OGL/MatrixWrapper/HostMatrix.hpp b/include/OGL/MatrixWrapper/HostMatrix.hpp index 0dd32ff3..cc6d72e7 100644 --- a/include/OGL/MatrixWrapper/HostMatrix.hpp +++ b/include/OGL/MatrixWrapper/HostMatrix.hpp @@ -266,6 +266,8 @@ class HostMatrixWrapper { gko::dim<2> get_size() const { return gko::dim<2>(nrows_, nrows_); } const ExecutorHandler &get_exec_handler() const { return exec_; } + + const word get_field_name() const { return field_name_; } }; diff --git a/include/OGL/lduLduBase.hpp b/include/OGL/lduLduBase.hpp index 79de1e00..1cf423e0 100644 --- a/include/OGL/lduLduBase.hpp +++ b/include/OGL/lduLduBase.hpp @@ -302,12 +302,11 @@ class lduLduBase : public OGL_Info, exec_handler_.get_gko_mpi_host_comm()->broadcast( exec_handler_.get_ref_exec(), &prev_rel_res_cost, 1, 0); this->set_prev_rel_res_cost(prev_rel_res_cost); - auto time_per_iter_and_dof = - time_per_iter * 1000.0 / - repartitioner->get_orig_partition()->get_size(); + size_t dofs = repartitioner->get_orig_partition()->get_size(); + auto time_per_iter_and_dof = time_per_iter * 1000.0 / dofs; word msg = - "\nStatistics:\n\tTime per iteration: " + - std::to_string(time_per_iter) + + "\nStatistics:\n\tNumber DOFs: " + std::to_string(dofs) + + " [#]\n\tTime per iteration: " + std::to_string(time_per_iter) + std::string(" [mu s]\n\tTime per residual norm calculation: ") + std::to_string(time_for_res_norm_eval) + std::string(" [mu s]\n\tTime per iteration and DOF: ") + diff --git a/src/MatrixWrapper/Distributed.cpp b/src/MatrixWrapper/Distributed.cpp index 8871283f..16a3c159 100644 --- a/src/MatrixWrapper/Distributed.cpp +++ b/src/MatrixWrapper/Distributed.cpp @@ -264,6 +264,7 @@ void update_impl( auto rank = exec_handler.get_rank(); auto device_exec = exec_handler.get_device_exec(); bool force_host_buffer = exec_handler.get_gko_force_host_buffer(); + word fieldname = host_A->get_field_name(); // perform all-to-all updates first auto all_to_all_update = [comm, ref_exec, device_exec, @@ -276,7 +277,8 @@ void update_impl( } }; - SIMPLE_TIME(verbose, perform_all_to_all_update, all_to_all_update();); + TIME_WITH_FIELDNAME(verbose, perform_all_to_all_update, fieldname, + all_to_all_update();); auto get_send_ptr = [&](label send_id, label id) { if (send_id < 0) { @@ -322,12 +324,19 @@ void update_impl( } }; - SIMPLE_TIME(verbose, perform_pairwise_update, pairwise_communicate();); + TIME_WITH_FIELDNAME(verbose, perform_pairwise_update, fieldname, + pairwise_communicate();); - for (auto [reorder_map, data_ptr] : reorder_maps) { - reorder_interface_impl(exec_handler, reorder_map, - data_ptr); - } + auto reorder_data = + [reorder_maps, exec_handler]() { + for (auto [reorder_map, data_ptr] : reorder_maps) { + reorder_interface_impl(exec_handler, + reorder_map, data_ptr); + } + } + + TIME_WITH_FIELDNAME(verbose, reorder_matrix_data, fieldname, + reorder_data();); }