From eb4345ed44c5481f95fe494ab0dea9ed28822127 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 14 Feb 2025 15:49:05 +0100 Subject: [PATCH] ENH: misc Pstream adjustments - additional startup guard for inter-node/local-node queries (UPstream) - impose linear communication tree for inter-node/local-node communicators. Was previously defaulted to a basic tree, but more consistent to have flat addressing for these types of connections. - demand-driven UPstream::interNode_offsets() for walking inter-node ranges instead of creating it manually in various places. - (style): List instead of labelList for internal commsStruct since the communication structures are tied to MPI sizes and not to the OpenFOAM label sizes - reduce the number of intermediate buffer allocations within gatherList, scatterList. --- .../test/nodeTopology/Test-nodeTopology.cxx | 113 +++----- .../IOstreams/Pstreams/PstreamCombineGather.C | 6 +- .../db/IOstreams/Pstreams/PstreamGather.C | 18 +- .../db/IOstreams/Pstreams/PstreamGatherList.C | 213 ++++++++++----- src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C | 48 +++- src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H | 77 +++--- .../IOstreams/Pstreams/UPstreamCommsStruct.C | 247 ++++++++++++------ src/OpenFOAM/global/argList/argList.C | 42 +-- 8 files changed, 479 insertions(+), 285 deletions(-) diff --git a/applications/test/nodeTopology/Test-nodeTopology.cxx b/applications/test/nodeTopology/Test-nodeTopology.cxx index db4a5eeaf4..9909d51d4f 100644 --- a/applications/test/nodeTopology/Test-nodeTopology.cxx +++ b/applications/test/nodeTopology/Test-nodeTopology.cxx @@ -59,13 +59,13 @@ int main(int argc, char *argv[]) label nProcs = UPstream::nProcs(UPstream::worldComm); - List interNodeProcs_fake; + DynamicList fake_interNode_offsets; if (UPstream::parRun()) { if (args.found("numProcs")) { - InfoErr<< "ignoring -np option in parallel" << nl; + InfoErr<< "ignoring -numProcs option in parallel" << nl; } if (args.found("cores")) { @@ -78,25 +78,40 @@ int main(int argc, char *argv[]) nProcs = args.getOrDefault