diff --git a/etc/controlDict b/etc/controlDict index 855d06fbd72b3a016d31d3e98be6ed0b89620a9a..74d85e59017bac8b49d082aaf6dcfcf5551bf012 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -147,6 +147,15 @@ OptimisationSwitches // >= 3 : when there are more than N nodes nodeComms.min 0; + // Selection of topology-aware routines (bitmask) + // 0: disabled [default] + // 1: broadcast [MPI] + // 4: gather/all-gather [MPI] + // 16: combine (reduction) [manual algorithm] + // 32: mapGather (reduction) [manual algorithm] + // 64: gatherList/scatterList [manual algorithm] + topoControl 0; + // Transfer double as float for processor boundaries. Mostly defunct. floatTransfer 0; diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C index 2c1d72b143acf4957a5e4c1f0de0300f83052d6c..8bd928338291ab8fe55c690b015b1b07f2185d65 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C @@ -106,7 +106,35 @@ void Foam::UPstream::printNodeCommsControl(Ostream& os) void Foam::UPstream::printTopoControl(Ostream& os) { - os << "none"; + unsigned count = 0; + + if (UPstream::topologyControl_ > 0) + { + #undef PrintControl + #define PrintControl(Ctrl, Name) \ + if (UPstream::usingTopoControl(topoControls::Ctrl)) \ + { \ + os << (count++ ? ' ' : '(') << Name; \ + } + + PrintControl(broadcast, "broadcast"); + PrintControl(reduce, "reduce"); + PrintControl(gather, "gather"); + PrintControl(combine, "combine"); + PrintControl(mapGather, "mapGather"); + PrintControl(gatherList, "gatherList"); + + #undef PrintControl + } + + if (count) + { + os << ')'; // End the list + } + else + { + os << "none"; + } }