mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: prefer listReduce() to using listCombineReduce() when possible
- potentially allows access into the builtin MPI operations
This commit is contained in:
@ -222,7 +222,7 @@ bool Foam::functionObjects::Curle::execute()
|
||||
|
||||
pDash /= 4*mathematical::pi;
|
||||
|
||||
Pstream::listCombineReduce(pDash, plusEqOp<scalar>());
|
||||
Pstream::listReduce(pDash, sumOp<scalar>());
|
||||
|
||||
if (surfaceWriterPtr_)
|
||||
{
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2018-2024 OpenCFD Ltd.
|
||||
Copyright (C) 2018-2025 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -88,8 +88,8 @@ bool Foam::functionObjects::columnAverage::columnAverageField
|
||||
}
|
||||
|
||||
// Global sum
|
||||
Pstream::listCombineReduce(regionField, plusEqOp<Type>());
|
||||
Pstream::listCombineReduce(regionCount, plusEqOp<label>());
|
||||
Pstream::listReduce(regionField, sumOp<Type>());
|
||||
Pstream::listReduce(regionCount, sumOp<label>());
|
||||
|
||||
forAll(regionField, regioni)
|
||||
{
|
||||
|
||||
@ -329,7 +329,7 @@ void Foam::functionObjects::extractEulerianParticles::calculateAddressing
|
||||
|
||||
// Create map from new regions to slots in particles list
|
||||
// - filter through new-to-new addressing to identify new particles
|
||||
Pstream::listCombineReduce(newToNewRegion, maxEqOp<label>());
|
||||
Pstream::listReduce(newToNewRegion, maxOp<label>());
|
||||
|
||||
label nParticle = -1;
|
||||
labelHashSet newRegions;
|
||||
@ -348,7 +348,7 @@ void Foam::functionObjects::extractEulerianParticles::calculateAddressing
|
||||
|
||||
// Accumulate old region data or create a new particle if there is no
|
||||
// mapping from the old-to-new region
|
||||
Pstream::listCombineReduce(oldToNewRegion, maxEqOp<label>());
|
||||
Pstream::listReduce(oldToNewRegion, maxOp<label>());
|
||||
|
||||
List<eulerianParticle> newParticles(newRegionToParticleMap.size());
|
||||
forAll(oldToNewRegion, oldRegioni)
|
||||
|
||||
@ -155,8 +155,8 @@ bool Foam::histogramModels::equalBinWidth::write(const bool log)
|
||||
dataCount[bini]++;
|
||||
}
|
||||
}
|
||||
Pstream::listCombineGather(dataNormalised, plusEqOp<scalar>());
|
||||
Pstream::listCombineGather(dataCount, plusEqOp<label>());
|
||||
Pstream::listGather(dataNormalised, sumOp<scalar>());
|
||||
Pstream::listGather(dataCount, sumOp<label>());
|
||||
|
||||
|
||||
// Write histogram data
|
||||
|
||||
@ -129,8 +129,8 @@ bool Foam::histogramModels::unequalBinWidth::write(const bool log)
|
||||
}
|
||||
}
|
||||
}
|
||||
Pstream::listCombineGather(dataNormalised, plusEqOp<scalar>());
|
||||
Pstream::listCombineGather(dataCount, plusEqOp<label>());
|
||||
Pstream::listGather(dataNormalised, sumOp<scalar>());
|
||||
Pstream::listGather(dataCount, sumOp<label>());
|
||||
|
||||
|
||||
// Write histogram data
|
||||
|
||||
@ -791,7 +791,7 @@ Foam::tmp<Foam::Field<Type>> Foam::functionObjects::propellerInfo::interpolate
|
||||
}
|
||||
}
|
||||
|
||||
Pstream::listCombineReduce(field, maxEqOp<Type>());
|
||||
Pstream::listReduce(field, maxOp<Type>());
|
||||
|
||||
return tfield;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user