gather result matrix

This commit is contained in:
kai
2025-05-31 15:32:01 +02:00
parent 8ffae5b02b
commit 4581a62126

View File

@@ -160,5 +160,10 @@ Jacobi::Result JacobiMPI::run(const Matrix &init, double epsilon,
std::swap(t0, t1);
}
Matrix result = Matrix::zeros(numProc * numRows, numCols);
MPI_Gather(&phi[t0], numRows * numCols, MPI_DOUBLE, result.data(),
numRows * numCols, MPI_DOUBLE, 0, MPI_COMM_WORLD);
return Jacobi::Result{phi[t0], dist, nIter};
}