diff --git a/etc/controlDict b/etc/controlDict index ea88edf7d7..164ada0005 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -130,7 +130,7 @@ OptimisationSwitches // Number processors to change to tree communication nProcsSimpleSum 0; // Min numProc to use non-blocking exchange algorithm (Hoeffler: NBX) - nonBlockingExchange 0; + nonBlockingExchange 1; // 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 90a17969a5..599f56edc8 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBuffers.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBuffers.C @@ -27,14 +27,52 @@ License \*---------------------------------------------------------------------------*/ #include "PstreamBuffers.H" +#ifdef Foam_PstreamBuffers_dense #include "bitSet.H" +#endif + +// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * // + +namespace Foam +{ + +#ifdef Foam_PstreamBuffers_map_storage +//- Retrieve size of specified buffer, first checking for existence +static inline label getBufferSize +( + const Map>& buffers, + const label proci +) +{ + const auto iter = buffers.cfind(proci); + + return (iter.good() ? iter.val().size() : 0); +} +#else +//- Retrieve size of specified buffer, no access checking +static inline label getBufferSize +( + const UList>& buffers, + const label proci +) +{ + return buffers[proci].size(); +} +#endif + +} // End namespace Foam + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // void Foam::PstreamBuffers::finalExchange ( const bool wait, + #ifdef Foam_PstreamBuffers_map_storage + Map