From d38de84d212ae30fde2bd9c74d88bac65eb71ba8 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 28 Mar 2022 16:30:51 +0200 Subject: [PATCH] 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 --- applications/test/Tuple2/Test-Tuple2.C | 10 +- applications/test/treeComms/Make/files | 3 + applications/test/treeComms/Make/options | 2 + applications/test/treeComms/Test-treeComms.C | 241 ++++++++++++++ .../extrudeToRegionMesh/extrudeToRegionMesh.C | 18 +- .../DelaunayMesh/DistributedDelaunayMesh.C | 5 +- .../backgroundMeshDecomposition.C | 5 +- .../conformalVoronoiMeshCalcDualMesh.C | 5 +- .../conformalVoronoiMeshConformToSurface.C | 18 +- .../initialPointsMethod/pointFile/pointFile.C | 7 +- .../manipulation/checkMesh/checkTopology.C | 7 +- .../manipulation/createPatch/createPatch.C | 5 +- .../splitMeshRegions/splitMeshRegions.C | 3 +- .../foamFormatConvert/foamFormatConvert.C | 8 +- .../parLagrangianRedistributor.C | 2 +- .../redistributePar/redistributePar.C | 5 +- .../foamToEnsight/findCloudFields.H | 3 +- .../foamToEnsight/foamToEnsight.C | 2 +- .../particleTracks/particleTracks.C | 3 +- .../postChannel/channelIndexTemplates.C | 3 +- .../preProcessing/setFields/setFields.C | 3 +- .../viewFactorsGen/viewFactorsGen.C | 11 +- .../surfaceRedistributePar.C | 3 +- src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H | 314 ++++++++++++------ .../IOstreams/Pstreams/PstreamCombineGather.C | 230 +++++++++---- .../Pstreams/PstreamCombineReduceOps.H | 12 +- .../db/IOstreams/Pstreams/PstreamGather.C | 26 +- .../db/IOstreams/Pstreams/PstreamGatherList.C | 53 ++- src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H | 12 +- src/OpenFOAM/fields/Fields/Field/FieldOps.C | 9 +- .../hostCollatedFileOperation.C | 5 +- .../procFacesGAMGProcAgglomeration.C | 3 +- .../ProcessorTopology/ProcessorTopology.C | 4 +- .../polyMesh/globalMeshData/globalMeshData.C | 5 +- .../mapDistributeBaseTemplates.C | 1 - .../mapDistribute/mapDistributeTemplates.C | 1 - .../polyBoundaryMesh/polyBoundaryMesh.C | 6 +- .../meshes/polyMesh/syncTools/syncTools.H | 4 +- .../meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C | 6 +- .../powerLawLopesdaCosta.C | 8 +- .../freeSurfacePointDisplacement.C | 4 +- .../pointHistory/pointHistory.C | 3 +- .../extrudePatchMesh/extrudePatchMesh.C | 3 +- .../fvMeshDistribute/fvMeshDistribute.C | 1 - .../fvMeshDistributeTemplates.C | 3 +- src/dynamicMesh/fvMeshSubset/fvMeshSubset.C | 8 +- .../polyTopoChange/hexRef8/hexRef8.C | 6 +- .../faGlobalMeshData/faGlobalMeshData.C | 3 +- .../faMesh/faMeshDemandDrivenData.C | 8 +- .../turbulentDFSEMInletFvPatchVectorField.C | 17 +- src/functionObjects/field/Curle/Curle.C | 3 +- .../columnAverage/columnAverageTemplates.C | 6 +- .../extractEulerianParticles.C | 7 +- .../field/fieldMinMax/fieldMinMaxTemplates.C | 20 +- .../fieldValue/fieldValueTemplates.C | 5 +- .../regionSizeDistribution.C | 6 +- src/functionObjects/forces/forces/forces.C | 6 +- .../forces/propellerInfo/propellerInfo.C | 6 +- .../utilities/areaWrite/areaWrite.C | 7 +- src/lagrangian/basic/Cloud/Cloud.C | 2 +- src/lagrangian/basic/Cloud/CloudIO.C | 3 +- .../basic/InteractionLists/InteractionLists.C | 6 +- .../CellZoneInjection/CellZoneInjection.C | 3 +- .../PatchInjection/patchInjectionBase.C | 9 +- .../movement/lumpedPointMovement.C | 9 +- .../meshRefinement/meshRefinement.C | 32 +- .../meshRefinement/meshRefinementBaffles.C | 15 +- .../refinementSurfaces/surfaceZonesInfo.C | 8 +- .../snappyHexMeshDriver/snappyRefineDriver.C | 9 +- .../advancingFrontAMIParallelOps.C | 6 +- .../nearestFaceAMI/nearestFaceAMI.C | 5 +- .../cyclicPeriodicAMIPolyPatch.C | 12 +- .../algorithms/PointEdgeWave/PointEdgeWave.C | 1 - .../mappedPolyPatch/mappedPatchBase.C | 21 +- src/meshTools/processorLOD/box/box.C | 3 +- src/meshTools/regionSplit2D/regionSplit2D.C | 3 +- .../cellSources/nearestToCell/nearestToCell.C | 3 +- .../faceSources/regionToFace/regionToFace.C | 4 +- .../planeToFaceZone/planeToFaceZone.C | 12 +- .../nearestToPoint/nearestToPoint.C | 3 +- .../sensitivitySurfacePointsIncompressible.C | 5 +- .../NURBS3DVolume/NURBS3DVolume.C | 6 +- .../cellVolumeWeightCellCellStencil.C | 6 +- .../inverseDistanceCellCellStencil.C | 13 +- .../trackingInverseDistanceCellCellStencil.C | 8 +- src/overset/regionsToCell/findRefCells.C | 6 +- .../multiLevelDecomp/multiLevelDecomp.C | 11 +- .../distributedTriSurfaceMesh.C | 22 +- .../faReconstruct/faMeshReconstructor.C | 3 +- .../singleLayerRegion/singleLayerRegion.C | 3 +- .../meshToMesh/meshToMeshParallelOps.C | 7 +- src/sampling/probes/patchProbes.C | 5 +- src/sampling/probes/patchProbesTemplates.C | 6 +- src/sampling/probes/probesTemplates.C | 6 +- src/sampling/sampledSet/cloud/cloudSet.C | 7 +- .../sampledSet/patchCloud/patchCloudSet.C | 5 +- .../sampledSet/patchSeed/patchSeedSet.C | 10 +- .../sampledSet/sampledSets/sampledSets.C | 7 +- .../sampledSet/shortestPath/shortestPathSet.C | 2 +- .../sampledMeshedSurface.C | 3 +- .../sampledSurfaces/sampledSurfaces.C | 7 +- .../surface/isoSurface/isoSurfacePoint.C | 5 +- .../TDACChemistryModel/TDACChemistryModel.C | 3 +- .../solarLoad/faceReflecting/faceReflecting.C | 10 +- .../radiationModels/viewFactor/viewFactor.C | 12 +- 105 files changed, 935 insertions(+), 605 deletions(-) create mode 100644 applications/test/treeComms/Make/files create mode 100644 applications/test/treeComms/Make/options create mode 100644 applications/test/treeComms/Test-treeComms.C diff --git a/applications/test/Tuple2/Test-Tuple2.C b/applications/test/Tuple2/Test-Tuple2.C index 13375a0f71..95df0e5a42 100644 --- a/applications/test/Tuple2/Test-Tuple2.C +++ b/applications/test/Tuple2/Test-Tuple2.C @@ -39,7 +39,7 @@ Description #include "List.H" #include "ListOps.H" #include "ops.H" -#include "PstreamCombineReduceOps.H" +#include "Pstream.H" #include using namespace Foam; @@ -138,8 +138,8 @@ int main() maxFirstEqOp