ENH: bundle Pstream:: AllGather methods

- bundles frequently used 'gather/scatter' patterns more consistently.

  - combineAllGather     -> combineGather + broadcast
  - listCombineAllGather -> listCombineGather + broadcast
  - mapCombineAllGather  -> mapCombineGather + broadcast
  - allGatherList        -> gatherList + scatterList
  - reduce               -> gather + broadcast (ie, allreduce)

- The allGatherList currently wraps gatherList/scatterList, but may be
  replaced with a different algorithm in the future.

STYLE: PstreamCombineReduceOps.H is mostly unneeded now
This commit is contained in:
Mark Olesen
2022-03-28 16:30:51 +02:00
parent e98acdc4fc
commit d38de84d21
105 changed files with 935 additions and 605 deletions

View File

@ -286,7 +286,7 @@ Foam::parLagrangianRedistributor::redistributeLagrangianPositions
nsTransPs[sendProcI] = subMap[sendProcI].size();
}
// Send sizes across. Note: blocks.
combineReduce(sizes, Pstream::listEq());
Pstream::combineAllGather(sizes, Pstream::listEq());
labelListList constructMap(Pstream::nProcs());
label constructSize = 0;

View File

@ -2649,7 +2649,7 @@ int main(int argc, char *argv[])
bool nfs = true;
{
List<fileName> roots(1, args.rootPath());
combineReduce(roots, ListOps::uniqueEqOp<fileName>());
Pstream::combineAllGather(roots, ListOps::uniqueEqOp<fileName>());
nfs = (roots.size() == 1);
}
@ -3280,8 +3280,7 @@ int main(int argc, char *argv[])
)
);
meshDir[Pstream::myProcNo()] = fName.path();
Pstream::gatherList(meshDir);
Pstream::scatterList(meshDir);
Pstream::allGatherList(meshDir);
//Info<< "Per processor faces dirs:" << nl
// << " " << meshDir << nl << endl;
}