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 reinterpret_cast<char*
>(receivedValues.data()),
88 receivedValues.byteSize(),
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 reinterpret_cast<const char*
>(sendingValues.cdata()),
164 sendingValues.byteSize(),
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 reinterpret_cast<char*
>(receivedValues.data()),
250 receivedValues.byteSize(),
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 reinterpret_cast<const char*
>(sendingValues.cdata()),
306 sendingValues.byteSize(),
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.
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.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static bool & parRun()
Is this a parallel run?
Ostream & endl(Ostream &os)
Add newline and flush stream.
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
#define forAll(list, i)
Loop across all elements in list.
static label read(const commsTypes commsType, const int fromProcNo, char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label communicator=0)
Read into given buffer from given processor and return the.
const labelList & allBelow() const
static bool write(const commsTypes commsType, const int toProcNo, const char *buf, const std::streamsize bufSize, const int tag=UPstream::msgType(), const label communicator=0)
Write given buffer to given processor.
const labelList & allNotBelow() const
errorManip< error > abort(error &err)
Structure for communicating between processors.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
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.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
#define forAllReverse(list, i)
Reverse loop across all elements in list.
Input inter-processor communications stream.
static const List< commsStruct > & linearCommunication(const label communicator=0)
Communication schedule for linear all-to-master (proc 0)
const labelList & below() const
A template class to specify that a data type can be considered as being contiguous in memory.
static const List< commsStruct > & treeCommunication(const label communicator=0)
Communication schedule for tree all-to-master (proc 0)