ENH: additional gather/scatter modes for PstreamBuffers

- gather/scatter types of operations can avoid AllToAll communication
  and use simple MPI gather (or scatter) to establish the receive sizes.

  New methods: finishedGathers() / finishedScatters()
This commit is contained in:
Mark Olesen
2022-03-11 12:15:59 +01:00
parent a674c9d373
commit de8ef5332d
11 changed files with 237 additions and 71 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2020 OpenCFD Ltd.
Copyright (C) 2018-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -223,11 +223,12 @@ bool Foam::functionObjects::energySpectrum::write()
{
PstreamBuffers pBufs(Pstream::commsTypes::nonBlocking);
UOPstream toProc(Pstream::masterNo(), pBufs);
{
UOPstream toMaster(Pstream::masterNo(), pBufs);
toMaster << Uc << C << cellAddr_;
}
toProc << Uc << C << cellAddr_;
pBufs.finishedSends();
pBufs.finishedGathers();
if (Pstream::master())
{