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();
81 received.data_bytes(),
82 received.size_bytes(),
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
114 for (
const label leafID : belowLeaves)
116 fromBelow >>
values[leafID];
120 Pout<<
" received through " 121 << belowID <<
" data from:" << leafID
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
182 toAbove <<
values[leafID];
193 const List<UPstream::commsStruct>& comms,
208 <<
"Size of list:" <<
values.size()
209 <<
" does not equal the number of processors:" 218 if (myComm.above() != -1)
220 const labelList& notBelowLeaves = myComm.allNotBelow();
222 if (is_contiguous<T>::value)
224 List<T> received(notBelowLeaves.size());
230 received.data_bytes(),
231 received.size_bytes(),
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
269 const label belowID = myComm.below()[belowI];
270 const labelList& notBelowLeaves = comms[belowID].allNotBelow();
272 if (is_contiguous<T>::value)
274 List<T> sending(notBelowLeaves.size());
276 forAll(notBelowLeaves, leafI)
278 sending[leafI] =
values[notBelowLeaves[leafI]];
285 sending.cdata_bytes(),
286 sending.size_bytes(),
303 for (
const label leafID : notBelowLeaves)
305 toBelow <<
values[leafID];
309 Pout<<
" sent through " 310 << belowID <<
" data for:" << leafID
const labelList & below() const noexcept
The procIDs of all processors directly below.
static bool write(const UPstream::commsTypes commsType, const int toProcNo, const char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Write buffer contents to given processor.
void size(const label n)
Older name for setAddressableSize.
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.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Ostream & endl(Ostream &os)
Add newline and flush stream.
static bool & parRun() noexcept
Test if this a parallel run.
static const List< commsStruct > & whichCommunication(const label communicator=worldComm)
Communication schedule for linear/tree all-to-master (proc 0). Chooses based on the value of UPstream...
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
label above() const noexcept
The procID of the processor directly above.
#define forAll(list, i)
Loop across all elements in list.
Input inter-processor communications stream.
const char * cdata_bytes() const noexcept
Return pointer to the underlying array serving as data storage,.
static void allGatherList(List< T > &values, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Gather data, but keep individual values separate. Uses linear/tree communication. ...
List< T > values(const HashTable< T, Key, Hash > &tbl, const bool doSort=false)
List of values from HashTable, optionally sorted.
static label nProcs(const label communicator=worldComm)
Number of ranks in parallel run (for given communicator) is 1 for serial run.
static void gatherList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
Gather data, but keep individual values separate. Uses the specified communication schedule...
"scheduled" : (MPI_Send, MPI_Recv)
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)
int debug
Static debugging option.
Output inter-processor communications stream.
A template class to specify that a data type can be considered as being contiguous in memory...
#define forAllReverse(list, i)
Reverse loop across all elements in list.
List< label > labelList
A List of labels.
static label read(const commsTypes commsType, const int fromProcNo, char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Read buffer contents from given processor.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
std::streamsize size_bytes() const noexcept
Number of contiguous bytes for the List data.
static void scatterList(const List< commsStruct > &comms, List< T > &values, const int tag, const label comm)
Scatter data. Reverse of gatherList.