61 <<
"Size of list:" << Values.
size()
62 <<
" does not equal the number of processors:" 74 const labelList& belowLeaves = comms[belowID].allBelow();
84 reinterpret_cast<char*>(receivedValues.begin()),
85 receivedValues.byteSize(),
90 Values[belowID] = receivedValues[0];
94 Values[belowLeaves[leafI]] = receivedValues[leafI + 1];
107 fromBelow >> Values[belowID];
111 Pout<<
" received through " 112 << belowID <<
" data from:" << belowID
113 <<
" data:" << Values[belowID] <<
endl;
117 forAll(belowLeaves, leafI)
119 label leafID = belowLeaves[leafI];
120 fromBelow >> Values[leafID];
124 Pout<<
" received through " 125 << belowID <<
" data from:" << leafID
126 <<
" data:" << Values[leafID] <<
endl;
135 if (myComm.
above() != -1)
151 forAll(belowLeaves, leafI)
153 sendingValues[leafI + 1] = Values[belowLeaves[leafI]];
160 reinterpret_cast<const char*
>(sendingValues.
begin()),
178 forAll(belowLeaves, leafI)
180 label leafID = belowLeaves[leafI];
184 Pout<<
" sending to " 185 << myComm.
above() <<
" data from:" << leafID
186 <<
" data:" << Values[leafID] <<
endl;
188 toAbove << Values[leafID];
224 <<
"Size of list:" << Values.
size()
225 <<
" does not equal the number of processors:" 234 if (myComm.
above() != -1)
246 reinterpret_cast<char*
>(receivedValues.begin()),
247 receivedValues.byteSize(),
252 forAll(notBelowLeaves, leafI)
254 Values[notBelowLeaves[leafI]] = receivedValues[leafI];
268 forAll(notBelowLeaves, leafI)
270 label leafID = notBelowLeaves[leafI];
271 fromAbove >> Values[leafID];
275 Pout<<
" received through " 276 << myComm.
above() <<
" data for:" << leafID
277 <<
" data:" << Values[leafID] <<
endl;
287 const labelList& notBelowLeaves = comms[belowID].allNotBelow();
293 forAll(notBelowLeaves, leafI)
295 sendingValues[leafI] = Values[notBelowLeaves[leafI]];
302 reinterpret_cast<const char*>(sendingValues.begin()),
303 sendingValues.byteSize(),
320 forAll(notBelowLeaves, leafI)
322 label leafID = notBelowLeaves[leafI];
323 toBelow << Values[leafID];
327 Pout<<
" sent through " 328 << belowID <<
" data for:" << leafID
329 <<
" data:" << Values[leafID] <<
endl;
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
const labelList & below() const
#define forAll(list, i)
Loop across all elements in list.
#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...
void size(const label)
Override size to be inconsistent with allocated storage.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
static int nProcsSimpleSum
Number of processors at which the sum algorithm changes from linear.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Template function to specify if the data of a type are contiguous.
#define forAllReverse(list, i)
Reverse loop across all elements in list.
static const List< commsStruct > & linearCommunication(const label communicator=0)
Communication schedule for linear all-to-master (proc 0)
Input inter-processor communications stream.
iterator begin()
Return an iterator to begin traversing the UList.
static const List< commsStruct > & treeCommunication(const label communicator=0)
Communication schedule for tree all-to-master (proc 0)
errorManip< error > abort(error &err)
Structure for communicating between processors.
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.
Output inter-processor communications stream.
static bool & parRun()
Is this a parallel run?
static label nProcs(const label communicator=0)
Number of processes in parallel run.
std::streamsize byteSize() const
Return the binary size in number of characters of the UList.
prefixOSstream Pout(cout, "Pout")
const labelList & allNotBelow() const
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.