Skip to content

Commit

Permalink
improve output
Browse files Browse the repository at this point in the history
  • Loading branch information
greole committed Dec 16, 2024
1 parent c25d150 commit 393210a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
2 changes: 2 additions & 0 deletions include/OGL/MatrixWrapper/HostMatrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_; }
};


Expand Down
9 changes: 4 additions & 5 deletions include/OGL/lduLduBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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: ") +
Expand Down
21 changes: 15 additions & 6 deletions src/MatrixWrapper/Distributed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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) {
Expand Down Expand Up @@ -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<LocalMatrixType>(exec_handler, reorder_map,
data_ptr);
}
auto reorder_data =
[reorder_maps, exec_handler]() {
for (auto [reorder_map, data_ptr] : reorder_maps) {
reorder_interface_impl<LocalMatrixType>(exec_handler,
reorder_map, data_ptr);
}
}

TIME_WITH_FIELDNAME(verbose, reorder_matrix_data, fieldname,
reorder_data(););
}


Expand Down

0 comments on commit 393210a

Please sign in to comment.