59 <<
"Size of list:" << values.size()
60 <<
" does not equal the number of processors:"
69 for (
const label belowID : myComm.
below())
71 const labelList& belowLeaves = comms[belowID].allBelow();
87 values[belowID] = received[0];
91 values[belowLeaves[leafI]] = received[leafI + 1];
104 fromBelow >> values[belowID];
108 Pout<<
" received through "
109 << belowID <<
" data from:" << belowID
110 <<
" data:" << values[belowID] <<
endl;
114 for (
const label leafID : belowLeaves)
116 fromBelow >> values[leafID];
120 Pout<<
" received through "
121 << belowID <<
" data from:" << leafID
122 <<
" data:" << values[leafID] <<
endl;
131 if (myComm.
above() != -1)
147 forAll(belowLeaves, leafI)
149 sending[leafI + 1] = values[belowLeaves[leafI]];
174 for (
const label leafID : belowLeaves)
178 Pout<<
" sending to "
179 << myComm.
above() <<
" data from:" << leafID
180 <<
" data:" << values[leafID] <<
endl;
182 toAbove << values[leafID];
208 <<
"Size of list:" << values.size()
209 <<
" does not equal the number of processors:"
218 if (myComm.
above() != -1)
236 forAll(notBelowLeaves, leafI)
238 values[notBelowLeaves[leafI]] = received[leafI];
252 for (
const label leafID : notBelowLeaves)
254 fromAbove >> values[leafID];
258 Pout<<
" received through "
259 << myComm.
above() <<
" data for:" << leafID
260 <<
" data:" << values[leafID] <<
endl;
269 const label belowID = myComm.
below()[belowI];
270 const labelList& notBelowLeaves = comms[belowID].allNotBelow();
276 forAll(notBelowLeaves, leafI)
278 sending[leafI] = values[notBelowLeaves[leafI]];
303 for (
const label leafID : notBelowLeaves)
305 toBelow << values[leafID];
309 Pout<<
" sent through "
310 << belowID <<
" data for:" << leafID
311 <<
" data:" << values[leafID] <<
endl;
Input inter-processor communications stream.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Output inter-processor communications stream.
label nProcs() const noexcept
Number of ranks associated with PstreamBuffers.
static void allGatherList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
static void gatherList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
static void scatterList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
virtual bool read()
Re-read model coefficients if they have changed.
char * data_bytes() noexcept
Return pointer to the underlying array serving as data storage,.
const char * cdata_bytes() const noexcept
Return pointer to the underlying array serving as data storage,.
void size(const label n)
Older name for setAddressableSize.
std::streamsize size_bytes() const noexcept
Number of contiguous bytes for the List data.
Structure for communicating between processors.
const labelList & allBelow() const noexcept
const labelList & below() const noexcept
The procIDs of all processors directly below.
label above() const noexcept
The procID of the processor directly above.
const labelList & allNotBelow() const noexcept
static const List< commsStruct > & whichCommunication(const label communicator=worldComm)
static bool & parRun() noexcept
Test if this a parallel run.
virtual bool write()
Write the output fields.
int myProcNo() const noexcept
Return processor number.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
#define forAll(list, i)
Loop across all elements in list.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
A template class to specify that a data type can be considered as being contiguous in memory.