From 1ce7a62209aeedf21adc1be673042648504288f6 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 10 Feb 2023 21:03:43 +0100 Subject: [PATCH] ENH: Pstream::exchange with Map data - dynamic sparse data exchange using Map to hold data and sizes. Still uses the personalised exchange paradigm, but with non-blocking consensus exchange to obtain the sizes and regular point-to-point for the data exchange itself. This avoids an all-to-all but still keeps the point-to-point for overlapping communication, data chunking etc. --- .../parallel-chunks/Test-parallel-chunks.C | 31 ++ src/OpenFOAM/db/IOstreams/Pstreams/Pstream.H | 70 +++-- .../db/IOstreams/Pstreams/PstreamExchange.C | 288 ++++++++++++++++-- 3 files changed, 348 insertions(+), 41 deletions(-) diff --git a/applications/test/parallel-chunks/Test-parallel-chunks.C b/applications/test/parallel-chunks/Test-parallel-chunks.C index cbb372298f..b5181bccec 100644 --- a/applications/test/parallel-chunks/Test-parallel-chunks.C +++ b/applications/test/parallel-chunks/Test-parallel-chunks.C @@ -32,6 +32,8 @@ Description \*---------------------------------------------------------------------------*/ +#define Foam_PstreamExchange_debug_chunks + #include "List.H" #include "argList.H" #include "Time.H" @@ -371,6 +373,7 @@ int main(int argc, char *argv[]) } // Manually + Info<< "perform list exchange" << endl; { labelListList sendBufs(UPstream::nProcs()); labelListList recvBufs(UPstream::nProcs()); @@ -397,6 +400,34 @@ int main(int argc, char *argv[]) ); } + + Info<< "perform Map exchange" << endl; + { + Map sendBufs; + Map recvBufs; + Map