From 5cc6677a4d9365d8bf83df5222ce20e7135eb728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Kvalsvik?= Date: Mon, 1 Jun 2015 12:22:39 +0200 Subject: [PATCH] Makes MPI_Send use the correct buffer size. In the case of both phases being upscaled, only one of the tensors were sent, i.e. the send-buffer was 3 doubles short. This causes program output to always be wrong in the MPI version. --- examples/upscale_relperm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/upscale_relperm.cpp b/examples/upscale_relperm.cpp index 1650df6..b2381bd 100644 --- a/examples/upscale_relperm.cpp +++ b/examples/upscale_relperm.cpp @@ -1631,7 +1631,7 @@ try for (int voigtIdx=0; voigtIdx < tensorElementCount; ++voigtIdx) { sendbuffer[2+tensorElementCount+voigtIdx] = Phase2Perm[idx][voigtIdx]; } - MPI_Send(sendbuffer, 2+tensorElementCount, MPI_DOUBLE, 0, 0, MPI_COMM_WORLD); + MPI_Send(sendbuffer, 2+2*tensorElementCount, MPI_DOUBLE, 0, 0, MPI_COMM_WORLD); } else { double sendbuffer[2+tensorElementCount];