Go to the documentation of this file.
64 <<
"Size of list:" << Values.size()
65 <<
" does not equal the number of processors:"
76 label belowID = myComm.
below()[belowI];
77 const labelList& belowLeaves = comms[belowID].allBelow();
81 List<T> receivedValues(belowLeaves.size() + 1);
87 receivedValues.data_bytes(),
88 receivedValues.size_bytes(),
93 Values[belowID] = receivedValues[0];
97 Values[belowLeaves[leafI]] = receivedValues[leafI + 1];
110 fromBelow >> Values[belowID];
114 Pout<<
" received through "
115 << belowID <<
" data from:" << belowID
116 <<
" data:" << Values[belowID] <<
endl;
120 forAll(belowLeaves, leafI)
122 label leafID = belowLeaves[leafI];
123 fromBelow >> Values[leafID];
127 Pout<<
" received through "
128 << belowID <<
" data from:" << leafID
129 <<
" data:" << Values[leafID] <<
endl;
138 if (myComm.
above() != -1)
151 List<T> sendingValues(belowLeaves.size() + 1);
154 forAll(belowLeaves, leafI)
156 sendingValues[leafI + 1] = Values[belowLeaves[leafI]];
163 sendingValues.cdata_bytes(),
164 sendingValues.size_bytes(),
181 forAll(belowLeaves, leafI)
183 label leafID = belowLeaves[leafI];
187 Pout<<
" sending to "
188 << myComm.
above() <<
" data from:" << leafID
189 <<
" data:" << Values[leafID] <<
endl;
191 toAbove << Values[leafID];
227 <<
"Size of list:" << Values.size()
228 <<
" does not equal the number of processors:"
237 if (myComm.
above() != -1)
243 List<T> receivedValues(notBelowLeaves.size());
249 receivedValues.data_bytes(),
250 receivedValues.size_bytes(),
255 forAll(notBelowLeaves, leafI)
257 Values[notBelowLeaves[leafI]] = receivedValues[leafI];
271 forAll(notBelowLeaves, leafI)
273 label leafID = notBelowLeaves[leafI];
274 fromAbove >> Values[leafID];
278 Pout<<
" received through "
279 << myComm.
above() <<
" data for:" << leafID
280 <<
" data:" << Values[leafID] <<
endl;
289 label belowID = myComm.
below()[belowI];
290 const labelList& notBelowLeaves = comms[belowID].allNotBelow();
294 List<T> sendingValues(notBelowLeaves.size());
296 forAll(notBelowLeaves, leafI)
298 sendingValues[leafI] = Values[notBelowLeaves[leafI]];
305 sendingValues.cdata_bytes(),
306 sendingValues.size_bytes(),
323 forAll(notBelowLeaves, leafI)
325 label leafID = notBelowLeaves[leafI];
326 toBelow << Values[leafID];
330 Pout<<
" sent through "
331 << belowID <<
" data for:" << leafID
332 <<
" data:" << Values[leafID] <<
endl;
int debug
Static debugging option.
static const List< commsStruct > & linearCommunication(const label communicator=worldComm)
Communication schedule for linear all-to-master (proc 0)
static bool write(const commsTypes commsType, const int toProcNo, const char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label communicator=UPstream::worldComm)
Write given buffer to given processor.
Output inter-processor communications stream.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
Ostream & endl(Ostream &os)
Add newline and flush stream.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
const labelList & below() const noexcept
static label read(const commsTypes commsType, const int fromProcNo, char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label communicator=UPstream::worldComm)
Read into given buffer from given processor.
#define forAll(list, i)
Loop across all elements in list.
const labelList & allNotBelow() const noexcept
errorManip< error > abort(error &err)
Structure for communicating between processors.
static int nProcsSimpleSum
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
static bool & parRun() noexcept
Test if this a parallel run.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const labelList & allBelow() const noexcept
label above() const noexcept
#define forAllReverse(list, i)
Reverse loop across all elements in list.
Input inter-processor communications stream.
static const List< commsStruct > & treeCommunication(const label communicator=worldComm)
Communication schedule for tree all-to-master (proc 0)
static label nProcs(const label communicator=worldComm)
Number of processes in parallel run, and 1 for serial run.
A template class to specify that a data type can be considered as being contiguous in memory.