STYLE: prefer listReduce() to using listCombineReduce() when possible

- potentially allows access into the builtin MPI operations
This commit is contained in:
Mark Olesen
2025-02-25 19:26:40 +01:00
parent 5d9f8e9a9d
commit 20b2f46315
38 changed files with 97 additions and 98 deletions

View File

@ -186,7 +186,7 @@ int main(int argc, char *argv[])
const label maxNProcs = returnReduce(maxIds.size(), maxOp<label>());
maxIds.resize(maxNProcs, -1);
Pstream::listCombineReduce(maxIds, maxEqOp<label>());
Pstream::listReduce(maxIds, maxOp<label>());
// From ids to count
const labelList numIds = maxIds + 1;

View File

@ -40,7 +40,7 @@ Foam::Field<T> Foam::channelIndex::regionSum(const Field<T>& cellField) const
}
// Global sum
Pstream::listCombineReduce(regionField, plusEqOp<T>());
Pstream::listReduce(regionField, sumOp<T>());
return regionField;
}