ENH: use returnReduceAnd(), returnReduceOr() functions

DOC: document which MPI send/recv are associated with commType
This commit is contained in:
Mark Olesen
2022-08-24 12:00:44 +02:00
committed by Andrew Heather
parent 473e14418a
commit 70208a7399
172 changed files with 574 additions and 840 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2021 OpenCFD Ltd.
Copyright (C) 2021-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -78,6 +78,6 @@ if (timeDirs.size() > 1)
}
// Ensure consistency
reduce(hasMovingMesh, orOp<bool>());
Pstream::reduceOr(hasMovingMesh);
// ************************************************************************* //

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2021 OpenCFD Ltd.
Copyright (C) 2018-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
@ -38,7 +38,7 @@ if (doLagrangian)
Info<< "Cloud " << cloudName << " (";
const bool cloudExists =
returnReduce(currentCloudDirs.found(cloudName), orOp<bool>());
returnReduceOr(currentCloudDirs.found(cloudName));
{
autoPtr<ensightFile> os = ensCase.newCloud(cloudName);
@ -82,7 +82,7 @@ if (doLagrangian)
const bool oldParRun = Pstream::parRun(false);
fieldExists = fieldObject.typeHeaderOk<IOField<scalar>>(false);
Pstream::parRun(oldParRun); // Restore parallel state
reduce(fieldExists, orOp<bool>());
Pstream::reduceOr(fieldExists);
}
bool wrote = false;

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -64,9 +64,7 @@ Foam::label Foam::checkData
}
}
reduce(good, andOp<bool>());
if (good)
if (returnReduceAnd(good))
{
goodFields.insert(fieldName);
}

View File

@ -64,7 +64,7 @@ if (doLagrangian)
isCloud = true;
}
if (!returnReduce(isCloud, orOp<bool>()))
if (!returnReduceOr(isCloud))
{
continue;
}
@ -76,7 +76,7 @@ if (doLagrangian)
);
// Are there cloud fields (globally)?
if (returnReduce(cloudObjs.empty(), andOp<bool>()))
if (returnReduceAnd(cloudObjs.empty()))
{
continue;
}

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -68,7 +69,7 @@ void Foam::channelIndex::walkOppositeFaces
blockedFace[facei] = true;
}
while (returnReduce(frontFaces.size(), sumOp<label>()) > 0)
while (returnReduceOr(frontFaces.size()))
{
// Transfer across.
boolList isFrontBndFace(nBnd, false);