From 7654cac5a2582ae93960409351eb2ffd4dadd4bc Mon Sep 17 00:00:00 2001 From: WickedJack99 Date: Sun, 29 Jun 2025 20:19:22 +0200 Subject: [PATCH] .... --- lab12/exc4/jacobi.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lab12/exc4/jacobi.cpp b/lab12/exc4/jacobi.cpp index 12fc5f2..03e0b46 100644 --- a/lab12/exc4/jacobi.cpp +++ b/lab12/exc4/jacobi.cpp @@ -82,7 +82,7 @@ void Jacobi::exchangeHaloLayersNodeMPIProcFirst(Matrix &phi) // Communication with upper partner if (!isLastRank()) { - int upper = rank_ - 1; + int upper = rank_ + 1; MPI_Isend(&phi(n - 2, 0), sendSize, MPI_DOUBLE, upper, tag, MPI_COMM_WORLD, &req.emplace_back()); MPI_Irecv(&phi(n - 1, 0), sendSize, MPI_DOUBLE, upper, tag, MPI_COMM_WORLD, @@ -159,7 +159,7 @@ void Jacobi::exchangeHaloLayersNodeMPIProcSecond(Matrix &phi) // Communication with lower partner if (!isFirstRank()) { - int lower = rank_ + 1; + int lower = rank_ - 1; MPI_Isend(&phi(1, 0), sendSize, MPI_DOUBLE, lower, tag, MPI_COMM_WORLD, &req.emplace_back()); MPI_Irecv(&phi(0, 0), sendSize, MPI_DOUBLE, lower, tag, MPI_COMM_WORLD,