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];
100 fromBelow >> Values[belowID];
104 Pout<<
" received through " 105 << belowID <<
" data from:" << belowID
106 <<
" data:" << Values[belowID] <<
endl;
110 forAll(belowLeaves, leafI)
112 label leafID = belowLeaves[leafI];
113 fromBelow >> Values[leafID];
117 Pout<<
" received through " 118 << belowID <<
" data from:" << leafID
119 <<
" data:" << Values[leafID] <<
endl;
128 if (myComm.
above() != -1)
144 forAll(belowLeaves, leafI)
146 sendingValues[leafI + 1] = Values[belowLeaves[leafI]];
153 reinterpret_cast<const char*
>(sendingValues.
begin()),
171 forAll(belowLeaves, leafI)
173 label leafID = belowLeaves[leafI];
177 Pout<<
" sending to " 178 << myComm.
above() <<
" data from:" << leafID
179 <<
" data:" << Values[leafID] <<
endl;
181 toAbove << Values[leafID];
217 <<
"Size of list:" << Values.
size()
218 <<
" does not equal the number of processors:" 227 if (myComm.
above() != -1)
239 reinterpret_cast<char*
>(receivedValues.begin()),
240 receivedValues.byteSize(),
245 forAll(notBelowLeaves, leafI)
247 Values[notBelowLeaves[leafI]] = receivedValues[leafI];
261 forAll(notBelowLeaves, leafI)
263 label leafID = notBelowLeaves[leafI];
264 fromAbove >> Values[leafID];
268 Pout<<
" received through " 269 << myComm.
above() <<
" data for:" << leafID
270 <<
" data:" << Values[leafID] <<
endl;
280 const labelList& notBelowLeaves = comms[belowID].allNotBelow();
286 forAll(notBelowLeaves, leafI)
288 sendingValues[leafI] = Values[notBelowLeaves[leafI]];
295 reinterpret_cast<const char*>(sendingValues.begin()),
296 sendingValues.byteSize(),
306 forAll(notBelowLeaves, leafI)
308 label leafID = notBelowLeaves[leafI];
309 toBelow << Values[leafID];
313 Pout<<
" sent through " 314 << belowID <<
" data for:" << leafID
315 <<
" 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.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
#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.
std::streamsize byteSize() const
Return the binary size in number of characters of the UList.
const labelList & allBelow() const
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.
prefixOSstream Pout(cout,"Pout")
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.
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.
const labelList & allNotBelow() const
static bool & parRun()
Is this a parallel run?
static label nProcs(const label communicator=0)
Number of processes in parallel run.
const labelList & below() const
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.