From 2b54d86152c5ff9837a6b1b4dc8d253e982f7710 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 2 Mar 2022 14:00:29 +0100 Subject: [PATCH] ENH: improve processor topology handling in zoneDistribute (#2371) - now largely encapsulated using PstreamBuffers methods, which makes it simpler to centralize and maintain - avoid building intermediate structures when sending data, remove unused methods/data TUT: parallel version of depthCharge2D STYLE: minor update in ProcessorTopology --- src/OpenFOAM/Make/files | 3 +- .../db/IOstreams/Pstreams/PstreamBuffers.C | 69 ++++++++++ .../db/IOstreams/Pstreams/PstreamBuffers.H | 22 +++ .../ProcessorTopology/ProcessorTopology.C | 53 +++---- .../ProcessorTopology/ProcessorTopology.H | 33 +++-- .../commSchedule}/commSchedule.C | 9 +- .../commSchedule}/commSchedule.H | 0 .../fvMesh/zoneDistribute/zoneDistribute.C | 129 ++---------------- .../fvMesh/zoneDistribute/zoneDistribute.H | 61 +++++---- .../fvMesh/zoneDistribute/zoneDistributeI.H | 96 ++++--------- .../reconstructedDistanceFunction.C | 6 +- .../plicSchemes/gradAlpha/gradAlpha.C | 10 +- .../plicSchemes/gradAlpha/gradAlpha.H | 4 +- .../plicSchemes/plicRDF/plicRDF.C | 9 +- .../plicSchemes/plicRDF/plicRDF.H | 1 - .../laminar/depthCharge2D/Allrun-parallel | 18 +++ .../depthCharge2D/system/decomposeParDict | 27 ++++ 17 files changed, 264 insertions(+), 286 deletions(-) rename src/OpenFOAM/{meshes/ProcessorTopology => parallel/commSchedule}/commSchedule.C (97%) rename src/OpenFOAM/{meshes/ProcessorTopology => parallel/commSchedule}/commSchedule.H (100%) create mode 100755 tutorials/multiphase/compressibleInterIsoFoam/laminar/depthCharge2D/Allrun-parallel create mode 100644 tutorials/multiphase/compressibleInterIsoFoam/laminar/depthCharge2D/system/decomposeParDict diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 3dddd83190..6d5f793316 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -592,8 +592,6 @@ polyBoundaryMesh = $(polyMesh)/polyBoundaryMesh $(polyBoundaryMesh)/polyBoundaryMesh.C $(polyBoundaryMesh)/polyBoundaryMeshEntries.C -meshes/ProcessorTopology/commSchedule.C - globalMeshData = $(polyMesh)/globalMeshData $(globalMeshData)/globalMeshData.C $(globalMeshData)/globalPoints.C @@ -812,6 +810,7 @@ algorithms/indexedOctree/volumeType.C algorithms/dynamicIndexedOctree/dynamicIndexedOctreeName.C algorithms/dynamicIndexedOctree/dynamicTreeDataPoint.C +parallel/commSchedule/commSchedule.C parallel/globalIndex/globalIndex.C meshes/data/data.C diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBuffers.C b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBuffers.C index 07e7eccc49..d7e4c3d87e 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBuffers.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBuffers.C @@ -27,6 +27,7 @@ License \*---------------------------------------------------------------------------*/ #include "PstreamBuffers.H" +#include "bitSet.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -306,4 +307,72 @@ void Foam::PstreamBuffers::finishedSends } +bool Foam::PstreamBuffers::finishedSends +( + bitSet& sendConnections, + DynamicList