More consistent use of combineReduce, simpler and/or reductions
- update code base to reflect the consolidated list/map reductions
- replace old code use of
returnReduce(list.size(), sumOp<label>())
in favour ofreturnReduceOr(list.size())
which is cleaner to write/understand and also marginally more efficient
General overview under https://develop.openfoam.com/Development/openfoam/-/wikis/coding/patterns/parallel
Merge request reports
Activity
changed milestone to %v2212
requested review from @kuti
assigned to @andy
@andy, @kuti, @Mattijs - although currently tagged as draft the MR should be complete to go. I have rebased onto the current develop, but most of the testing was already done in August.
However, given the number of lines being hit with the changes, an extra set of eyes (the more the better) is useful (ie, please review sooner, rather than later). Most of the changes are fairly trivial, but in a few places the logic has been untwisted slightly.
Edited by Mark OLESEN- Resolved by Andrew Heather
- saw returnReduceAnd. Maps to a native mpi call. Any knowledge of speedups? (since potentially no return trip necessary)
- I have to get used to these type of constructs
- @@ -188,11 +188,12 @@ void Foam::surfaceToCell::combine(topoSet& set, const bool add) const { // Find cell point is in. Linear search. label celli = queryMesh.findCell(outsidePoint, -1, false); - if (returnReduce(celli, maxOp<label>()) == -1) + + if (returnReduceAnd(celli < 0)) { FatalErrorInFunction << "outsidePoint " << outsidePoint
- Resolved by Kutalmış Berçin
- Discouraging any further use of
mapCombineAllGather
,listCombineAllGather
andcombineAllGather
in Pstream.H by deprecating them viaFOAM_DEPRECATED_FOR
? - Should all
scatter
be replaced bybroadcast
incl.globalIndex
? Example: metisLikeDecomp.C#L178.
- Discouraging any further use of
- Resolved by Kutalmış Berçin
@Mattijs - would you mind to double check the change below in snappyHexMesh.C#L419?
(old)
forAllConstIters(patchSize, iter) { label sz = compactZoneID.size(); compactZoneID.insert(iter.key(), sz); }
vs (new)
if (Pstream::master()) { forAllConstIters(patchSize, iter) { compactZoneID.insert(iter.key(), compactZoneID.size()); } }
- Resolved by Kutalmış Berçin
- Do we need to add the
sort
in parLagrangianDistributor.C#L132 (& #L93)? Changing the previous behaviour?
- Do we need to add the
- Resolved by Kutalmış Berçin
- Resolved by Kutalmış Berçin
added 4 commits
-
12470219...3c214e99 - 2 commits from branch
develop
- 9e180c98 - ENH: more consistent use of broadcast, combineReduce etc.
- 63f56f98 - ENH: use returnReduceAnd(), returnReduceOr() functions
-
12470219...3c214e99 - 2 commits from branch
- Resolved by Andrew Heather
added 27 commits
-
63f56f98...35aa6140 - 25 commits from branch
develop
- 4507a3aa - ENH: more consistent use of broadcast, combineReduce etc.
- a98c7865 - ENH: use returnReduceAnd(), returnReduceOr() functions
-
63f56f98...35aa6140 - 25 commits from branch
added 9 commits
-
2bfe085f...b9c15b85 - 4 commits from branch
develop
- 473e1441 - ENH: more consistent use of broadcast, combineReduce etc.
- 70208a73 - ENH: use returnReduceAnd(), returnReduceOr() functions
- 799d2471 - ENH: PatchTools::gatherAndMerge with recovery of the globalIndex
- b7592c1e - ENH: preserve globalIndex merge information within mergedSurf
- 5b29ff0e - ENH: consolidate 'formatOptions' handling for coordSetWriter/surfaceWriter
Toggle commit list-
2bfe085f...b9c15b85 - 4 commits from branch
mentioned in commit 7fa4f1ef