Merge pull request #4753 from blattms/fix-fallout-4750

Don't write out of bounds (fixes fallout from PR #4750)
This commit is contained in:
Atgeirr Flø Rasmussen 2023-07-24 21:39:21 +02:00 committed by GitHub
commit 4ad4226fdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,7 +95,7 @@ void checkAllMPIProcesses()
for(decltype(comm.size()) i = 1; i < comm.size(); ++i)
{
if (auto error = MPI_Irecv(data.data() + i, 1, MPI_INT, i, tag, comm, requests.data() + i - 1);
if (auto error = MPI_Irecv(data.data() + (i - 1), 1, MPI_INT, i, tag, comm, requests.data() + (i - 1));
error != MPI_SUCCESS) {
OpmLog::error(fmt::format("Error: Could not set up MPI receive (error code : {})", error));
MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE);