42 if (Pstream::myProcNo(comm) == procIDs[0])
51 commsType == Pstream::commsTypes::scheduled
52 || commsType == Pstream::commsTypes::blocking
55 for (
label i = 1; i < procIDs.
size(); i++)
59 if (contiguous<Type>())
65 reinterpret_cast<char*>(procSlot.
begin()),
81 fromSlave >> procSlot;
89 if (!contiguous<Type>())
92 <<
"nonBlocking not supported for non-contiguous data" 96 label startOfRequests = Pstream::nRequests();
99 for (
label i = 1; i < procIDs.
size(); i++)
107 reinterpret_cast<char*>(procSlot.
begin()),
115 Pstream::waitRequests(startOfRequests);
122 commsType == Pstream::commsTypes::scheduled
123 || commsType == Pstream::commsTypes::blocking
126 if (contiguous<Type>())
132 reinterpret_cast<const char*>(fld.
begin()),
155 if (!contiguous<Type>())
158 <<
"nonBlocking not supported for non-contiguous data" 162 label startOfRequests = Pstream::nRequests();
169 reinterpret_cast<const char*>(fld.
begin()),
176 Pstream::waitRequests(startOfRequests);
195 gather(off, comm, procIDs, fld, allFld, tag, commsType);
197 if (Pstream::myProcNo(comm) == procIDs[0])
216 if (Pstream::myProcNo(comm) == procIDs[0])
222 commsType == Pstream::commsTypes::scheduled
223 || commsType == Pstream::commsTypes::blocking
226 for (
label i = 1; i < procIDs.
size(); i++)
235 if (contiguous<Type>())
241 reinterpret_cast<const char*>(procSlot.
begin()),
265 if (!contiguous<Type>())
268 <<
"nonBlocking not supported for non-contiguous data" 272 label startOfRequests = Pstream::nRequests();
275 for (
label i = 1; i < procIDs.
size(); i++)
288 reinterpret_cast<const char*>(procSlot.
begin()),
296 Pstream::waitRequests(startOfRequests);
303 commsType == Pstream::commsTypes::scheduled
304 || commsType == Pstream::commsTypes::blocking
307 if (contiguous<Type>())
313 reinterpret_cast<char*>(fld.
begin()),
336 if (!contiguous<Type>())
339 <<
"nonBlocking not supported for non-contiguous data" 343 label startOfRequests = Pstream::nRequests();
350 reinterpret_cast<char*>(fld.
begin()),
357 Pstream::waitRequests(startOfRequests);
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void gather(const labelUList &offsets, const label comm, const labelList &procIDs, const UList< Type > &fld, List< Type > &allFld, const int tag=UPstream::msgType(), const Pstream::commsTypes commsType=Pstream::commsTypes::nonBlocking)
Collect data in processor order on master (== procIDs[0]).
commsTypes
Types of communications.
static void scatter(const labelUList &offsets, const label comm, const labelList &procIDs, const UList< Type > &allFld, UList< Type > &fld, const int tag=UPstream::msgType(), const Pstream::commsTypes commsType=Pstream::commsTypes::nonBlocking)
Distribute data in processor order. Requires fld to be sized!
void size(const label)
Override size to be inconsistent with allocated storage.
void deepCopy(const UList< T > &)
Copy elements of the given UList.
Input inter-processor communications stream.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< ' ';}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< ' ';}gmvFile<< nl;forAll(lagrangianScalarNames, i){ const word &name=lagrangianScalarNames[i];IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
iterator begin()
Return an iterator to begin traversing the UList.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Output inter-processor communications stream.
void setSize(const label)
Reset size of List.
std::streamsize byteSize() const
Return the binary size in number of characters of the UList.
T & last()
Return the last element of the list.
label size() const
Return the number of elements in the UList.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.