diff --git a/etc/controlDict b/etc/controlDict index ea88edf7d7..f6940660f0 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -130,7 +130,9 @@ OptimisationSwitches // Number processors to change to tree communication nProcsSimpleSum 0; // Min numProc to use non-blocking exchange algorithm (Hoeffler: NBX) - nonBlockingExchange 0; + nonBlockingExchange 1; + // Use hybrid NBX/PEX for PstreamBuffers + pbufs.algorithm 0; // MPI buffer size (bytes) // Can override with the MPI_BUFFER_SIZE env variable. diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBuffers.C b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBuffers.C index c8de9f243e..547b77c8d1 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBuffers.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBuffers.C @@ -27,7 +27,6 @@ License \*---------------------------------------------------------------------------*/ #include "PstreamBuffers.H" -#include "bitSet.H" #include "debug.H" #include "registerSwitch.H" @@ -36,7 +35,7 @@ License int Foam::PstreamBuffers::algorithm ( // Not really the most creative name... - Foam::debug::optimisationSwitch("pbufs.algorithm", -1) + Foam::debug::optimisationSwitch("pbufs.algorithm", 0) ); registerOptSwitch ( @@ -134,8 +133,7 @@ void Foam::PstreamBuffers::finalExchange void Foam::PstreamBuffers::finalExchange ( - const labelUList& sendProcs, - const labelUList& recvProcs, + const labelUList& neighProcs, const bool wait, labelList& recvSizes ) @@ -155,7 +153,7 @@ void Foam::PstreamBuffers::finalExchange // Preserve self-send, even if not described by neighbourhood recvSizes[UPstream::myProcNo(comm_)] = 1; - for (const label proci : sendProcs) + for (const label proci : neighProcs) { recvSizes[proci] = 1; // Connected } @@ -172,8 +170,7 @@ void Foam::PstreamBuffers::finalExchange // PEX stage 1: exchange sizes (limited neighbourhood) Pstream::exchangeSizes ( - sendProcs, - recvProcs, + neighProcs, sendBuffers_, recvSizes, tag_, @@ -626,7 +623,7 @@ void Foam::PstreamBuffers::finishedNeighbourSends const bool wait ) { - finalExchange(neighProcs, neighProcs, wait, recvSizes); + finalExchange(neighProcs, wait, recvSizes); } @@ -637,71 +634,7 @@ void Foam::PstreamBuffers::finishedNeighbourSends ) { labelList recvSizes; - finalExchange(neighProcs, neighProcs, wait, recvSizes); -} - - -bool Foam::PstreamBuffers::finishedSends -( - bitSet& sendConnections, - DynamicList