BUG: PPCR: check outstanding request. Fixes #2577

If the exit is through maxIter it should still wait
for outstanding requests
This commit is contained in:
mattijs
2022-09-07 14:16:43 +01:00
parent b6a6e40c27
commit 2a007b007e

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019-2020 Mattijs Janssens
Copyright (C) 2020-2021 OpenCFD Ltd.
Copyright (C) 2020-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -170,7 +170,7 @@ Foam::solverPerformance Foam::PPCG::scalarSolveCG
)
{
// Make sure gamma,delta are available
if (Pstream::parRun())
if (Pstream::parRun() && outstandingRequest != -1)
{
Pstream::waitRequest(outstandingRequest);
outstandingRequest = -1;
@ -248,6 +248,12 @@ Foam::solverPerformance Foam::PPCG::scalarSolveCG
matrix_.Amul(n, m, interfaceBouCoeffs_, interfaces_, cmpt);
}
// Cleanup any outstanding requests
if (Pstream::parRun() && outstandingRequest != -1)
{
Pstream::waitRequest(outstandingRequest);
}
return solverPerf;
}