Go to the documentation of this file.
36 template<
class Container,
class T>
53 if (sendBufs.
size() != UPstream::nProcs(comm))
56 <<
"Size of list:" << sendBufs.
size()
57 <<
" does not equal the number of processors:"
58 << UPstream::nProcs(comm)
62 sizes.
setSize(UPstream::nProcs(comm));
63 labelList& nsTransPs = sizes[UPstream::myProcNo(comm)];
64 nsTransPs.
setSize(UPstream::nProcs(comm));
68 nsTransPs[procI] = sendBufs[procI].
size();
76 if (UPstream::parRun() && UPstream::nProcs(comm) > 1)
78 label startOfRequests = Pstream::nRequests();
85 label nRecv = sizes[procI][UPstream::myProcNo(comm)];
87 if (procI != Pstream::myProcNo(comm) && nRecv > 0)
92 UPstream::nonBlocking,
94 reinterpret_cast<char*
>(recvBufs[procI].begin()),
108 if (procI != Pstream::myProcNo(comm) && sendBufs[procI].size() > 0)
114 UPstream::nonBlocking,
116 reinterpret_cast<const char*
>(sendBufs[procI].begin()),
117 sendBufs[procI].size()*
sizeof(
T),
124 <<
"Cannot send outgoing message. "
125 <<
"to:" << procI <<
" nBytes:"
126 <<
label(sendBufs[procI].size()*
sizeof(
T))
138 Pstream::waitRequests(startOfRequests);
143 recvBufs[Pstream::myProcNo(comm)] = sendBufs[Pstream::myProcNo(comm)];
Creates a single block of cells from point coordinates, numbers of cells in each direction and an exp...
#define forAll(list, i)
Loop across all elements in list.
bool read(const char *, int32_t &)
void combineReduce(const List< UPstream::commsStruct > &comms, T &Value, const CombineOp &cop, const int tag, const label comm)
Combination-Reduction operation for a parallel run. The information from all nodes is collected on th...
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static void exchange(const List< Container > &, List< Container > &, labelListList &sizes, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm, const bool block=true)
Exchange data. Sends sendData, receives into recvData, sets.
errorManip< error > abort(error &err)
void setSize(const label)
Reset size of List.
combineReduce operator for lists. Used for counting.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Template function to specify if the data of a type are contiguous.
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.