From 278a1b15a504f560da7a7f60b76671ef4a32c3b8 Mon Sep 17 00:00:00 2001 From: kai Date: Sat, 31 May 2025 17:24:00 +0200 Subject: [PATCH] + --- lab10/jacobi/jacobi_mpi.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lab10/jacobi/jacobi_mpi.cpp b/lab10/jacobi/jacobi_mpi.cpp index be722fe..c2064cc 100644 --- a/lab10/jacobi/jacobi_mpi.cpp +++ b/lab10/jacobi/jacobi_mpi.cpp @@ -72,12 +72,6 @@ Jacobi::Result JacobiMPI::run(const Matrix &init, double epsilon, phi[t0](i, j + 1) + phi[t0](i, j - 1)); const double diff = phi[t1](i, j) - phi[t0](i, j); dist = std::max(dist, std::abs(diff)); - if (nIter == 50) { - std::cout << phi[t1](i, j); - } - } - if (nIter == 50) { - std::cout << std::endl; } } } @@ -156,9 +150,6 @@ Jacobi::Result JacobiMPI::run(const Matrix &init, double epsilon, } } - // if (nIter % 1000 == 0) { - // std::cout << "Iteration " << nIter << ", dist=" << dist << "\n"; - // } double globalDist; MPI_Allreduce(&dist, &globalDist, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); dist = globalDist; @@ -167,5 +158,7 @@ Jacobi::Result JacobiMPI::run(const Matrix &init, double epsilon, std::swap(t0, t1); } + std::cout << phi[t1] << std::endl; + return Jacobi::Result{phi[t1], dist, nIter}; }