59 <<
"List of values is too small:" <<
values.size()
68 for (
const label belowID : myComm.
below())
70 const labelList& belowLeaves = comms[belowID].allBelow();
80 received.data_bytes(),
81 received.size_bytes(),
86 values[belowID] = received[0];
90 values[belowLeaves[leafI]] = received[leafI + 1];
103 fromBelow >>
values[belowID];
107 Pout<<
" received through " 108 << belowID <<
" data from:" << belowID
113 for (
const label leafID : belowLeaves)
115 fromBelow >>
values[leafID];
119 Pout<<
" received through " 120 << belowID <<
" data from:" << leafID
130 if (myComm.
above() != -1)
146 forAll(belowLeaves, leafI)
148 sending[leafI + 1] =
values[belowLeaves[leafI]];
173 for (
const label leafID : belowLeaves)
177 Pout<<
" sending to " 178 << myComm.
above() <<
" data from:" << leafID
181 toAbove <<
values[leafID];
192 const List<UPstream::commsStruct>& comms,
207 <<
"List of values is too small:" <<
values.size()
216 if (myComm.above() != -1)
218 const labelList& notBelowLeaves = myComm.allNotBelow();
220 if (is_contiguous<T>::value)
222 List<T> received(notBelowLeaves.size());
228 received.data_bytes(),
229 received.size_bytes(),
234 forAll(notBelowLeaves, leafI)
236 values[notBelowLeaves[leafI]] = received[leafI];
250 for (
const label leafID : notBelowLeaves)
252 fromAbove >>
values[leafID];
256 Pout<<
" received through " 257 << myComm.above() <<
" data for:" << leafID
267 const label belowID = myComm.below()[belowI];
268 const labelList& notBelowLeaves = comms[belowID].allNotBelow();
270 if (is_contiguous<T>::value)
272 List<T> sending(notBelowLeaves.size());
274 forAll(notBelowLeaves, leafI)
276 sending[leafI] =
values[notBelowLeaves[leafI]];
283 sending.cdata_bytes(),
284 sending.size_bytes(),
301 for (
const label leafID : notBelowLeaves)
303 toBelow <<
values[leafID];
307 Pout<<
" sent through " 308 << belowID <<
" data for:" << leafID
358 <<
"List of values is too small:" <<
values.size()
const labelList & below() const noexcept
The procIDs of the processors directly below.
void size(const label n)
Older name for setAddressableSize.
static label read(const UPstream::commsTypes commsType, const int fromProcNo, char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, UPstream::Request *req=nullptr)
Read buffer contents from given processor.
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...
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void mpiAllGather(char *allData, int count, const label communicator=worldComm)
Gather/scatter identically-sized char data.
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)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
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). It 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)
static bool is_parallel(const label communicator=worldComm)
True if parallel algorithm or exchange is required.
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.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
A template class to specify that a data type can be considered as being contiguous in memory...
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, UPstream::Request *req=nullptr, const UPstream::sendModes sendMode=UPstream::sendModes::normal)
Write buffer contents to given processor.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
List< label > labelList
A List of labels.
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.