From b1bf9af98bec797b8efd13166771570ba5974973 Mon Sep 17 00:00:00 2001 From: kai Date: Sat, 31 May 2025 16:34:17 +0200 Subject: [PATCH] fix gather --- lab10/jacobi/jacobi_mpi.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lab10/jacobi/jacobi_mpi.cpp b/lab10/jacobi/jacobi_mpi.cpp index 0974cd6..8caa6b3 100644 --- a/lab10/jacobi/jacobi_mpi.cpp +++ b/lab10/jacobi/jacobi_mpi.cpp @@ -162,7 +162,11 @@ Jacobi::Result JacobiMPI::run(const Matrix &init, double epsilon, Matrix result = Matrix::zeros(numProc * numRows, numCols); - MPI_Gather(&phi[t0], numRows * numCols, MPI_DOUBLE, result.data(), + if (rank == 0) { + std::cout << "try to gather" << std::endl; + } + + MPI_Gather(phi[t0].data(), numRows * numCols, MPI_DOUBLE, result.data(), numRows * numCols, MPI_DOUBLE, 0, MPI_COMM_WORLD); return Jacobi::Result{phi[t0], dist, nIter};