Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy residual to host #1522

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/distributed-solver/distributed-solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,16 @@ int main(int argc, char* argv[])
ValueType t_end = gko::experimental::mpi::get_walltime();

// Get the residual.
auto res_norm = gko::as<vec>(logger->get_residual_norm());
auto res_norm = gko::clone(exec->get_master(),
gko::as<vec>(logger->get_residual_norm()));

// @sect3{Printing Results}
// Print the achieved residual norm and timings on rank 0.
if (comm.rank() == 0) {
// clang-format off
std::cout << "\nNum rows in matrix: " << num_rows
<< "\nNum ranks: " << comm.size()
<< "\nFinal Res norm: " << *res_norm->get_const_values()
<< "\nFinal Res norm: " << res_norm->at(0, 0)
<< "\nIteration count: " << logger->get_num_iterations()
<< "\nInit time: " << t_init_end - t_init
<< "\nRead time: " << t_read_setup_end - t_init
Expand Down
Loading