42 below_(
std::move(below)),
43 allBelow_(
std::move(allBelow)),
44 allNotBelow_(
std::move(allNotBelow))
60 allNotBelow_(numProcs - allBelow.size() - 1)
65 isNotBelow[myProcID] =
false;
70 isNotBelow[proci] =
false;
77 if (isNotBelow[proci])
79 allNotBelow_[nNotBelow++] = proci;
83 if (nNotBelow != allNotBelow_.
size())
86 <<
"Problem: " << nNotBelow <<
" != " << allNotBelow_.
size() <<
nl 104 const auto& below = comms[proci].below();
108 os <<
nl <<
"// communication graph:" <<
nl;
109 os.beginBlock(
"graph");
120 for (
const label nbrProci : below)
130 os << proci <<
" -- " << nbrProci;
144 for (
const label nbrProci : below)
147 printGraph(
os, comms, nbrProci);
163 return (1 + allBelow_.size() + allNotBelow_.size());
172 allNotBelow_.clear();
234 for (label step = 1; step < numProcs; step = mod)
248 j < numProcs && j <
procID + mod;
257 j < numProcs && j <
procID + mod;
267 *
this = UPstream::commsStruct(numProcs,
procID, above, below, allBelow);
277 auto& val = this->v_[
procID];
279 if (val.nProcs() != size())
282 val.reset(
procID, size());
303 (above_ == comm.
above())
324 comm.allNotBelow().writeList(
os);
const labelList & below() const noexcept
The procIDs of the processors directly below.
commsStruct() noexcept
Default construct with above == -1.
void size(const label n)
Older name for setAddressableSize.
Ostream & indent(Ostream &os)
Indent stream.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
bool empty() const noexcept
True if List is empty (ie, size() is zero)
static int nProcsSimpleSum
Number of processors to change from linear to tree communication.
static void printGraph(Ostream &os, const UList< UPstream::commsStruct > &comms, const label proci=0)
Print un-directed graph in graphviz dot format.
void reset()
Reset to default constructed state.
label above() const noexcept
The procID of the processor directly above.
#define forAll(list, i)
Loop across all elements in list.
T & operator[](const label i)
Return element of UList.
dimensionedScalar pos(const dimensionedScalar &ds)
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
label nProcs() const
The number of processors addressed by the structure.
errorManip< error > abort(error &err)
Structure for communicating between processors.
const labelList & allBelow() const noexcept
The procIDs of all processors below (so not just directly below)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
bool operator==(const commsStruct &) const
OBJstream os(runTime.globalPath()/outputName)
bool operator!=(const commsStruct &) const
void push_back(const T &val)
Copy append an element to the end of this list.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
static List< int > & procID(const label communicator)
The list of ranks within a given communicator.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)